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

Update mypy to 1.11 #4500

Merged
merged 2 commits into from
Jul 21, 2024
Merged

Update mypy to 1.11 #4500

merged 2 commits into from
Jul 21, 2024

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Jul 20, 2024

Summary of changes

  • Update mypy to 1.11
  • Slightly relax version lock to allow automatic point releases
  • Updated follow_imports = silent comment to be more generalized / future-proof
  • As per Emergent ruff error with 71.0 release #4473 (comment) , indicate myself as owner of the mypy pin, until the removal of types-setuptools from typeshed. Right now a CI failure is expected almost every version, especially as more annotations are added to setuptools, and fixes upstreamed to typeshed. Which would require a lock, then unlock PRs everytime (more churn than just locking and updating when ready), or non-obvious fixes (mainly due to distutils subtyping). Once types-setuptools is obsoleted, things should be more stable. @jaraco

Goes towards unblocking #4352
Closes #4432

Pull Request Checklist

  • Changes have tests (these are test updates)
  • News fragment added in newsfragments/. (no user facing changes)
    (See documentation for details)

@@ -29,7 +32,8 @@ class install(orig.install):
'old-and-unmanageable',
'single-version-externally-managed',
]
new_commands = [
# Type the same as distutils.command.install.install.sub_commands
new_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was causing invariance issues when trying to append install.new_commands to install.sub_commands at the end of this module

@@ -547,7 +553,7 @@ def __repr__(self):
@pytest.mark.parametrize(
'params',
WHEEL_INSTALL_TESTS,
ids=list(params['id'] for params in WHEEL_INSTALL_TESTS),
ids=[params['id'] for params in WHEEL_INSTALL_TESTS],
Copy link
Contributor Author

@Avasam Avasam Jul 20, 2024

Choose a reason for hiding this comment

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

Not a necessary change, but I noticed this improvement whilst I was looking at this line. After realizing the best fix was an annotation change, I left this line as a comprehension. Would've been caught by https://docs.astral.sh/ruff/rules/unnecessary-generator-list/

I can revert this line if you'd prefer no runtime change

Copy link
Member

Choose a reason for hiding this comment

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

I'm good with it. Thanks for highlighting!

pyproject.toml Outdated Show resolved Hide resolved
@@ -547,7 +553,7 @@ def __repr__(self):
@pytest.mark.parametrize(
'params',
WHEEL_INSTALL_TESTS,
ids=list(params['id'] for params in WHEEL_INSTALL_TESTS),
ids=[params['id'] for params in WHEEL_INSTALL_TESTS],
Copy link
Member

Choose a reason for hiding this comment

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

I'm good with it. Thanks for highlighting!

@jaraco jaraco merged commit 3fca249 into pypa:main Jul 21, 2024
20 of 21 checks passed
@Avasam Avasam deleted the Update-mypy-to-1.11 branch July 21, 2024 17:47
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