| [mypy] | |
| ## upstream | |
| # Is the project well-typed? | |
| strict = False | |
| # Early opt-in even when strict = False | |
| # warn_unused_ignores = True # Disabled until we have distutils stubs for Python 3.12+ | |
| warn_redundant_casts = True | |
| enable_error_code = ignore-without-code | |
| # Support namespace packages per https://github.com/python/mypy/issues/14057 | |
| explicit_package_bases = True | |
| disable_error_code = | |
| # Disable due to many false positives | |
| overload-overlap, | |
| ## local | |
| # CI should test for all versions, local development gets hints for oldest supported | |
| # But our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually. | |
| # python_version = 3.9 | |
| exclude = (?x)( | |
| # Avoid scanning Python files in generated folders | |
| ^build/ | |
| | ^.tox/ | |
| | ^.eggs/ | |
| | ^setuptools/config/_validate_pyproject/ | |
| # These are vendored | |
| | ^setuptools/_vendor/ | |
| | ^setuptools/_distutils/ | |
| # Duplicate module name | |
| | ^pkg_resources/tests/data/my-test-package-source/setup.py$ | |
| ) | |
| [mypy-setuptools.*] | |
| disable_error_code = | |
| # DistributionMetadata.license_files and DistributionMetadata.license_file | |
| # are dynamically patched in setuptools/_core_metadata.py | |
| # and no DistributionMetadata subclass exists in setuptools | |
| attr-defined, | |
| # See issue described below about distutils across Python versions | |
| has-type, | |
| # - 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 | |
| # - distutils doesn't exist on Python 3.12, unfortunately, this means typing | |
| # will be missing for subclasses of distutils on Python 3.12 until either: | |
| # - support for `SETUPTOOLS_USE_DISTUTILS=stdlib` is dropped (#3625) | |
| # for setuptools to import `_distutils` directly | |
| # - or non-stdlib distutils typings are exposed | |
| [mypy-distutils.*] | |
| ignore_missing_imports = True | |
| # - wheel: does not intend on exposing a programmatic API https://github.com/pypa/wheel/pull/610#issuecomment-2081687671 | |
| [mypy-wheel.*] | |
| 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 | |
| # - jaraco.envs: https://github.com/jaraco/jaraco.envs/issues/7 | |
| # - 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] | |
| 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 | |
| [mypy-setuptools.config._validate_pyproject.*,setuptools._vendor.*,setuptools._distutils.*] | |
| follow_imports = silent | |
| # silent => ignore errors when following imports |