From 7582674e201a82ad519cf37c09c16a08e64ed49e Mon Sep 17 00:00:00 2001 From: Emmanuel Arias Date: Sat, 17 Oct 2026 15:37:39 -0300 Subject: [PATCH 1/3] Make de api reference reproducible 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 --- doc/source/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 809762483..edf488e72 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -111,6 +111,11 @@ # This file should be a Windows icon file (.ico) being 16x16 or 32x32 pixels large. # html_favicon = None +# Do not documento the attributes holidng a class's namespace. Their reprs embed ++# frozensets whose order depends on string hashing, which makes the generated ++# HTML vary between builds. ++autodoc_default_options = {"exclude-members": "__dict__, __weakref__"} + # Add any paths that contain custom static files (such as style sheets) here, relative # to this directory. They are copied after the builtin static files, so a file named # "default.css" will overwrite the builtin "default.css". From a3241fa7d48ea1a422d969d54101e813689014f1 Mon Sep 17 00:00:00 2001 From: Emmanuel Arias Date: Sat, 17 Oct 2026 15:48:30 -0300 Subject: [PATCH 2/3] Fix autodoc_default_options in conf.py Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- doc/source/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index edf488e72..a8a5427ba 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -112,9 +112,9 @@ # html_favicon = None # Do not documento the attributes holidng a class's namespace. Their reprs embed -+# frozensets whose order depends on string hashing, which makes the generated -+# HTML vary between builds. -+autodoc_default_options = {"exclude-members": "__dict__, __weakref__"} +# frozensets whose order depends on string hashing, which makes the generated +# HTML vary between builds. +autodoc_default_options = {"exclude-members": "__dict__, __weakref__"} # Add any paths that contain custom static files (such as style sheets) here, relative # to this directory. They are copied after the builtin static files, so a file named From 2a176d9dadac1ba7ed56ac87985100c095251e30 Mon Sep 17 00:00:00 2001 From: Emmanuel Arias Date: Sat, 17 Oct 2026 19:20:12 -0300 Subject: [PATCH 3/3] Fix typo in documentation comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a8a5427ba..032e55cfe 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -111,7 +111,7 @@ # This file should be a Windows icon file (.ico) being 16x16 or 32x32 pixels large. # html_favicon = None -# Do not documento the attributes holidng a class's namespace. Their reprs embed +# Do not document the attributes holding a class's namespace. Their reprs embed # frozensets whose order depends on string hashing, which makes the generated # HTML vary between builds. autodoc_default_options = {"exclude-members": "__dict__, __weakref__"}