8000 DOC: Hide pybind11 base object from inheritance · matplotlib/matplotlib@a0649e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0649e7

Browse files
committed
DOC: Hide pybind11 base object from inheritance
And also ignore the `numpy.float64` reference. The latter seems to be broken since Sphinx tries to auto-link type hints as `py:class`, but it's an alias in NumPy making it a `py:attr` in their inventory.
1 parent 6ef1b97 commit a0649e7

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,20 @@ def tutorials_download_error(record):
230230
autodoc_docstring_signature = True
231231
autodoc_default_options = {'members': None, 'undoc-members': None}
232232

233+
234+
def autodoc_process_bases(app, name, obj, options, bases):
235+
"""
236+
Hide pybind11 base object from inheritance tree.
237+
238+
Note, *bases* must be modified in place.
239+
"""
240+
for cls in bases[:]:
241+
if not isinstance(cls, type):
242+
continue
243+
if cls.__module__ == 'pybind11_builtins' and cls.__name__ == 'pybind11_object':
244+
bases.remove(cls)
245+
246+
233247
# make sure to ignore warnings that stem from simply inspecting deprecated
234248
# class-level attributes
235249
warnings.filterwarnings('ignore', category=DeprecationWarning,
@@ -847,5 +861,6 @@ def setup(app):
847861
bld_type = 'rel'
848862
app.add_config_value('skip_sub_dirs', 0, '')
849863
app.add_config_value('releaselevel', bld_type, 'env')
864+
app.connect('autodoc-process-bases', autodoc_process_bases)
850865
if sphinx.version_info[:2] < (7, 1):
851866
app.connect('html-page-context', add_html_cache_busting, priority=1000)

doc/missing-references.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@
268268
"<unknown>:1",
269269
"doc/api/_as_gen/mpl_toolkits.axisartist.floating_axes.rst:32:<autosummary>:1"
270270
],
271+
"numpy.float64": [
272+
"doc/docstring of matplotlib.ft2font.PyCapsule.set_text:1"
273+
],
271274
"numpy.uint8": [
272275
"<unknown>:1"
273276
]

0 commit comments

Comments
 (0)
0