-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update mypy to 1.11 #4500
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
"""wheel tests""" | ||
|
||
from __future__ import annotations | ||
|
||
from distutils.sysconfig import get_config_var | ||
from distutils.util import get_platform | ||
import contextlib | ||
|
@@ -11,6 +13,7 @@ | |
import shutil | ||
import subprocess | ||
import sys | ||
from typing import Any | ||
import zipfile | ||
|
||
import pytest | ||
|
@@ -176,7 +179,10 @@ def __repr__(self): | |
return '%s(**%r)' % (self._id, self._fields) | ||
|
||
|
||
WHEEL_INSTALL_TESTS = ( | ||
# Using Any to avoid possible type union issues later in test | ||
# making a TypedDict is not worth in a test and anonymous/inline TypedDict are experimental | ||
# https://github.com/python/mypy/issues/9884 | ||
WHEEL_INSTALL_TESTS: tuple[dict[str, Any], ...] = ( | ||
dict( | ||
id='basic', | ||
file_defs={'foo': {'__init__.py': ''}}, | ||
|
@@ -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], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm good with it. Thanks for highlighting! |
||
) | ||
def test_wheel_install(params): | ||
project_name = params.get('name', 'foo') | ||
|
There was a problem hiding this comment.
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
toinstall.sub_commands
at the end of this module