-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathmypy.ini
35 lines (33 loc) · 1.88 KB
/
mypy.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[mypy]
# CI should test for all versions, local development gets hints for oldest supported
# Some upstream typeshed distutils stubs fixes are necessary before we can start testing on Python 3.12
python_version = 3.8
strict = False
warn_unused_ignores = True
# required to support namespace packages: https://github.com/python/mypy/issues/14057
explicit_package_bases = True
exclude = (?x)(
^build/
| ^.tox/
| ^.egg/
| ^pkg_resources/tests/data/my-test-package-source/setup.py$ # Duplicate module name
| ^.+?/(_vendor|extern)/ # Vendored
| ^setuptools/_distutils/ # Vendored
| ^setuptools/config/_validate_pyproject/ # Auto-generated
)
# Ignoring attr-defined because setuptools wraps a lot of distutils classes, adding new attributes,
# w/o updating all the attributes and return types from the base classes for type-checkers to understand
# Especially with setuptools.dist.command vs distutils.dist.command vs setuptools._distutils.dist.command
# *.extern modules that actually live in *._vendor will also cause attr-defined issues on import
disable_error_code = attr-defined
# - 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]
# - All jaraco modules are still untyped
[mypy-pkg_resources.extern.*,setuptools.extern.*,distutils._modified,jaraco.*]
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.
# - setuptools._vendor.packaging._manylinux: Mypy issue, this vendored module is already excluded!
[mypy-pkg_resources.tests.*,setuptools._vendor.packaging._manylinux]
disable_error_code = import-not-found