diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 946a6be3d..e87555b1b 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 dev --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"