Skip to content
Snippets Groups Projects
Commit 14ab1f87 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Sphinx 3 autodoc no longer accepts autodoc_default_flags and autodoc_default_options should be used

parent b667cf6c
No related branches found
No related tags found
No related merge requests found
Pipeline #45504 failed
...@@ -235,10 +235,10 @@ rst_epilog = """ ...@@ -235,10 +235,10 @@ rst_epilog = """
# Default processing flags for sphinx # Default processing flags for sphinx
autoclass_content = "class" autoclass_content = "class"
autodoc_member_order = "bysource" autodoc_member_order = "bysource"
autodoc_default_flags = [ autodoc_default_options = {
"members", "members": True,
"show-inheritance", "show-inheritance": True,
] }
# For inter-documentation mapping: # For inter-documentation mapping:
from bob.extension.utils import link_documentation, load_requirements from bob.extension.utils import link_documentation, load_requirements
...@@ -250,26 +250,3 @@ if os.path.exists(sphinx_requirements): ...@@ -250,26 +250,3 @@ if os.path.exists(sphinx_requirements):
) )
else: else:
intersphinx_mapping = link_documentation() intersphinx_mapping = link_documentation()
# We want to remove all private (i.e. _. or __.__) members
# that are not in the list of accepted functions
accepted_private_functions = ["__array__"]
def member_function_test(app, what, name, obj, skip, options):
# test if we have a private function
if len(name) > 1 and name[0] == "_":
# test if this private function should be allowed
if name not in accepted_private_functions:
# omit privat functions that are not in the list of accepted private functions
return skip
else:
# test if the method is documented
if not hasattr(obj, "__doc__") or not obj.__doc__:
return skip
return False
def setup(app):
app.connect("autodoc-skip-member", member_function_test)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment