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

upgrade Mypy to 1.7 #12032

Closed
glyph opened this issue Nov 6, 2023 · 6 comments · Fixed by #12055 or #12080
Closed

upgrade Mypy to 1.7 #12032

glyph opened this issue Nov 6, 2023 · 6 comments · Fixed by #12055 or #12080

Comments

@glyph
Copy link
Member

glyph commented Nov 6, 2023

Opening this for tracking here; we are blocked by Shoobx/mypy-zope#107

@glyph
Copy link
Member Author

glyph commented Dec 11, 2023

No longer blocked!

@glyph glyph changed the title upgrade Mypy to 1.6 upgrade Mypy to 1.7 Dec 11, 2023
@adiroiban
Copy link
Member

I tried to upgrade mypy at #12055 ... but the CI now fails as I guess more errors are detected with the latest mypy version.

Not sure what is the best way to do the upgrade

@glyph
Copy link
Member Author

glyph commented Dec 18, 2023

@adiroiban looks like the vast majority of those errors are telling us to use new, narrower categories of type:ignore qualifiers, so ideally we could find a blanket configuration option that would enable us to upgrade without fixing all those, then do a few PRs to fix them in chunks, then remove that?

@adiroiban
Copy link
Member

Thanks. Looks like just simple hard work.
In theory we can manually update all the ignores to what is suggested in the error.

@adiroiban
Copy link
Member

While working on this, maybe we can also fix all the "note" mypy messages

It's not easy to see the error in the mypy output...and since the mypy output is mixed with other tox tasks (lint and newsfragment), it's even harder to see the mypy error.

src/twisted/python/modules.py:264:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/python/modules.py:320:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/internet/_sslverify.py:16: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/internet/tcp.py:805:13: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/internet/iocpreactor/tcp.py:362:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/protocols/amp.py:1715:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/protocols/amp.py:1716:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/web/http.py:868:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/web/http.py:877:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/web/http.py:879:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/trial/test/test_reporter.py:142:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/trial/test/test_reporter.py:270:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/trial/_dist/test/test_disttrial.py:702:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/trial/_dist/test/test_disttrial.py:703:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/trial/_dist/test/test_disttrial.py:715:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/twisted/trial/_dist/test/test_disttrial.py:720:9: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Found 1 error in 1 file (checked 851 source files)

@glyph
Copy link
Member Author

glyph commented Jan 12, 2024

@adiroiban My recent fix to trunk should have cleared up most of these.

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 a pull request may close this issue.

2 participants