fix: handle Sphinx 9.x new autodoc options key format and sentinels#688
Merged
Conversation
Sphinx 9.x's new non-legacy autodoc uses underscored keys (e.g., `exclude_members`) and the `EMPTY` sentinel instead of hyphenated keys (`exclude-members`) and the `ALL` sentinel used by older Sphinx. This caused `:exclude-members:` to be silently ignored by numpydoc, producing spurious `py:obj reference target not found` warnings for excluded inherited members in nitpicky mode. - Update `ClassDoc.__init__` to check both `exclude_members` and `exclude-members` keys, and normalize `EMPTY` to `ALL` - Update `mangle_docstrings` to use `vars()` instead of the deprecated Mapping interface for `_AutoDocumenterOptions` Closes numpy#671
Collaborator
|
Looks reasonable to me! See any easy way to add a test? Maybe by triggering the |
c4049d3 to
85f1af4
Compare
Contributor
Author
|
done, we can test mangle_docstrings directly |
rossbar
approved these changes
May 21, 2026
Contributor
rossbar
left a comment
There was a problem hiding this comment.
LGTM too, thanks for digging into this @jschueller !
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.
Sphinx 9.x's new non-legacy autodoc uses underscored keys (e.g.,
exclude_members) and theEMPTYsentinel instead of hyphenated keys (exclude-members) and theALLsentinel used by older Sphinx. This caused:exclude-members:to be silently ignored by numpydoc, producing spuriouspy:obj reference target not foundwarnings for excluded inherited members in nitpicky mode.ClassDoc.__init__to check bothexclude_membersandexclude-memberskeys, and normalizeEMPTYtoALLmangle_docstringsto usevars()instead of the deprecated Mapping interface for_AutoDocumenterOptionsCloses #671