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

Bump mypy to 0.981 #8796

Merged
merged 15 commits into from Sep 27, 2022
Merged

Bump mypy to 0.981 #8796

merged 15 commits into from Sep 27, 2022

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Sep 26, 2022

Once I've got stdlib stubtest passing, I'll hit this PR with third-party stubtest as well, since there have been a fair few stubtest changes in this release.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood marked this pull request as ready for review September 26, 2022 23:00
@@ -1952,7 +1952,7 @@ if sys.version_info >= (3, 11):
@overload
def subgroup(self: Self, __condition: Callable[[_BaseExceptionT_co], bool]) -> Self | None: ...
@overload
def split(
def split( # type: ignore[misc] # complaints about overlapping overloads
Copy link
Member Author

Choose a reason for hiding this comment

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

I believe these new mypy errors are already fixed on mypy master, by python/mypy#13461. Unfortunately, it doesn't look like that PR made it into 0.981 (cc. @hauntsaninja, @ilevkivskyi)

Copy link
Member

Choose a reason for hiding this comment

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

cc @jhance if people will complain about this, we will need to CP it and release 0.982.

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlexWaygood mypy 0.982 was released with the fix for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Molkree thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Mypy was successfully bumped to 0.982 in #8831; the type ignores are gone again 🎉

Thanks @ilevkivskyi for the work on the patch release!

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
Copy link
Member Author

This PR should now be ready for review!

Comment on lines +44 to +46
if sys.version_info >= (3, 11):
def __init__(self, name: str, value: str, group: str) -> None: ...

Copy link
Member Author

Choose a reason for hiding this comment

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

The allowlist entry had a comment saying that it was to do with Protocol.__init__, so I thought I could safely remove the allowlist entry now that we were bumping to mypy 0.981. Actually the comment was wrong, the allowlist entry had nothing to do with Protocol.__init__. But I figured fixing the allowlist entry was just as easy as correcting the comment next to the entry.

@@ -72,7 +72,7 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream):
def detectEncodingMeta(self): ...

class EncodingBytes(bytes):
def __new__(cls, value): ...
def __new__(self, value): ...
Copy link
Member Author

Choose a reason for hiding this comment

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

This change isn't strictly related to the mypy bump, but it was a very easy allowlist entry to fix, and it means that we can delete the whole allowlist for html5lib since the other allowlist entry is now unused as of mypy 0.981.

@AlexWaygood AlexWaygood mentioned this pull request Oct 3, 2022
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.

None yet

4 participants