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

Fix mypy failure after multiple merges #4726

Merged

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Nov 1, 2024

Summary of changes

@abravalheri for #4709 (comment)

As I thought, one PR made Distribution.get_command_class no longer return Any for mypy, the other made install.do_egg_install type-checked. Individually they both passed the CI.

Pull Request Checklist

@Avasam Avasam force-pushed the fix-mypy-failure-after-multiple-merges branch 3 times, most recently from 25bd25a to 2419ec5 Compare November 1, 2024 16:48
Comment on lines 140 to 153
easy_install = self.distribution.get_command_class('easy_install')

cmd = easy_install(
self.distribution,
args="x",
root=self.root,
record=self.record,
cmd = cast(
# We'd want to cast easy_install as type[easy_install_cls] but a bug in
# mypy makes it think easy_install() returns a Command on Python 3.12+
# https://github.com/python/mypy/issues/18088
easy_install_cls,
easy_install( # type: ignore[call-arg]
self.distribution,
args="x",
root=self.root,
record=self.record,
),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abravalheri
Copy link
Contributor

Uh, though one. Thank you very much @Avasam.

@abravalheri abravalheri merged commit f410da1 into pypa:main Nov 1, 2024
24 checks passed
@Avasam Avasam deleted the fix-mypy-failure-after-multiple-merges branch November 1, 2024 18:13
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.

2 participants