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

use 'types-docutils' instead of 'docutils-stubs' for docutils type annotations #12012

Merged
merged 14 commits into from
Mar 23, 2024

Conversation

danieleades
Copy link
Contributor

closes #12007

I expect this to be a long-running PR which will help identify gaps in the typeshed docutils libraries.

Once all the issues are squashed upstream this can be merged.

@danieleades danieleades mentioned this pull request Feb 26, 2024
22 tasks
@danieleades

This comment was marked as outdated.

@danieleades

This comment was marked as resolved.

@danieleades
Copy link
Contributor Author

danieleades commented Feb 26, 2024

currently 121 errors: Found 121 errors in 38 files (checked 183 source files)

i'll see what that changes to after python/typeshed#11468 is merged

EDIT now down to 110 errors: Found 110 errors in 33 files (checked 183 source files)
EDIT now down to 97 errors: Found 97 errors in 32 files (checked 183 source files)
Found 85 errors in 29 files (checked 183 source files)
Found 82 errors in 28 files (checked 183 source files)
Found 70 errors in 28 files (checked 183 source files)
Found 59 errors in 26 files (checked 183 source files)

@danieleades
Copy link
Contributor Author

#12034 should help to reduce the type errors in this PR

@picnixz
Copy link
Member

picnixz commented Mar 2, 2024

Definitely yes since many of the errors were due to that.

@danieleades danieleades force-pushed the typeshed-docutils branch 3 times, most recently from 7562b10 to 0141907 Compare March 8, 2024 06:29
@danieleades danieleades force-pushed the typeshed-docutils branch 7 times, most recently from 9d70b62 to 974e185 Compare March 10, 2024 09:48
@danieleades
Copy link
Contributor Author

Found 56 errors in 26 files (checked 183 source files)

getting harder to make progress on this, as a lot of the remaining errors are genuine type safety bugs in sphinx, rather than just gaps in the upstream type stubs.

For example there are many places where Sphinx uses T | None as T and fails to handle the None case. Mypy doesn't like that.

Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

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

Cheers for all the work @danieleades!
generally all good, just see the one comment for a quick suggestion

sphinx/directives/__init__.py Show resolved Hide resolved
sphinx/builders/html/__init__.py Show resolved Hide resolved
sphinx/directives/__init__.py Show resolved Hide resolved
sphinx/util/rst.py Show resolved Hide resolved
sphinx/writers/texinfo.py Show resolved Hide resolved
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

Haven't looked at everything but I think it should be fine. We'll do PRs to fix each type ignore I think.

sphinx/util/nodes.py Show resolved Hide resolved
@danieleades
Copy link
Contributor Author

any major blockers to getting this merged?

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I don't think I have something else in mind.

@picnixz
Copy link
Member

picnixz commented Mar 23, 2024

I'm going to wait until this evening (around 18:00 UTC+1) before merging it to let @chrisjsewell review it again if needed. Otherwise, I'll merge it. Please ping me @danieleades if I forget about it.

Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

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

all good cheers!

@picnixz picnixz merged commit 22cee42 into sphinx-doc:master Mar 23, 2024
22 checks passed
@picnixz
Copy link
Member

picnixz commented Mar 23, 2024

Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
@AA-Turner AA-Turner added this to the 7.3.0 milestone Jul 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify docutils type annotations
5 participants