diff --git a/docs/conf.py b/docs/conf.py index 1d74bc42a14a..60b82658b081 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,7 +34,6 @@ "sphinx.ext.viewcode", "sphinx.ext.extlinks", "sphinx.ext.intersphinx", - "sphinx_autodoc_typehints", "reno.sphinxext", "sphinx_design", "matplotlib.sphinxext.plot_directive", @@ -85,6 +84,13 @@ # documentation created by autosummary uses a template file (in autosummary in the templates path), # which likely overrides the autodoc defaults. +# Move type hints from signatures to the parameter descriptions (except in overload cases, where +# that's not possible). +autodoc_typehints = "description" +# Only add type hints from signature to description body if the parameter has documentation. The +# return type is always added to the description (if in the signature). +autodoc_typehints_description_target = "documented_params" + autosummary_generate = True autosummary_generate_overwrite = False autoclass_content = "both" diff --git a/requirements-dev.txt b/requirements-dev.txt index 54d0f552546d..3f19213a0288 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,9 +16,8 @@ pylatexenc>=1.4 ddt>=1.2.0,!=1.4.0,!=1.4.3 seaborn>=0.9.0 reno>=3.4.0 -Sphinx>=3.0.0 +Sphinx>=5.0 qiskit-sphinx-theme>=1.6 -sphinx-autodoc-typehints==1.21.1 # revert to >=1.18 once the incompatibilities are fixed sphinx-design>=0.2.0 pygments>=2.4 scikit-learn>=0.20.0