From 0601f15bd00ba3d111ca2bdcb68e6a7768bc8244 Mon Sep 17 00:00:00 2001 From: jorenham Date: Thu, 3 Jul 2025 13:34:35 +0200 Subject: [PATCH 1/3] Add `scipy-stubs` as dev dependency https://github.com/scipy/scipy-stubs --- .pre-commit-config.yaml | 1 + pyproject.toml | 1 + requirements-dev.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f12831164..a611a7798 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,6 +26,7 @@ repos: - id: mypy exclude: build_helpers additional_dependencies: + - scipy-stubs==1.15.3.0 - types-cachetools==6.0.0.20250525 - types-filelock==3.2.7 - types-requests==2.32.4.20250611 diff --git a/pyproject.toml b/pyproject.toml index eb626ac81..df6048cb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,6 +111,7 @@ develop = [ "pytest-xdist", "pytest", "ruff", + "scipy-stubs", "time-machine", "types-cachetools", "types-filelock", diff --git a/requirements-dev.txt b/requirements-dev.txt index c597f9b8a..90d1ba2fa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -24,6 +24,7 @@ time-machine==2.16.0 nbconvert==7.16.6 # mypy types +scipy-stubs==1.15.3.0 # keep in sync with `scipy` in `requirements-hyperopt.txt` types-cachetools==6.0.0.20250525 types-filelock==3.2.7 types-requests==2.32.4.20250611 From 1dd56df5d8db3221a1ef7a3f4de4113542115a3f Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 4 Jul 2025 14:24:30 +0200 Subject: [PATCH 2/3] chore: improve sorting in mypy deps --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a611a7798..0c0e76879 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,12 +26,12 @@ repos: - id: mypy exclude: build_helpers additional_dependencies: - - scipy-stubs==1.15.3.0 - types-cachetools==6.0.0.20250525 - types-filelock==3.2.7 - types-requests==2.32.4.20250611 - types-tabulate==0.9.0.20241207 - types-python-dateutil==2.9.0.20250516 + - scipy-stubs==1.15.3.0 - SQLAlchemy==2.0.41 # stages: [push] From e5a9c65e66aae008df39302832e8d8fa20cf11ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 4 Jul 2025 14:25:22 +0200 Subject: [PATCH 3/3] ci: improve pre-commit-update check --- build_helpers/pre_commit_update.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build_helpers/pre_commit_update.py b/build_helpers/pre_commit_update.py index 9d313efd2..9e49aa7c2 100644 --- a/build_helpers/pre_commit_update.py +++ b/build_helpers/pre_commit_update.py @@ -16,10 +16,12 @@ with require_dev.open("r") as rfile: with require.open("r") as rfile: requirements.extend(rfile.readlines()) -# Extract types only -type_reqs = [ - r.strip("\n") for r in requirements if r.startswith("types-") or r.startswith("SQLAlchemy") -] +# Extract relevant types only +supported = ("types-", "SQLAlchemy", "scipy-stubs") + +# Find relevant dependencies +# Only keep the first part of the line up to the first space +type_reqs = [r.strip("\n").split()[0] for r in requirements if r.startswith(supported)] with pre_commit_file.open("r") as file: f = yaml.load(file, Loader=yaml.SafeLoader)