From 4b50b9ae3cbbc34dec7cf3336ce8ee0f33a56d64 Mon Sep 17 00:00:00 2001 From: Amir MOHAMMADI <amir.mohammadi@idiap.ch> Date: Tue, 10 Nov 2020 11:34:37 +0100 Subject: [PATCH] Sphinx 3 autodoc no longer accepts autodoc_default_flags and autodoc_default_options should be used --- doc/conf.py | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 07f5e99..cf87d3a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -229,12 +229,12 @@ rst_epilog = """ # Default processing flags for sphinx autoclass_content = 'class' autodoc_member_order = 'bysource' -autodoc_default_flags = [ - 'members', - 'undoc-members', - 'inherited-members', - 'show-inheritance', - ] +autodoc_default_options = { + "members": True, + "undoc-members": True, + "inherited-members": True, + "show-inheritance": True, +} # For inter-documentation mapping: from bob.extension.utils import link_documentation, load_requirements @@ -248,23 +248,4 @@ 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 - -def setup(app): - app.connect('autodoc-skip-member', member_function_test) -- GitLab