b93ed8ba创建于 2025年1月9日历史提交
[mypy]
# 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.8
strict = False
warn_unused_ignores = True
warn_redundant_casts = True
# required to support namespace packages: https://github.com/python/mypy/issues/14057
explicit_package_bases = True

disable_error_code =
	# Disable due to many false positives
	overload-overlap,

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$
	)

# DistributionMetadata.license_files and DistributionMetadata.license_file
# are dynamically patched in setuptools/_core_metadata.py
# and no DistributionMetadata subclass exists in setuptools
[mypy-setuptools.*]
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

# - 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
# - The following are not marked as py.typed:
#  - 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.test: https://github.com/jaraco/jaraco.test/issues/7
#  - jaraco.text: https://github.com/jaraco/jaraco.text/issues/17
#  - wheel: does not intend on exposing a programmatic API https://github.com/pypa/wheel/pull/610#issuecomment-2081687671
[mypy-distutils.*,jaraco.develop,jaraco.envs,jaraco.packaging.*,jaraco.path,jaraco.test.*,jaraco.text,wheel.*]
ignore_missing_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._distutils.*]
follow_imports = silent
# silent => ignore errors when following imports