Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/bump-version-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: "3.11"

Expand Down
55 changes: 42 additions & 13 deletions .github/workflows/jb-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,65 @@ name: jb-docs
on:
push:
branches:
- main # or your default branch
paths-ignore:
- 'pyproject.toml'
- main
workflow_dispatch:

# Required permissions for the official GitHub Pages deployment flow
permissions:
contents: write
contents: read # You only need to read the code to build it
pages: write # Required to upload the site to the Pages server
id-token: write # Required to verify the identity of the runner (OIDC)

# Ensure only one deployment runs at a time to prevent race conditions
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy-book:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v5
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python 3.12
uses: actions/setup-python@v5
# 1. Setup uv (Node 24 compatible version)
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true

# 2. Install dependencies
- name: Install dependencies
run: |
pip install --upgrade pip
pip install ".[docs]"
uv pip install ".[docs]"

# 3. Build the book
- name: Build the book
run: |
jupyter-book build docs/
uv run jupyter-book build docs/

# 4. Upload Pages Artifact (The missing bridge)
# This packs the HTML into a specific format for the deployer
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html

# 5. Deploy to GitHub Pages
# This takes the artifact from Step 4 and makes it live
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
id: deployment
uses: actions/deploy-pages@v4

# 6. Backup/Preview upload (Standard Artifact)
# Note: 'archive: false' is removed because it fails on directories in v7.
- name: Upload Docs Artifact
uses: actions/upload-artifact@v7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
name: html-docs-snapshot
path: docs/_build/html
retention-days: 7
34 changes: 18 additions & 16 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: Python Lint and Format

on:
# Ensure this workflow is run on every push, even pull request.
push:
paths-ignore:
- 'pyproject.toml'

jobs:
build:
Expand All @@ -17,23 +16,26 @@ jobs:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- uses: actions/checkout@v6
# 1. Install uv (much faster than actions/setup-python)
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true # Automatically caches your dependencies

# 2. Install qse using uv
- name: Install qse and testing dependencies
run: |
python -m pip install ".[dev]"
- name: Lint with flake8
run: |
flake8 qse
- name: Sort imports with isort
run: |
isort . --check --diff
- name: Format code with black
uv sync --dev

# 3. Lint & Format (replaces flake8, isort, and black)
- name: Lint and Format with Ruff
run: |
black . --check --diff
uv run ruff check . --output-format github
uv run ruff format --check .

# 4. Test with pytest
- name: Test with pytest
run: |
python -m pytest tests/qse tests/qse_pulser
uv run pytest tests/qse tests/qse_pulser
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.x"

Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,36 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v3
persist-credentials: false

# 1. Setup uv (Caching is extra helpful here given the docs dependency size)
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install qse and docs dependencies
enable-cache: true

# 2. Install qse with docs extras
- name: Install dependencies
run: |
python -m pip install ".[docs]"
uv pip install ".[docs]"

# 3. Build HTML using uv run
- name: Build HTML
run: |
cd docs && make html && cd -
uv run make -C docs html

# 4. Upload artifacts for inspection
- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: html-docs
path: docs/build/html/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: local
hooks:
- id: pre-push-gatekeeper
name: Master Gatekeeper
entry: uv run scripts/pre-push.py
language: system
stages: [pre-push]
pass_filenames: false
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
Loading
Loading