From afc478c913d0ec98c54e9cf9ab77e079d4f36cee Mon Sep 17 00:00:00 2001 From: B-Deprez Date: Fri, 18 Sep 2026 14:19:45 +0200 Subject: [PATCH] Pin mypy python_version to 3.12 so numpy's stubs parse --- pyproject.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cdf8a0e..5b27d52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,17 @@ max-complexity = 10 # --- Types ------------------------------------------------------------------ [tool.mypy] -python_version = "3.10" +# Deliberately NOT the minimum supported version. python_version is the syntax +# level mypy parses *everything* with, dependency stubs included, and numpy's +# stubs use PEP 695 `type` statements that only parse as 3.12+ -- with 3.10 here +# mypy fails inside numpy before it reaches our code. Pinning it rather than +# letting it follow the interpreter keeps mypy working on a 3.10 or 3.11 machine +# too. +# +# The 3.10 floor is still enforced, just not here: ruff takes its target version +# from requires-python and rejects newer syntax outright, and the test matrix +# runs on 3.10. +python_version = "3.12" files = ["src/garg_aml"] disallow_untyped_defs = true warn_redundant_casts = true