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
18 changes: 18 additions & 0 deletions .claude/scripts/test_setup_script_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Copy the repository, run setup_project.sh with a new name and build the docs site of the copy,
# to check that the rename reaches the Astro config and the API pages.
set -euo pipefail
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
PYTHON="${PYTHON:-$REPO/.venv-docs/bin/python}"
WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
rsync -a --exclude .git --exclude node_modules --exclude dist --exclude .astro --exclude .venv-docs "$REPO/" "$WORK/"
cd "$WORK"
bash setup_project.sh my-test-app
grep -q "const pythonPackage = 'my_test_app'" docs/astro.config.mjs
grep -q "/api/my_test_app/" docs/src/components/Header.astro
grep -q "from my_test_app.main import main" docs/src/content/docs/getting-started/quickstart.md
cp -cR "$REPO/docs/node_modules" docs/node_modules 2>/dev/null || cp -R "$REPO/docs/node_modules" docs/node_modules
cd docs && DOCS_PYTHON="$PYTHON" npm run build 2>&1 | tail -25
test -f dist/api/my_test_app/main/index.html
echo "setup script + docs build: OK"
36 changes: 0 additions & 36 deletions .github/actions/build-docs/action.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Docs

# The Astro + Starlight site in docs/: hand-written pages, the executed tutorials and the API
# reference. Built on every push and pull request; deployed to GitHub Pages from main.

on:
push:
branches: ["main", "devel"]
pull_request:
branches: ["main", "devel"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Install the package with the docs extra
run: |
python -m pip install --upgrade pip
pip install -e ".[docs]"
python -m ipykernel install --user --name python3

- name: Execute and convert the tutorials
run: |
python docs/tools/notebooks.py execute
python docs/tools/notebooks.py convert --strict

- name: Build the site
working-directory: docs
run: |
npm ci
npm run check:mdx
DOCS_PYTHON="$(command -v python)" npm run build

- uses: actions/upload-pages-artifact@v3
with:
path: docs/dist

deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
44 changes: 0 additions & 44 deletions .github/workflows/publish_docs.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:

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

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install build tools
run: |
Expand Down
40 changes: 12 additions & 28 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ on:
- main
- devel

defaults:
run:
shell: bash

jobs:
pre-commit:
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
Expand All @@ -26,35 +22,23 @@ jobs:
with:
python-version: "3.10"

- name: Run pre-commit
uses: pre-commit/action@v3.0.1
- name: Install ruff
run: pip install ruff

cloc:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Lint
run: ruff check .

- name: Download and run cloc
run: |
curl -s https://raw.githubusercontent.com/AlDanial/cloc/master/cloc > cloc
chmod +x cloc
./cloc --version
./cloc $(git ls-files)
- name: Check formatting
run: ruff format --check .

mypy:
readme:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Type checking with mypy
run: |
pip install mypy
mypy src/ || true
- name: Check that README.md is rendered from README.qmd
run: make readme-check
36 changes: 0 additions & 36 deletions .github/workflows/test_docs.yml

This file was deleted.

17 changes: 7 additions & 10 deletions .github/workflows/test_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,20 @@ on:
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install project
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_setup_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Run setup script
run: |
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/test_tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,27 @@ on:
jobs:
tutorials:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install project
run: |
pip install --upgrade pip
pip install ".[dev]"
pip install ".[docs]"
python -m ipykernel install --user --name python3

- name: Execute tutorials
run: |
jupyter nbconvert --to notebook --execute tutorials/*.ipynb --output-dir=/tmp --ExecutePreprocessor.timeout=300
python docs/tools/notebooks.py execute --force
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/source/tutorials/
# Documentation site (docs/.gitignore has the Astro build output)

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -172,4 +170,7 @@ cython_debug/

# Unit test output
junit/
docs/source/api/_autosummary/

# Quarto
.quarto/
README_files/
Loading
Loading