Repository navigation
Make de api reference reproducible - #2291
Merged
Merged
Conversation
The API reference uses `:special-members:`, so autodoc also documents the `__dict__` of the `TypedDict` classes in `git.types`. Its repr is a `mappingproxy` containing `frozenset` objects, whose iteration order depends on string hash randomization. As a result `reference.html` differs from one build to another. Exclude `__dict__` and `__weakref__` by default. They only hold the class namespace and carry no useful documentation. The `__required_keys__` and similar attributes are still documented, since Sphinx sorts sets when it renders them on their own. The original issue was reported https://bugs.debian.org/1100149
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Literal leading + characters cause a confirmed syntax error that prevents Sphinx from loading its configuration.
1 open issue
What changed in this PR
GitHub Copilot review: This PR aims to make GitPython’s API reference reproducible by excluding attributes with unstable representations.
Changes:
- Adds default autodoc exclusions for
__dict__and__weakref__. - Adds a comment explaining the reproducibility rationale.
| File | Description |
|---|---|
doc/source/conf.py |
Configures autodoc exclusions for reproducible documentation. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 API reference uses
:special-members:, so autodoc also documentsthe
__dict__of theTypedDictclasses ingit.types. Its repr isa
mappingproxycontainingfrozensetobjects, whose iterationorder depends on string hash randomization. As a result
reference.htmldiffers from one build to another.Exclude
__dict__and__weakref__by default. They only hold theclass namespace and carry no useful documentation. The
__required_keys__and similar attributes are still documented,since Sphinx sorts sets when it renders them on their own.
The original issue was reported https://bugs.debian.org/1100149