-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Miscellaneous type-checking updates #2614
Conversation
`pkg_resources` itself is typed in setuptools>=71.1, negating the need to install type stubs.
mypy has to be told this explicitly, which means a new "runtime" dependency/import that only has to do with type-checking... because decorator evaluation can't be deferred like annotations can. Sigh.
I'm very glad this is deprecated. The only reason I'm bothering to fix this is because we can't remove it from the 8.0.x maintenance branch.
Manually re-running CI jobs got them to pass, but I do not like the random failure in 3.9's
Based on the output, Line 17 in 1237568
How could |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah all good, I'm glad we have the mypy check in the CI.
And also this:
removed_in='8.1'
Can't wait for that!
Description
types-pkg-resources
was yanked, which I discovered when submitting #2613.pkg_resources
itself is typed in setuptools>=71.1, negating the need to install type stubs.When testing that fix, I updated
mypy
and friends (pip install -U -r dev-requirements.txt
) and found a few more new type-check errors caught by the newer tools:SopelIdentifierMemory.update()
's signature isn't compatible with its supertype (fixed by addingtyping_extensions.override
decorator; can't go stdlib-only until py3.12…)tools.OutputRedirect
calls methods onsys.__stdout__
andsys.__stderr__
, which are allowed to beNone
and therefore have to be guarded withif
s (I'm glad this class is deprecated)Checklist
make qa
(runsmake lint
andmake test
)Notes
All of this needs backporting to the
8.0.x
maintenance branch, which is why this has the 8.0.1 milestone.