Skip to content
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

improve type annotations in 'docutils.node.document' #11468

Merged
merged 16 commits into from
Feb 26, 2024

Conversation

danieleades
Copy link
Contributor

@danieleades danieleades commented Feb 25, 2024

this is based on the type annotations in https://github.com/tk0miya/docutils-stubs, with a few tweaks

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.nodes.document branch from a3efd15 to da6f310 Compare February 25, 2024 19:11
@danieleades danieleades marked this pull request as ready for review February 25, 2024 19:17
@danieleades

This comment was marked as resolved.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.nodes.document branch 3 times, most recently from cfd917b to d1575df Compare February 26, 2024 08:54

This comment has been minimized.

1 similar comment

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.nodes.document branch from 9ff4538 to 567bff5 Compare February 26, 2024 10:53
@danieleades danieleades requested a review from srittau February 26, 2024 10:54

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a big improvement as the primer output shows. A few notes, though.

stubs/docutils/docutils/nodes.pyi Outdated Show resolved Hide resolved
stubs/docutils/docutils/nodes.pyi Outdated Show resolved Hide resolved
stubs/docutils/docutils/nodes.pyi Outdated Show resolved Hide resolved
stubs/docutils/docutils/nodes.pyi Outdated Show resolved Hide resolved
stubs/docutils/docutils/nodes.pyi Outdated Show resolved Hide resolved
stubs/docutils/docutils/nodes.pyi Outdated Show resolved Hide resolved
@danieleades danieleades force-pushed the docutils.nodes.document branch from 01244ed to 8c031c4 Compare February 26, 2024 11:16
Copy link
Contributor

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

sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/addnodes.py: note: In member "set_id" of class "document":
- sphinx/addnodes.py:47:16: error: "set_id" undefined in superclass  [misc]
- sphinx/addnodes.py:47:16: note: Error code "misc" not covered by "type: ignore" comment
- sphinx/environment/__init__.py: note: In member "get_and_resolve_doctree" of class "BuildEnvironment":
- sphinx/environment/__init__.py:630:17: error: "document" has no attribute "reporter"  [attr-defined]
- sphinx/domains/std/__init__.py:713: error: Unused "type: ignore" comment  [unused-ignore]
- sphinx/builders/__init__.py:515: error: Unused "type: ignore" comment  [unused-ignore]
- sphinx/builders/__init__.py: note: In member "write_doctree" of class "Builder":
- sphinx/builders/__init__.py:515:9: error: "document" has no attribute "reporter"  [attr-defined]
- sphinx/builders/__init__.py:515:9: note: Error code "attr-defined" not covered by "type: ignore" comment
- sphinx/builders/__init__.py:520:9: error: "document" has no attribute "settings"  [attr-defined]
- sphinx/builders/__init__.py: note: At top level:
- sphinx/builders/html/__init__.py: note: In member "write_doc" of class "StandaloneHTMLBuilder":
- sphinx/builders/html/__init__.py:650:9: error: "document" has no attribute "settings"  [attr-defined]
- sphinx/builders/html/__init__.py: note: At top level:
- sphinx/builders/latex/__init__.py: note: In member "write" of class "LaTeXBuilder":
- sphinx/builders/latex/__init__.py:320:17: error: "document" has no attribute "settings"  [attr-defined]
- sphinx/ext/autosummary/__init__.py: note: In function "extract_summary":
- sphinx/ext/autosummary/__init__.py:523:9: error: "document" has no attribute "reporter"  [attr-defined]
- sphinx/builders/texinfo.py: note: In member "write" of class "TexinfoBuilder":
- sphinx/builders/texinfo.py:130:17: error: "document" has no attribute "settings"  [attr-defined]
- sphinx/builders/manpage.py: note: In member "write" of class "ManualPageBuilder":
- sphinx/builders/manpage.py:97:13: error: "document" has no attribute "settings"  [attr-defined]

@srittau srittau merged commit d3d5f81 into python:main Feb 26, 2024
45 checks passed
@danieleades danieleades deleted the docutils.nodes.document branch February 27, 2024 14:37
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.

2 participants