diff --git a/mypy.ini b/mypy.ini index 3a26daf1c9..de545a103c 100644 --- a/mypy.ini +++ b/mypy.ini @@ -21,6 +21,11 @@ exclude = (?x)( # *.extern modules that actually live in *._vendor will also cause attr-defined issues on import disable_error_code = attr-defined +# - pkg_resources tests create modules that won't exists statically before the test is run. +# Let's ignore all "import-not-found" since, if an import really wasn't found, then the test would fail. +[mypy-pkg_resources.tests.*] +disable_error_code = import-not-found + # - Avoid raising issues when importing from "extern" modules, as those are added to path dynamically. # https://github.com/pypa/setuptools/pull/3979#discussion_r1367968993 # - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found] @@ -29,9 +34,7 @@ disable_error_code = attr-defined [mypy-pkg_resources.extern.*,setuptools.extern.*,distutils._modified,jaraco.*,trove_classifiers] ignore_missing_imports = True -# - pkg_resources tests create modules that won't exists statically before the test is run. -# Let's ignore all "import-not-found" since, if an import really wasn't found, then the test would fail. # Even when excluding vendored/generated modules, there might be problems: https://github.com/python/mypy/issues/11936#issuecomment-1466764006 -[mypy-pkg_resources.tests.*,setuptools._vendor.packaging._manylinux,setuptools.config._validate_pyproject.*] +[mypy-setuptools._vendor.packaging._manylinux,setuptools.config._validate_pyproject.*] follow_imports = silent # silent => ignore errors when following imports