sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.46k stars 2.1k forks source link

Linting failures with mypy from types-docutils 0.21.0.20240704 #12510

Closed jfbu closed 2 months ago

jfbu commented 3 months ago

Describe the bug

sphinx/util/parsing.py: note: In function "nested_parse_to_nodes":
sphinx/util/parsing.py:18:12: error: Missing type parameters for generic type "RSTState"  [type-arg]
sphinx/util/parsing.py: note: In function "_fresh_title_style_context":
sphinx/util/parsing.py:70:39: error: Missing type parameters for generic type "RSTState"  [type-arg]
sphinx/util/nodes.py: note: In function "nested_parse_with_titles":
sphinx/util/nodes.py:328:37: error: Missing type parameters for generic type "RSTState"  [type-arg]
sphinx/ext/autodoc/directive.py: note: In member "run" of class "AutodocDirective":
sphinx/ext/autodoc/directive.py:115:30: error: "Reporter" has no attribute "get_source_and_line"  [attr-defined]
tests/test_util/test_util_docutils_sphinx_directive.py: note: In function "make_directive_and_state":
tests/test_util/test_util_docutils_sphinx_directive.py:18:103: error: Missing type parameters for generic type "RSTState"  [type-arg]
tests/test_util/test_util_docutils_sphinx_directive.py:23:13: error: Need type annotation for "state"  [var-annotated]
sphinx/ext/inheritance_diagram.py:381: error: Unused "type: ignore" comment  [unused-ignore]
sphinx/ext/inheritance_diagram.py: note: In member "run" of class "InheritanceDiagram":
sphinx/ext/inheritance_diagram.py:389:57: error: Argument 5 has incompatible type "RSTState[Any]"; expected "Inliner"  [arg-type]
Found 8 errors in 5 files (checked 296 source files)

How to Reproduce

mypy linting

See https://github.com/sphinx-doc/sphinx/actions/runs/9789252384/job/27028649762

Environment Information

Sphinx at 086a7913d

Sphinx extensions

No response

Additional context

https://pypi.org/project/types-docutils/0.21.0.20240704/ has been released.

jayaddison commented 3 months ago

Are you preparing changes to resolve this @jfbu? I can pick it up if not.

jfbu commented 3 months ago

@jayaddison

Are you preparing changes to resolve this @jfbu? I can pick it up if not.

No I was not preparing changes in part because I am finishing other things and soon will be packing... (a convoluted way to say I feel not competent enough ;-) )

jayaddison commented 3 months ago

No problem - I'm not sure yet whether I am either, but let's find out :)