Skip to content

Commit af37100

Browse files
authored
Merge pull request DIRACGrid#8336 from fstagni/fix_docs_no_autodoc_inherited_pydantic
docs: Prevent documenting inherited Pydantic internals
2 parents 0c61a5e + 2d78965 commit af37100

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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),

src/DIRAC/Core/Tornado/Server/TornadoService.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def export_streamToClient(self, myDataToSend, token):
7373
:py:class:`BaseRequestHandler <DIRAC.Core.Tornado.Server.private.BaseRequestHandler.BaseRequestHandler>` for more details.
7474
7575
In order to pass information around and keep some states, we use instance attributes.
76-
These are initialized in the :py:meth:`.initialize` method.
76+
These are initialized in the ``initialize`` methods.
7777
7878
The handler only define the ``post`` verb. Please refer to :py:meth:`.post` for the details.
7979

0 commit comments

Comments
 (0)