]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update mypy to 2.1.0 (#149709)
authorsobolevn <mail@sobolevn.me>
Tue, 12 May 2026 08:40:51 +0000 (11:40 +0300)
committerGitHub <noreply@github.com>
Tue, 12 May 2026 08:40:51 +0000 (08:40 +0000)
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 f23c1d5286f92af0bb573d9034defc24b6b578ec..c619a9a0c1c5a1b7695f5749ae622883636cec57 100644 (file)
@@ -463,7 +463,7 @@ _MISSING_STDLIB_MODULE_MESSAGES = {pprint.pformat(messages)}
     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 5465e2d4b6171f181edc0a29539a4df9d75617c6..485c9314cf70015e15d8d445ecf683002aad4721 100644 (file)
@@ -24,8 +24,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