diff --git a/mypy.ini b/mypy.ini index 57e19efa9e..c1d01a42c3 100644 --- a/mypy.ini +++ b/mypy.ini @@ -58,7 +58,7 @@ ignore_missing_imports = True # - wheel: does not intend on exposing a programmatic API https://github.com/pypa/wheel/pull/610#issuecomment-2081687671 [mypy-wheel.*] -ignore_missing_imports = True +follow_untyped_imports = True # - The following are not marked as py.typed: # - jaraco: Since mypy 1.12, the root name of the untyped namespace package gets called-out too # - jaraco.develop: https://github.com/jaraco/jaraco.develop/issues/22 @@ -66,8 +66,8 @@ ignore_missing_imports = True # - jaraco.packaging: https://github.com/jaraco/jaraco.packaging/issues/20 # - jaraco.path: https://github.com/jaraco/jaraco.path/issues/2 # - jaraco.text: https://github.com/jaraco/jaraco.text/issues/17 -[mypy-jaraco,jaraco.develop,jaraco.envs,jaraco.packaging.*,jaraco.path,jaraco.text] -ignore_missing_imports = True +[mypy-jaraco,jaraco.develop.*,jaraco.envs,jaraco.packaging.*,jaraco.path,jaraco.text] +follow_untyped_imports = True # Even when excluding a module, import issues can show up due to following import # https://github.com/python/mypy/issues/11936#issuecomment-1466764006 diff --git a/pyproject.toml b/pyproject.toml index a19d4ac164..48df917af8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ test = [ "packaging>=24.2", "jaraco.envs>=2.2", "pytest-xdist>=3", # Dropped dependency on pytest-fork and py - "jaraco.path>=3.2.0", + "jaraco.path>=3.7.2", # Typing fixes "build[virtualenv]>=1.0.3", "filelock>=3.4.0", "ini2toml[lite]>=0.14", @@ -135,7 +135,7 @@ type = [ # pin mypy version so a new version doesn't suddenly cause the CI to fail, # until types-setuptools is removed from typeshed. # For help with static-typing issues, or mypy update, ping @Avasam - "mypy>=1.12,<1.14", + "mypy==1.14.*", # Typing fixes in version newer than we require at runtime "importlib_metadata>=7.0.2; python_version < '3.10'", # Imported unconditionally in tools/finalize.py diff --git a/setuptools/tests/test_build_ext.py b/setuptools/tests/test_build_ext.py index 88318b26c5..d107a272e1 100644 --- a/setuptools/tests/test_build_ext.py +++ b/setuptools/tests/test_build_ext.py @@ -179,11 +179,11 @@ def C(file): class TestBuildExtInplace: def get_build_ext_cmd(self, optional: bool, **opts) -> build_ext: - files = { + files: dict[str, str | dict[str, dict[str, str]]] = { "eggs.c": "#include missingheader.h\n", ".build": {"lib": {}, "tmp": {}}, } - path.build(files) # jaraco/path#232 + path.build(files) extension = Extension('spam.eggs', ['eggs.c'], optional=optional) dist = Distribution(dict(ext_modules=[extension])) dist.script_name = 'setup.py' diff --git a/setuptools/tests/test_core_metadata.py b/setuptools/tests/test_core_metadata.py index cf0bb32e9f..b67373bc37 100644 --- a/setuptools/tests/test_core_metadata.py +++ b/setuptools/tests/test_core_metadata.py @@ -5,7 +5,7 @@ import io from email import message_from_string from email.generator import Generator -from email.message import Message +from email.message import EmailMessage, Message from email.parser import Parser from email.policy import EmailPolicy from pathlib import Path @@ -416,7 +416,7 @@ def _assert_roundtrip_message(metadata: str) -> None: then ensures the metadata generated by setuptools is compatible. """ with io.StringIO(metadata) as buffer: - msg = Parser().parse(buffer) + msg = Parser(EmailMessage).parse(buffer) serialization_policy = EmailPolicy( utf8=True,