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

12032 mypy 1.8 #12080

Merged
merged 8 commits into from
Jan 12, 2024
Merged

12032 mypy 1.8 #12080

merged 8 commits into from
Jan 12, 2024

Conversation

glyph
Copy link
Member

@glyph glyph commented Jan 12, 2024

Scope and purpose

Fixes #12032

@glyph
Copy link
Member Author

glyph commented Jan 12, 2024

please review

@adiroiban
Copy link
Member

Thanks. Great job clening the "notes".

I was looking for a way to turn notes into errors.
In this way, we will make sure that the output will remain "clean"


I have pushed a commit that fixed the remaining issues.

mypy run-test: commands[0] | mypy --cache-dir=/home/runner/work/twisted/twisted/.tox/mypy_cache src
src/twisted/test/mock_win32process.py:12: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/python/shortcut.py:14: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/python/constants.py:12: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/logger/_levels.py:9: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/internet/test/process_helper.py:17: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/internet/test/process_helper.py:18: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/python/win32.py:128: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/python/lockfile.py:42: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/python/lockfile.py:43: error: Unused "type: ignore" comment  [unused-ignore]
src/twisted/internet/test/process_gireactornocompat.py:21: error: Unused "type: ignore" comment  [unused-ignore]
Found 10 errors in 8 files (checked 851 source files)

Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Many thanks.
Not sure about this change

it = it.addErrback(_handleCancelInlineCallbacks, status)

Other than that, it can be merged.

@@ -2116,14 +2116,13 @@ def _addCancelCallbackToDeferred(
@param status: a L{_CancellationStatus} tracking the current status of C{gen}
"""
it.callbacks, tmp = [], it.callbacks
it.addErrback(_handleCancelInlineCallbacks, status)
it = it.addErrback(_handleCancelInlineCallbacks, status)
Copy link
Member

Choose a reason for hiding this comment

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

not sure what is going on here.

Copy link
Member

Choose a reason for hiding this comment

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

It now makes sense. I have no idea why I have not observed it... Friday night, 11PM :(

src/twisted/spread/flavors.py Outdated Show resolved Hide resolved
src/twisted/spread/flavors.py Outdated Show resolved Hide resolved
@glyph
Copy link
Member Author

glyph commented Jan 12, 2024

Not sure about this change

it = it.addErrback(_handleCancelInlineCallbacks, status)

This is necessary to back-propagate the type information about what the expected return value is into the type checker for addErrback, whose overrides depend on the expected result. Given that it returns self this is the least invasive way to get that information in there.

glyph and others added 2 commits January 12, 2024 14:15
Co-authored-by: Adi Roiban <adiroiban@gmail.com>
Co-authored-by: Adi Roiban <adiroiban@gmail.com>
@glyph
Copy link
Member Author

glyph commented Jan 12, 2024

I have pushed a commit that fixed the remaining issues.

Thanks for that. This didn't show up on my local runs for some reason, which is interesting, but glad to clear those out of CI

@glyph glyph enabled auto-merge January 12, 2024 22:26
@glyph
Copy link
Member Author

glyph commented Jan 12, 2024

@adiroiban it still needs a confirming review :)

@glyph
Copy link
Member Author

glyph commented Jan 12, 2024

please review

Copy link
Member

@adiroiban adiroiban 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.
Make sense.

@glyph glyph merged commit 0010216 into trunk Jan 12, 2024
22 of 23 checks passed
@glyph glyph deleted the 12032-mypy-1.8 branch January 12, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgrade Mypy to 1.7
3 participants