Skip to content

Commit 971bc33

Browse files
committed
docs(conf): Suppress forward reference warnings from sphinx-autodoc-typehints
why: Types in TYPE_CHECKING blocks (used for circular import avoidance) cause sphinx-autodoc-typehints to emit warnings about unresolvable forward references. These warnings are expected and safe to suppress. what: - Add suppress_warnings config for sphinx_autodoc_typehints.forward_reference
1 parent 26c9003 commit 971bc33

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

docs/conf.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,14 @@
111111
# sphinx.ext.autodoc
112112
autoclass_content = "both"
113113
autodoc_member_order = "bysource"
114-
# Show type hints in signature only (not in description) to avoid RST
115-
# indentation conflicts from sphinx-autodoc-typehints type injection
116-
autodoc_typehints = "signature"
114+
# Automatically extract typehints when specified and place them in
115+
# descriptions of the relevant function/method.
116+
autodoc_typehints = "description"
117117
# Don't show class signature with the class' name.
118118
autodoc_class_signature = "separated"
119119
toc_object_entries_show_parents = "hide"
120120

121121
# sphinx-autodoc-typehints
122-
# When autodoc_typehints = "signature", disable all docstring modifications
123-
# to prevent RST parsing conflicts
124-
always_document_param_types = False
125-
typehints_document_rtype = False
126-
127122
# Suppress warnings for forward references that can't be resolved
128123
# (types in TYPE_CHECKING blocks used for circular import avoidance)
129124
suppress_warnings = [

0 commit comments

Comments
 (0)