diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e8730b679a5d6..cecc0e705cd73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.15.0 hooks: - id: mypy files: sklearn/ diff --git a/pyproject.toml b/pyproject.toml index a96c517cf840e..3be6887e3d391 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,7 @@ tests = [ "pytest-cov>=2.9.0", "ruff>=0.5.1", "black>=24.3.0", - "mypy>=1.9", + "mypy>=1.15", "pyamg>=5.0.0", "polars>=0.20.30", "pyarrow>=12.0.0", diff --git a/sklearn/_loss/tests/test_loss.py b/sklearn/_loss/tests/test_loss.py index ae94f4c1192b4..69ff18d376fee 100644 --- a/sklearn/_loss/tests/test_loss.py +++ b/sklearn/_loss/tests/test_loss.py @@ -204,7 +204,7 @@ def test_loss_boundary(loss): @pytest.mark.parametrize( - "loss, y_true_success, y_true_fail", Y_COMMON_PARAMS + Y_TRUE_PARAMS + "loss, y_true_success, y_true_fail", Y_COMMON_PARAMS + Y_TRUE_PARAMS # type: ignore[operator] ) def test_loss_boundary_y_true(loss, y_true_success, y_true_fail): """Test boundaries of y_true for loss functions.""" @@ -215,7 +215,7 @@ def test_loss_boundary_y_true(loss, y_true_success, y_true_fail): @pytest.mark.parametrize( - "loss, y_pred_success, y_pred_fail", Y_COMMON_PARAMS + Y_PRED_PARAMS # type: ignore + "loss, y_pred_success, y_pred_fail", Y_COMMON_PARAMS + Y_PRED_PARAMS # type: ignore[operator] ) def test_loss_boundary_y_pred(loss, y_pred_success, y_pred_fail): """Test boundaries of y_pred for loss functions.""" diff --git a/sklearn/_min_dependencies.py b/sklearn/_min_dependencies.py index 8e0592abddd74..4b64fc9b11b71 100644 --- a/sklearn/_min_dependencies.py +++ b/sklearn/_min_dependencies.py @@ -34,7 +34,7 @@ "pytest-cov": ("2.9.0", "tests"), "ruff": ("0.5.1", "tests"), "black": ("24.3.0", "tests"), - "mypy": ("1.9", "tests"), + "mypy": ("1.15", "tests"), "pyamg": ("5.0.0", "tests"), "polars": ("0.20.30", "docs, tests"), "pyarrow": ("12.0.0", "tests"), diff --git a/sklearn/tree/_classes.py b/sklearn/tree/_classes.py index 53a1187ec5a50..ec042326d5ea9 100644 --- a/sklearn/tree/_classes.py +++ b/sklearn/tree/_classes.py @@ -1993,5 +1993,5 @@ def __sklearn_tags__(self): "friedman_mse", "poisson", } - tags.input_tags.allow_nan: allow_nan + tags.input_tags.allow_nan = allow_nan return tags