Skip to content

Commit 882992e

Browse files
authored
Update and pin mypy to 1.9 (pypa#4268)
2 parents 965636e + 0575cc5 commit 882992e

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

mypy.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[mypy]
22
# CI should test for all versions, local development gets hints for oldest supported
3+
# Some upstream typeshed distutils stubs fixes are necessary before we can start testing on Python 3.12
34
python_version = 3.8
45
strict = False
56
warn_unused_ignores = True
@@ -8,6 +9,7 @@ explicit_package_bases = True
89
exclude = (?x)(
910
^build/
1011
| ^.tox/
12+
| ^.egg/
1113
| ^pkg_resources/tests/data/my-test-package-source/setup.py$ # Duplicate module name
1214
| ^.+?/(_vendor|extern)/ # Vendored
1315
| ^setuptools/_distutils/ # Vendored

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ testing =
7373
# for tools/finalize.py
7474
jaraco.develop >= 7.21; python_version >= "3.9" and sys_platform != "cygwin"
7575
pytest-home >= 0.5
76+
mypy==1.9 # pin mypy version so a new version doesn't suddenly cause the CI to fail
7677
# No Python 3.11 dependencies require tomli, but needed for type-checking since we import it directly
7778
tomli
7879
# No Python 3.12 dependencies require importlib_metadata, but needed for type-checking since we import it directly

setuptools/_core_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _read_list_from_msg(msg: Message, field: str) -> Optional[List[str]]:
6262

6363

6464
def _read_payload_from_msg(msg: Message) -> Optional[str]:
65-
value = msg.get_payload().strip()
65+
value = str(msg.get_payload()).strip()
6666
if value == 'UNKNOWN' or not value:
6767
return None
6868
return value

setuptools/command/editable_wheel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,7 @@ def _simple_layout(
620620
layout = {pkg: find_package_path(pkg, package_dir, project_dir) for pkg in packages}
621621
if not layout:
622622
return set(package_dir) in ({}, {""})
623-
# TODO: has been fixed upstream, waiting for new mypy release https://github.com/python/typeshed/pull/11310
624-
parent = os.path.commonpath(starmap(_parent_path, layout.items())) # type: ignore[call-overload]
623+
parent = os.path.commonpath(starmap(_parent_path, layout.items()))
625624
return all(
626625
_path.same_path(Path(parent, *key.split('.')), value)
627626
for key, value in layout.items()

0 commit comments

Comments
 (0)