1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 hatch-vcs,
9 hatchling,
10 setuptools-scm,
11
12 # dependencies
13 dask-expr,
14 dask-glm,
15 distributed,
16 multipledispatch,
17 numba,
18 numpy,
19 packaging,
20 pandas,
21 scikit-learn,
22 scipy,
23 dask,
24
25 # tests
26 pytest-mock,
27 pytestCheckHook,
28}:
29
30buildPythonPackage rec {
31 pname = "dask-ml";
32 version = "2024.4.4";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "dask";
37 repo = "dask-ml";
38 rev = "refs/tags/v${version}";
39 hash = "sha256-ZiBpCk3b4Tk0Hwb4uapJLEx+Nb/qHFROCnkBTNGDzoU=";
40 };
41
42 build-system = [
43 hatch-vcs
44 hatchling
45 setuptools-scm
46 ];
47
48 dependencies =
49 [
50 dask-expr
51 dask-glm
52 distributed
53 multipledispatch
54 numba
55 numpy
56 packaging
57 pandas
58 scikit-learn
59 scipy
60 ]
61 ++ dask.optional-dependencies.array
62 ++ dask.optional-dependencies.dataframe;
63
64 pythonImportsCheck = [
65 "dask_ml"
66 "dask_ml.naive_bayes"
67 "dask_ml.wrappers"
68 "dask_ml.utils"
69 ];
70
71 nativeCheckInputs = [
72 pytest-mock
73 pytestCheckHook
74 ];
75
76 disabledTestPaths =
77 [
78 # AttributeError: 'csr_matrix' object has no attribute 'A'
79 # Fixed in https://github.com/dask/dask-ml/pull/996
80 "tests/test_svd.py"
81
82 # Tests fail with dask>=0.11.2
83 # RuntimeError: Not enough arguments provided
84 # Reported in https://github.com/dask/dask-ml/issues/1003
85 "tests/model_selection/test_incremental.py"
86 ]
87 ++ lib.optionals stdenv.isDarwin [
88 # RuntimeError: Not enough arguments provided: missing keys
89 "tests/model_selection/test_hyperband.py"
90 "tests/model_selection/test_incremental.py"
91 "tests/model_selection/test_incremental_warns.py"
92 "tests/model_selection/test_successive_halving.py"
93 ];
94
95 disabledTests = [
96 # Flaky: `Arrays are not almost equal to 3 decimals` (although values do actually match)
97 "test_whitening"
98
99 # Tests fail with dask>=0.11.2
100 # RuntimeError: Not enough arguments provided
101 # Reported in https://github.com/dask/dask-ml/issues/1003
102 "test_basic"
103 "test_hyperband_patience"
104 "test_same_random_state_same_params"
105 "test_search_patience_infeasible_tol"
106 "test_sha_max_iter_and_metadata"
107 "test_warns_decay_rate"
108 "test_warns_decay_rate_wanted"
109 ];
110
111 __darwinAllowLocalNetworking = true;
112
113 meta = {
114 description = "Scalable Machine Learn with Dask";
115 homepage = "https://github.com/dask/dask-ml";
116 license = lib.licenses.bsd3;
117 maintainers = with lib.maintainers; [ GaetanLepage ];
118 };
119}