diff --git a/spec/conf.py b/spec/conf.py index 5370da268..5493713b3 100644 --- a/spec/conf.py +++ b/spec/conf.py @@ -47,6 +47,16 @@ add_module_names = False napoleon_custom_sections = [('Returns', 'params_style')] +# Make autosummary show the signatures of functions in the tables using actual +# Python syntax. There's currently no supported way to do this, so we have to +# just patch out the function that processes the signatures. See +# https://github.com/sphinx-doc/sphinx/issues/10053. +import sphinx.ext.autosummary as autosummary_mod +if hasattr(autosummary_mod, '_module'): + # It's a sphinx deprecated module wrapper object + autosummary_mod = autosummary_mod._module +autosummary_mod.mangle_signature = lambda sig, max_chars=30: sig + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -162,4 +172,4 @@ def process_signature(app, what, name, obj, options, signature, return_annotatio return signature, return_annotation def setup(app): - app.connect("autodoc-process-signature", process_signature) \ No newline at end of file + app.connect("autodoc-process-signature", process_signature)