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 to mypy 1.12.1 #13022

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Upgrade to mypy 1.12.1 #13022

merged 1 commit into from
Oct 21, 2024

Conversation

hauntsaninja
Copy link
Contributor

No description provided.

Copy link
Member

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

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

Could you comment "pre-commit.ci autofix" @hauntsaninja? Thanks :)

src/pip/_internal/utils/misc.py Outdated Show resolved Hide resolved
src/pip/_internal/utils/misc.py Outdated Show resolved Hide resolved
@hauntsaninja
Copy link
Contributor Author

Thanks for the review! re Protocol: I thought we needed a different fix, but then noticed I could get away with something much simpler

@@ -80,7 +80,7 @@ def test_make_metadata_file_custom_value_overrides() -> None:

def test_make_metadata_file_custom_contents() -> None:
value = b"hello"
f = default_make_metadata(value=value)
f = default_make_metadata(value=value) # type: ignore[arg-type]
Copy link
Member

Choose a reason for hiding this comment

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

Do you know the reason of this one? Is that some regression in mypy?

Copy link
Contributor Author

@hauntsaninja hauntsaninja Oct 20, 2024

Choose a reason for hiding this comment

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

Prior to mypy 1.11, mypy did not understand functools.partial at all, so calls here were effectively going unchecked. mypy now struggles a little to solve the value constrained type var once it's been partially solved in the functools.partial call.

Looking at it a little closer, the type variable in make_wheel_metadata_file is actually unnecessary, so I'll remove it to make one of the two of these go away

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

LGTM. Could you remove the last 2 commits (1.12.1 + revert)?

@hauntsaninja hauntsaninja changed the title Upgrade to mypy 1.12 Upgrade to mypy 1.12.1 Oct 20, 2024
@hauntsaninja
Copy link
Contributor Author

Thanks for the review! I squashed the commits. I also landed 1.12.1 (I'd reverted because pre-commit didn't support it yet, but it does now)

@sbidoul sbidoul merged commit 6958e28 into pypa:main Oct 21, 2024
32 checks passed
@sbidoul
Copy link
Member

sbidoul commented Oct 21, 2024

Thank you @hauntsaninja !

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 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.

3 participants