Fix redundant/incomplete installs in docs CI, replace with pyproject.toml optional deps#3226
Conversation
Add numpydoc to the pip install step in .github/workflows/publish-book.yml so the book build includes support for NumPy-style docstring parsing alongside jupyter-book and sphinxcontrib-mermaid.
Include "numpydoc" in the docs extra of pyproject.toml so NumPy-style docstrings are rendered correctly in the project's documentation builds.
Remove an explicit pip install of jupyter-book==1.0.4.post1, sphinxcontrib-mermaid, and numpydoc from the publish-book GitHub Actions workflow. These docs dependencies are already installed via `python -m pip install .[docs]`, so the extra install was redundant and could cause downstream issues, while conflicting with the intent that pyproject.toml be the single source of truth.
There was a problem hiding this comment.
Pull request overview
This PR consolidates the documentation CI by making pyproject.toml the single source of truth for docs dependencies. It adds the missing numpydoc package (used as a Sphinx extension in _config.yml) to the [docs] optional dependencies, removes the now-redundant explicit pip install of jupyter-book and sphinxcontrib-mermaid from the CI workflow, and cleans up the pyproject.toml formatting by moving the [tool.isort] section out of the [tool.yapf] block where it was previously indented.
Changes:
- Added
numpydocto[project.optional-dependencies.docs]inpyproject.toml - Removed redundant
pip install jupyter-book==1.0.4.post1 sphinxcontrib-mermaidstep from.github/workflows/publish-book.yml - Moved and reformatted the
[tool.isort]section inpyproject.toml, separating it from[tool.yapf]
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pyproject.toml |
Adds numpydoc to docs optional deps; moves [tool.isort] to its own section earlier in the file; removes isort config from within the yapf block |
.github/workflows/publish-book.yml |
Removes the explicit redundant install of jupyter-book and sphinxcontrib-mermaid, now covered by pip install .[docs] |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Fix documentation dependencies
numpydocto thedocsdependencies inpyproject.tomlto support NumPy-style docstrings in documentation builds.jupyter-bookandsphinxcontrib-mermaidfrom the GitHub Actions workflow, as these are now managed throughpyproject.tomlunder[docs].Miscellaneous changes
Ran pre-commit hooks on pyproject.toml.
Code formatting and style configuration:
[tool.isort]section inpyproject.tomlfor better clarity and maintainability, ensuring consistent import sorting across the codebase. [1] [2]