Skip to content

Commit

Permalink
Fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed May 9, 2024
1 parent ed7a12c commit 5c9d37a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mypy.ini
Expand Up @@ -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]
Expand All @@ -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

0 comments on commit 5c9d37a

Please sign in to comment.