Skip to content

Commit 1af8c72

Browse files
committed
docs: Prevent documenting inherited Pydantic internals
1 parent 385b299 commit 1af8c72

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

docs/source/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,18 @@
108108
]
109109

110110

111+
def skip_inherited_members(app, what, name, obj, skip, options):
112+
removals_list = [
113+
"model_json_schema", # for pydantic.main.BaseModel.model_json_schema
114+
"send_error",
115+
] # for http.server.BaseHTTPRequestHandler.send_error
116+
if name in removals_list:
117+
return True
118+
return skip
119+
120+
111121
def setup(app):
122+
app.connect("autodoc-skip-member", skip_inherited_members)
112123
app.add_config_value(
113124
"recommonmark_config",
114125
{
@@ -301,7 +312,6 @@ def setup(app):
301312
# packages that cannot be installed in RTD
302313
autodoc_mock_imports = DIRAC_DOC_MOCK_LIST
303314

304-
305315
# link with the python standard library docs
306316
intersphinx_mapping = {
307317
"python": ("https://docs.python.org/3/", None),

0 commit comments

Comments
 (0)