Skip to content

Commit 7582674

Browse files
committed
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
1 parent 5bc2560 commit 7582674

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎doc/source/conf.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
# This file should be a Windows icon file (.ico) being 16x16 or 32x32 pixels large.
112112
# html_favicon = None
113113

114+
# Do not documento the attributes holidng a class's namespace. Their reprs embed
115+
+# frozensets whose order depends on string hashing, which makes the generated
116+
+# HTML vary between builds.
117+
+autodoc_default_options = {"exclude-members": "__dict__, __weakref__"}
118+
114119
# Add any paths that contain custom static files (such as style sheets) here, relative
115120
# to this directory. They are copied after the builtin static files, so a file named
116121
# "default.css" will overwrite the builtin "default.css".

0 commit comments

Comments
 (0)