Skip to content

Commit 6616641

Browse files
Remove sphinx-autodoc-typehints, no longer needed
Now done by autodoc and napoleon themselves
1 parent cad53b4 commit 6616641

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

docs/source/conf.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
# ones.
105105
extensions = [
106106
"sphinx.ext.autodoc", # To auto-generate docs from Python docstrings
107-
"sphinx.ext.autosectionlabel", # Allow reference sections using its title
107+
"sphinx.ext.autosectionlabel", # Allow reference sections using its title
108108
"sphinx.ext.todo", # Support for todo items
109109
"sphinx.ext.napoleon", # Support for NumPy and Google style docstrings
110110
"sphinx.ext.intersphinx", # Generate links to other documentation files
@@ -119,9 +119,8 @@
119119
# 'IPython.sphinxext.ipython_directive', # numpy
120120
"sphinx.ext.mathjax", # Render math as images
121121
"recommonmark", # For markdown support, does not support 'full' CommonMark syntax (yet)!
122-
"sphinx_autodoc_typehints", # Auto-parse type hints. Napoleon BEFORE typehints
123122
"sphinxcontrib.mermaid", # Draw graphs using Mermaid.js
124-
"sphinx_immaterial", # Sphinx immaterial theme
123+
"sphinx_immaterial", # Sphinx immaterial theme
125124
]
126125

127126
# Add any paths that contain templates here, relative to this directory.
@@ -300,7 +299,7 @@
300299
# -- Extension configuration -------------------------------------------------
301300
# Configuration of sphinx.ext.autodoc
302301
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
303-
autodoc_typehints = "none" # Use sphinx_autodoc_typehints instead
302+
autodoc_typehints = "signature"
304303

305304

306305
# from recommonmark.transform import AutoStructify
@@ -334,7 +333,7 @@
334333
# See https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
335334
napoleon_google_docstring = True
336335
napoleon_numpy_docstring = False
337-
# napoleon_include_init_with_doc = False # Handled by our Sphinx template
336+
# napoleon_include_init_with_doc = False # Handled by our Sphinx template
338337
# napoleon_include_private_with_doc = False # Handled by our Sphinx template
339338
# napoleon_include_special_with_doc = True
340339
# napoleon_use_admonition_for_examples = False
@@ -396,7 +395,9 @@
396395
"pd.DataFrame": "~pandas.NaT",
397396
} # TODO: From xarray, improve! New in 3.2
398397

399-
napoleon_attr_annotations = True # Allow PEP 526 attributes annotations in classes. New in 3.4
398+
napoleon_attr_annotations = (
399+
True # Allow PEP 526 attributes annotations in classes. New in 3.4
400+
)
400401

401402
# From xarray, huh?
402403
# napoleon_preprocess_types = True #From xarray, not in docs
@@ -426,18 +427,6 @@
426427
# Configuration of sphinx.ext.mathjax
427428
# See https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjax
428429

429-
# Configuration of sphinx_autodoc_typehints
430-
# See https://pypi.org/project/sphinx-autodoc-typehints/
431-
set_type_checking_flag = (
432-
True # Set typing.TYPE_CHECKING to True to enable "expensive" typing imports
433-
)
434-
# typehints_fully_qualified = False # If True, class names are always fully qualified (e.g. module.for.Class). If False, just the class name displays (e.g. Class)
435-
always_document_param_types = (
436-
True # add stub documentation for undocumented parameters to be able to add type info.
437-
)
438-
# typehints_document_rtype = True # If False, never add an :rtype: directive. If True, add the :rtype: directive if no existing :rtype: is found.
439-
# simplify_optional_unions = True # If True, optional parameters of type "Union[...]" are simplified as being of type Union[..., None] in the resulting documention (e.g. Optional[Union[A, B]] -> Union[A, B, None]). # If False, the "Optional"-type is kept. Note: If False, any Union containing None will be displayed as Optional! Note: If an optional parameter has only a single type (e.g Optional[A] or Union[A, None]), it will always be displayed as Optional!
440-
441430

442431
def escape_underscores(string):
443432
return string.replace("_", r"\_")

0 commit comments

Comments
 (0)