1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatch-vcs,
8 hatchling,
9
10 # dependencies
11 dask-glm,
12 distributed,
13 multipledispatch,
14 numba,
15 numpy,
16 packaging,
17 pandas,
18 scikit-learn,
19 scipy,
20 dask,
21
22 # tests
23 pytest-mock,
24 pytestCheckHook,
25}:
26
27buildPythonPackage rec {
28 pname = "dask-ml";
29 version = "2025.1.0";
30 pyproject = true;
31
32 src = fetchFromGitHub {
33 owner = "dask";
34 repo = "dask-ml";
35 tag = "v${version}";
36 hash = "sha256-DHxx0LFuJmGWYuG/WGHj+a5XHAEekBmlHUUb90rl2IY=";
37 };
38
39 build-system = [
40 hatch-vcs
41 hatchling
42 ];
43
44 dependencies = [
45 dask-glm
46 distributed
47 multipledispatch
48 numba
49 numpy
50 packaging
51 pandas
52 scikit-learn
53 scipy
54 ]
55 ++ dask.optional-dependencies.array
56 ++ dask.optional-dependencies.dataframe;
57
58 pythonImportsCheck = [
59 "dask_ml"
60 "dask_ml.naive_bayes"
61 "dask_ml.wrappers"
62 "dask_ml.utils"
63 ];
64
65 nativeCheckInputs = [
66 pytest-mock
67 pytestCheckHook
68 ];
69
70 disabledTestPaths = [
71 # RuntimeError: Attempting to use an asynchronous Client in a synchronous context of `dask.compute`
72 # https://github.com/dask/dask-ml/issues/1016
73 "tests/model_selection/test_hyperband.py"
74 "tests/model_selection/test_incremental.py"
75 "tests/model_selection/test_incremental_warns.py"
76 "tests/model_selection/test_successive_halving.py"
77 ];
78
79 disabledTests = [
80 # AssertionError: Regex pattern did not match.
81 "test_unknown_category_transform_array"
82
83 # ValueError: cannot broadcast shape (nan,) to shape (nan,)
84 # https://github.com/dask/dask-ml/issues/1012
85 "test_fit_array"
86 "test_fit_frame"
87 "test_fit_transform_frame"
88 "test_laziness"
89 "test_lr_score"
90 "test_ok"
91 "test_scoring_string"
92 ];
93
94 __darwinAllowLocalNetworking = true;
95
96 meta = {
97 description = "Scalable Machine Learn with Dask";
98 homepage = "https://github.com/dask/dask-ml";
99 license = lib.licenses.bsd3;
100 maintainers = with lib.maintainers; [ GaetanLepage ];
101 };
102}