Commit cbfb5f6f authored by Samuel GAIST's avatar Samuel GAIST

Merge branch 'autodoc-default-flags-is-removed' into 'master'

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

See merge request !102
parents f89fdfce d26d33c3
Pipeline #45311 passed with stages
in 6 minutes and 9 seconds
......@@ -267,11 +267,11 @@ rst_epilog = """
# Default processing flags for sphinx
autoclass_content = "class"
autodoc_member_order = "bysource"
autodoc_default_flags = [
"members",
"undoc-members",
"show-inheritance",
]
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": True,
}
if "BOB_DOCUMENTATION_SERVER" not in os.environ:
# notice we need to overwrite this for BEAT projects - defaults from Bob are
......@@ -288,25 +288,6 @@ if os.path.exists(sphinx_requirements):
else:
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
# Excludes the "Usage" docstrings from these modules to appear in the API
# documentation
exclude_docstrings = {
......@@ -333,5 +314,4 @@ def remove_module_docstring(app, what, name, obj, options, lines):
def setup(app):
app.connect("autodoc-skip-member", member_function_test)
app.connect("autodoc-process-docstring", remove_module_docstring)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment