From b17d5d981daf2ba384069744b6e16faf23aefb15 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Tue, 14 Jul 2026 15:41:12 -0500 Subject: [PATCH] ci(pre-commit): pin numpy<2.2 for mypy stub compatibility numpy>=2.2 ships type stubs using PEP 695 `type` statements, which mypy rejects while type-checking against python_version=3.10 (the project floor): `numpy/__init__.pyi: error: Type statement is only supported in Python 3.12+`. Pin the mypy hook's stub dependency to numpy<2.2 so the hook passes; runtime numpy is unaffected. --- .pre-commit-config.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec6b11d3e..dddc97edd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,4 +45,6 @@ repos: - types-PyMySQL - types-tqdm - pandas-stubs - - numpy + # numpy>=2.2 stubs use PEP 695 `type` statements, which mypy rejects + # when type-checking against python_version 3.10 (the project floor). + - numpy<2.2