Commit 87a797f5 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 !129
parents 7464d206 36f4fa38
Pipeline #45307 passed with stage
in 18 minutes and 42 seconds
......@@ -153,13 +153,6 @@ class Experiment(object):
Attributes:
label (str): The full, valid label of this experiment
description (str): The short description string, loaded from the JSON
file if one was set.
documentation (str): The full-length docstring for this object.
storage (object): A simple object that provides information about file
paths for this toolchain
......@@ -1063,7 +1056,7 @@ class Experiment(object):
@property
def label(self):
"""Returns the label of this experiment"""
"""Label of this experiment"""
return self._label or "__unlabelled_experiment__"
......@@ -1076,7 +1069,7 @@ class Experiment(object):
@property
def schema_version(self):
"""Returns the schema version"""
"""Schema version"""
return self.data.get("schema_version", 1)
......
......@@ -150,13 +150,6 @@ class Plotter(object):
Attributes:
name (str): The algorithm name
description (str): The short description string, loaded from the JSON
file if one was set.
documentation (str): The full-length docstring for this object.
storage (object): A simple object that provides information about file
paths for this algorithm
......@@ -166,12 +159,6 @@ class Plotter(object):
libraries (dict): A mapping object defining other libraries this plotter
needs to load so it can work properly.
uses (dict): A mapping object defining the required library import name
(keys) and the full-names (values).
parameters (dict): A dictionary containing all pre-defined parameters
that this algorithm accepts.
errors (list): A list containing errors found while loading this
algorithm.
......@@ -317,7 +304,7 @@ class Plotter(object):
@property
def name(self):
"""Returns the name of this object
"""The name of this object
"""
return self._name or "__unnamed_plotter__"
......@@ -342,7 +329,9 @@ class Plotter(object):
return self.data.get("api_version", 1)
def uses_dict(self):
"""Returns the usage dictionary for all dependent modules"""
"""A mapping object defining the required library import name (keys) and the
full-names (values).
"""
if self.data["language"] == "unknown":
raise RuntimeError("plotter has no programming language set")
......
......@@ -74,8 +74,6 @@ class Statistics(object):
errors (list): A list strings containing errors found while loading this
statistics information.
data (dict): The original data for these statistics
"""
def __init__(self, data=None):
......
......@@ -97,13 +97,6 @@ class Toolchain(object):
Attributes:
name (str): The toolchain name
description (str): The short description string, loaded from the JSON
file if one was set.
documentation (str): The full-length docstring for this object.
storage (object): A simple object that provides information about file
paths for this toolchain
......@@ -365,7 +358,7 @@ class Toolchain(object):
@property
def name(self):
"""Returns the name of this object"""
"""The name of this object"""
return self._name or "__unnamed_toolchain__"
......
......@@ -260,7 +260,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
......@@ -282,26 +286,3 @@ intersphinx_mapping["http://simplejson.readthedocs.io/en/stable/"] = None
intersphinx_mapping["http://pyzmq.readthedocs.io/en/stable/"] = None
intersphinx_mapping["http://python-jsonschema.readthedocs.io/en/stable/"] = None
intersphinx_mapping["https://docker-py.readthedocs.io/en/stable/"] = None
# 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 private 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)
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