[3.14] Update mypy to 2.1.0 (GH-149709) (#149712)

Update mypy to 2.1.0 (GH-149709)
(cherry picked from commit b546cc10f5)

Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2026-05-12 11:09:12 +02:00 committed by GitHub
parent 49bf2d1cbd
commit 73675ec3de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 9 deletions

View file

@ -145,7 +145,7 @@ def regrtest_runner(result: TestResult, test_func, runtests: RunTests) -> None:
# Storage of uncollectable GC objects (gc.garbage)
GC_GARBAGE = []
GC_GARBAGE: list[object] = []
def _load_run_test(result: TestResult, runtests: RunTests) -> None:

View file

@ -12,6 +12,4 @@ pretty = True
# Enable most stricter settings
enable_error_code = ignore-without-code
strict = True
strict_bytes = True
local_partial_types = True
warn_unreachable = True

View file

@ -416,7 +416,7 @@ def get_location(self, modinfo: ModuleInfo) -> pathlib.Path | None:
def _check_file(self, modinfo: ModuleInfo, spec: ModuleSpec) -> None:
"""Check that the module file is present and not empty"""
if spec.loader is BuiltinImporter: # type: ignore[comparison-overlap]
return
return # type: ignore[unreachable]
try:
assert spec.origin is not None
st = os.stat(spec.origin)

View file

@ -23,8 +23,6 @@ python_version = 3.10
# ...And be strict:
strict = True
strict_bytes = True
local_partial_types = True
extra_checks = True
enable_error_code = ignore-without-code,redundant-expr,truthy-bool,possibly-undefined
warn_unreachable = True

View file

@ -1,7 +1,7 @@
# Requirements file for external linters and checks we run on
# Tools/clinic, Tools/cases_generator/, and Tools/peg_generator/ in CI
mypy==1.19.1
mypy==2.1.0
# needed for peg_generator:
types-psutil==7.2.2.20260130
types-setuptools==82.0.0.20260210
types-psutil==7.2.2.20260508
types-setuptools==82.0.0.20260508