From 7a4e6352ba3ae001a3b18dd752466ecbd2a65953 Mon Sep 17 00:00:00 2001 From: Harinn Date: Sat, 16 May 2026 21:54:04 +0700 Subject: [PATCH] python3Packages.dask-ml: fix build with pytest 9 and sklearn 1.8 --- .../python-modules/dask-ml/default.nix | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pkgs/development/python-modules/dask-ml/default.nix b/pkgs/development/python-modules/dask-ml/default.nix index d78a16803c21..4153970a052e 100644 --- a/pkgs/development/python-modules/dask-ml/default.nix +++ b/pkgs/development/python-modules/dask-ml/default.nix @@ -36,6 +36,12 @@ buildPythonPackage rec { hash = "sha256-DHxx0LFuJmGWYuG/WGHj+a5XHAEekBmlHUUb90rl2IY="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'addopts = "-rsx -v --durations=10 --color=yes"' \ + 'addopts = ["-rsx", "-v", "--durations=10", "--color=yes"]' + ''; + build-system = [ hatch-vcs hatchling @@ -74,6 +80,10 @@ buildPythonPackage rec { "tests/model_selection/test_incremental.py" "tests/model_selection/test_incremental_warns.py" "tests/model_selection/test_successive_halving.py" + + # MockClassifier predates sklearn 1.6 __sklearn_tags__ + "tests/model_selection/dask_searchcv/test_model_selection.py" + "tests/model_selection/dask_searchcv/test_model_selection_sklearn.py" ]; disabledTests = [ @@ -89,6 +99,28 @@ buildPythonPackage rec { "test_lr_score" "test_ok" "test_scoring_string" + + # sklearn 1.7+: PCA / IncrementalPCA missing power_iteration_normalizer + "test_pca_randomized_solver" + "test_pca_check_projection" + "test_pca_inverse" + "test_pca_score" + "test_pca_score2" + "test_randomized_pca_check_projection" + "test_randomized_pca_inverse" + "test_pca_int_dtype_upcast_to_double" + "test_incremental_pca" + "test_incremental_pca_against_pca_iris" + "test_incremental_pca_against_pca_random_data" + "test_singular_values" + "test_whitening" + + # sklearn 1.8 API drift in LogisticRegression/ParallelPostFit + "test_predict" + "test_multiclass" + + # XPASS becomes failure under xfail_strict (now honored on pytest 9) + "test_soft_voting_frame" ]; __darwinAllowLocalNetworking = true;