]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Update mypy to 2.1.0 (GH-149709) (#149712)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 12 May 2026 09:09:12 +0000 (11:09 +0200)
committerGitHub <noreply@github.com>
Tue, 12 May 2026 09:09:12 +0000 (09:09 +0000)
Update mypy to 2.1.0 (GH-149709)
(cherry picked from commit b546cc10f5c659344ce3cf49db6d9c92307ed1fc)

Co-authored-by: sobolevn <mail@sobolevn.me>
Lib/test/libregrtest/single.py
Lib/tomllib/mypy.ini
Tools/build/check_extension_modules.py
Tools/build/mypy.ini
Tools/requirements-dev.txt

index 958a915626ad2414ff5b070daf3123f39a0b5330..d0759d2626989d6a4f0cde4c442187e5a7f97915 100644 (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:
index 1761dce45562a602c6a9a6254a56136354e20f88..f7eeffd575c1c764fc7f2d178bda5d83d0273e36 100644 (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
index 668db8df0bd1812b92fb41a6de01dc86642a5dc8..d6b0db0684cdaee4ac80dc464000771c93f132b9 100644 (file)
@@ -416,7 +416,7 @@ class ModuleChecker:
     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)
index cff2ab216707041e19afbbf66efc43d2a9f168d7..d1f193e25601c5b9739f8439e41e7cbd3245a3a5 100644 (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
index af5cbaa7689f33d7aaed423466ca6c7f4ec9b2af..46381ea58a123824f95bcef1afe44df95de944b1 100644 (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