Skip to content

[docutils] Impove main stubs #14107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

donBarbos
Copy link
Contributor

No description provided.

This comment has been minimized.

adamtheturtle added a commit to adamtheturtle/typeshed that referenced this pull request May 21, 2025
Required to avoid adding new ignores to Sphinx with the latest types-docutils.
See sphinx-doc/sphinx#13564.

Copied form @donBarbos's WIP at python#14107.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@donBarbos donBarbos changed the title WIP: Impove docutils [docutils]: Impove main stubs Jun 8, 2025
Copy link
Contributor

github-actions bot commented Jun 8, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/docutils.py: note: In member "write" of class "SphinxFileOutput":
+ sphinx/util/docutils.py:453:16: error: Call to untyped function "write" in typed context  [no-untyped-call]
+ sphinx/util/docfields.py: note: In member "_transform_step_1" of class "DocFieldTransformer":
+ sphinx/util/docfields.py:461:41: error: Incompatible types in assignment (expression has type "document | Any | None", variable has type "document")  [assignment]
+ sphinx/builders/__init__.py: note: In member "read_doc" of class "Builder":
+ sphinx/builders/__init__.py:650:9: error: "dict[str, Any]" has no attribute "record_dependencies"  [attr-defined]
+ sphinx/builders/__init__.py:670:37: error: Argument 2 to "write_doctree" of "Builder" has incompatible type "Any | None"; expected "document"  [arg-type]
+ sphinx/builders/latex/__init__.py: note: In member "write_documents" of class "LaTeXBuilder":
+ sphinx/builders/latex/__init__.py:308:32: error: Call to untyped function "get_default_values" in typed context  [no-untyped-call]
+ sphinx/builders/html/__init__.py: note: In member "render_partial" of class "StandaloneHTMLBuilder":
+ sphinx/builders/html/__init__.py:437:16: error: Incompatible return value type (got "_WriterParts", expected "dict[str, str]")  [return-value]
+ sphinx/builders/html/__init__.py: note: In member "prepare_writing" of class "StandaloneHTMLBuilder":
+ sphinx/builders/html/__init__.py:459:37: error: Call to untyped function "get_default_values" in typed context  [no-untyped-call]
+ sphinx/testing/restructuredtext.py: note: In function "parse":
+ sphinx/testing/restructuredtext.py:29:17: error: Argument 2 to "publish_doctree" has incompatible type "str"; expected "FileInput | StringInput | None"  [arg-type]
+ sphinx/builders/texinfo.py: note: In member "write_documents" of class "TexinfoBuilder":
+ sphinx/builders/texinfo.py:126:37: error: Call to untyped function "get_default_values" in typed context  [no-untyped-call]
+ sphinx/builders/manpage.py: note: In member "write_documents" of class "ManualPageBuilder":
+ sphinx/builders/manpage.py:61:32: error: Call to untyped function "get_default_values" in typed context  [no-untyped-call]
+ sphinx/ext/inheritance_diagram.py: note: In member "run" of class "InheritanceDiagram":
+ sphinx/ext/inheritance_diagram.py:432:21: error: Item "None" of "document | None" has no attribute "reporter"  [union-attr]

@donBarbos donBarbos marked this pull request as ready for review June 8, 2025 16:48
@donBarbos donBarbos changed the title [docutils]: Impove main stubs [docutils] Impove main stubs Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant