]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Update mypy to 2.1.0 (GH-149709) (#149713)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 12 May 2026 09:06:58 +0000 (11:06 +0200)
committerGitHub <noreply@github.com>
Tue, 12 May 2026 09:06:58 +0000 (09:06 +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 8fc852f86b455c437a86b2670873d221dc6b21a8..75fe0d7ad3b4e893deffb989bf54cb59a0dad0ab 100644 (file)
@@ -118,7 +118,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 13d47b9a2e20138038109ab72cf5293f4b184053..ed0950166f126f3da63a1f5b6e567b0f4fb7d5ca 100644 (file)
@@ -20,8 +20,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