From 67917ae3f61acb3d2ba3c5e46ba78022155f690d Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Wed, 2 Dec 2026 21:41:00 +0100 Subject: [PATCH] Type check against the oldest Python version Without a configured version, `mypy` and `pyright` check against the Python that runs them. With `MAIN_PYTHON` at 3.14, they would accept `stdlib` APIs and `typing` features new in 3.14. Yet, `requires-python` promises 3.13; so, the type checkers must flag such code. `black` and `ruff` already target 3.13 for the same reason. --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index dc245dd..48a7273 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -439,6 +439,9 @@ force_single_line = true cache_dir = ".cache/mypy" +# Check against the oldest supported Python version, not the one running `mypy` +python_version = "3.13" + # Check the interior of functions without type annotations check_untyped_defs = true @@ -528,6 +531,9 @@ ignore_missing_imports = true [tool.pyright] # Source: https://microsoft.github.io/pyright/#/configuration +# Check against the oldest supported Python version, not the one running `pyright` +pythonVersion = "3.13" + # Treat libraries without type annotations as `Any`, like `mypy` does useLibraryCodeForTypes = false