From fe501fa34b4a39799f6ab4de61771d3707af7935 Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Tue, 27 Oct 2026 20:22:11 -0700 Subject: [PATCH 1/2] MNT add a docs dependency group Replace the hand-written docs pip lists in CI, README and AGENTS.md. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build_docs.yml | 3 +-- AGENTS.md | 4 ++-- README.md | 4 ++-- pyproject.toml | 9 +++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 946a6be3d..c7c6a2c51 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -44,8 +44,7 @@ jobs: pip install --upgrade pip # force using latest nibabel pip install -U nibabel - pip install -q ipython Sphinx sphinx-gallery numpydoc # TODO: move to pyproject.toml - pip install -e . --group dev + pip install -e . --group docs python -c 'import cortex; print(cortex.__full_version__)' - name: Cache Playwright browsers diff --git a/AGENTS.md b/AGENTS.md index 4fdf2e06a..89ce4f06b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,8 +35,8 @@ uv run pytest -p no:cacheprovider --no-cov -x cortex/tests/test_formats.py # qu ### Docs ```bash -uv pip install sphinx_gallery numpydoc # not (yet) a dependency group -cd docs && uv run make html # gallery examples need Inkscape and Playwright too +uv sync --all-extras --group docs # sphinx, sphinx-gallery, numpydoc, ipython, playwright +cd docs && uv run make html # gallery examples also need Inkscape and Playwright Chromium ``` ## Architecture diff --git a/README.md b/README.md index 1ec21fb7a..36f0e6685 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ You can find many examples of pycortex features in the [pycortex example gallery To build the documentation locally: ```bash -# Install required dependencies for the documentation -pip install sphinx_gallery numpydoc +# Install pycortex with the documentation dependencies (needs pip >= 25.1) +pip install -e . --group docs # Move into the docs folder (assuming already in pycortex directory) cd docs # Build a local version of the documentation site diff --git a/pyproject.toml b/pyproject.toml index ba26f4457..91809bab1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,15 @@ types = [ "scipy-stubs", ] +docs = [ + # The gallery examples render WebGL views headlessly and use IPython. + "pycortex[headless]", + "ipython", + "numpydoc", + "sphinx", + "sphinx-gallery", +] + [project.optional-dependencies] headless = [ "playwright>=1.58.0" From 9afa5da448f3b1b42cb76c74c46baee816d540d4 Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Tue, 27 Oct 2026 20:29:56 -0700 Subject: [PATCH 2/2] docs workflow: also install dev group --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index c7c6a2c51..e87555b1b 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -44,7 +44,7 @@ jobs: pip install --upgrade pip # force using latest nibabel pip install -U nibabel - pip install -e . --group docs + pip install -e . --group dev --group docs python -c 'import cortex; print(cortex.__full_version__)' - name: Cache Playwright browsers