Skip to content

Make de api reference reproducible - #2291

Open
eamanu wants to merge 3 commits into
gitpython-developers:mainfrom
eamanu:make-doc-reproducible
Open

eamanu wants to merge 3 commits into
gitpython-developers:mainfrom
eamanu:make-doc-reproducible

Conversation

@eamanu

@eamanu eamanu commented Oct 17, 2026

Copy link
Copy Markdown

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

 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
Copilot AI balanced review requested due to automatic review settings October 17, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread doc/source/conf.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The configuration matches the intended behavior, with only a non-blocking comment spelling correction remaining.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread doc/source/conf.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 22:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow documentation configuration change addresses the reported nondeterminism without affecting runtime behavior.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants