Repository navigation
docs: Generate libpython API docs only under the grass namespace - #7740
Merged
Merged
Conversation
The Sphinx build of the Python library documented every subpackage twice: once under a stripped namespace (pygrass, script, temporal, ...) and once under the full, preferred one (grass.pygrass, grass.script, ...). Keep only the grass.* pages. Drop the seven per-subpackage sphinx-apidoc runs and the sys.path entries in conf.py that made the modules importable under their stripped names, and point the handwritten pages, the theme navigation and the links in doc/ at the grass.* pages and modules. This removes 22 of the 42 Sphinx warnings. All ten "more than one target found for cross-reference" warnings (Table, GrassTestFilesMultiReporter) are gone, since they were caused purely by the duplicate generation, as are the docstring warnings which were reported once per spelling. The three remaining "duplicate object description" warnings (Module, MultiModule, ParallelModuleQueue) are not caused by the stripped namespace: grass.pygrass.modules re-exports these classes, so autodoc documents them both on the package page and on the page of the module defining them. They are left for a separate change. This change was prepared with the assistance of Claude Code.
echoix
approved these changes
Jul 17, 2026
echoix
left a comment
Member
There was a problem hiding this comment.
After this, it might be possible to retry using a static configuration of sphinx.ext.apidoc (instead of caling a command line tool apidoc from a makefile), some work that I tried to do in June 2025, but was impossible to configure correctly because of the complex mapping that was needed, and the fact that that new Sphinix isolated extension didn't support of the required configs that was available in the old way. My PR finally never got merged sphinx-doc/sphinx#13668
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Sphinx build of the Python library originally documented every subpackage under a stripped namespace (pygrass, script, temporal, ...). Then we added the top-level namespace
grassto match the documentation with the code (full, preferred one, such as grass.pygrass and grass.script). Now is the time to keep only the grass.* documentation pages (after release, new documentation, other Sphinx cleanups).This is a follow-up to #7526 and removes the warnings about the subpackages packages being documented twice.
Details
Drop the seven per-subpackage sphinx-apidoc runs and the sys.path entries in conf.py that made the modules importable under their stripped names, and point the handwritten pages, the theme navigation and the links in doc/ at the grass.* pages and modules.
This removes 22 of the 42 Sphinx warnings. All ten "more than one target
found for cross-reference" warnings (Table, GrassTestFilesMultiReporter)
are gone, since they were caused purely by the duplicate generation, as
are the docstring warnings which were reported once per spelling.
The three remaining "duplicate object description" warnings (Module,
MultiModule, ParallelModuleQueue) are not caused by the stripped
namespace: grass.pygrass.modules re-exports these classes, so autodoc
documents them both on the package page and on the page of the module
defining them. They are left for a separate change.
This change was prepared with the assistance of Claude Code.