1{ lib
2, stdenv
3, bokeh
4, buildPythonPackage
5, click
6, cloudpickle
7, distributed
8, fastparquet
9, fetchFromGitHub
10, fetchpatch
11, fsspec
12, jinja2
13, numpy
14, packaging
15, pandas
16, partd
17, pyarrow
18, pytest-rerunfailures
19, pytest-xdist
20, pytestCheckHook
21, pythonOlder
22, pyyaml
23, scipy
24, toolz
25, zarr
26}:
27
28buildPythonPackage rec {
29 pname = "dask";
30 version = "2022.10.2";
31 format = "setuptools";
32
33 disabled = pythonOlder "3.8";
34
35 src = fetchFromGitHub {
36 owner = "dask";
37 repo = pname;
38 rev = version;
39 hash = "sha256-zHJR2WjHigUMWtRJW25+gk1fKGKedU53BBjwx5zaodA=";
40 };
41
42 patches = [
43 (fetchpatch {
44 # Fix test_repartition_npartitions on platforms other than x86-64
45 url = "https://github.com/dask/dask/commit/65f40ad461c57065f981e6213e33b1d13cc9bc8f.patch";
46 hash = "sha256-KyTSms4ik1kYtL+I/huAxD+zK2AAuPkwmHA9FYk601Y=";
47 })
48 ];
49
50 propagatedBuildInputs = [
51 click
52 cloudpickle
53 fsspec
54 packaging
55 partd
56 pyyaml
57 toolz
58 ];
59
60 passthru.optional-dependencies = {
61 array = [
62 numpy
63 ];
64 complete = [
65 distributed
66 ];
67 dataframe = [
68 numpy
69 pandas
70 ];
71 distributed = [
72 distributed
73 ];
74 diagnostics = [
75 bokeh
76 jinja2
77 ];
78 };
79
80 checkInputs = [
81 fastparquet
82 pyarrow
83 pytestCheckHook
84 pytest-rerunfailures
85 pytest-xdist
86 scipy
87 zarr
88 ];
89
90 dontUseSetuptoolsCheck = true;
91
92 postPatch = ''
93 # versioneer hack to set version of GitHub package
94 echo "def get_versions(): return {'dirty': False, 'error': None, 'full-revisionid': None, 'version': '${version}'}" > dask/_version.py
95
96 substituteInPlace setup.py \
97 --replace "version=versioneer.get_version()," "version='${version}'," \
98 --replace "cmdclass=versioneer.get_cmdclass()," ""
99
100 substituteInPlace setup.cfg \
101 --replace " --durations=10" "" \
102 --replace " -v" ""
103 '';
104
105 pytestFlagsArray = [
106 # Rerun failed tests up to three times
107 "--reruns 3"
108 # Don't run tests that require network access
109 "-m 'not network'"
110 # DeprecationWarning: The 'sym_pos' keyword is deprecated and should be replaced by using 'assume_a = "pos"'. 'sym_pos' will be removed in SciPy 1.11.0.
111 "-W" "ignore::DeprecationWarning"
112 ];
113
114 disabledTests = lib.optionals stdenv.isDarwin [
115 # Test requires features of python3Packages.psutil that are
116 # blocked in sandboxed-builds
117 "test_auto_blocksize_csv"
118 # AttributeError: 'str' object has no attribute 'decode'
119 "test_read_dir_nometa"
120 ] ++ [
121 "test_chunksize_files"
122 # TypeError: 'ArrowStringArray' with dtype string does not support reduction 'min'
123 "test_set_index_string"
124 ];
125
126 __darwinAllowLocalNetworking = true;
127
128 pythonImportsCheck = [
129 "dask"
130 "dask.array"
131 "dask.bag"
132 "dask.bytes"
133 "dask.dataframe"
134 "dask.dataframe.io"
135 "dask.dataframe.tseries"
136 "dask.diagnostics"
137 ];
138
139 meta = with lib; {
140 description = "Minimal task scheduling abstraction";
141 homepage = "https://dask.org/";
142 changelog = "https://docs.dask.org/en/latest/changelog.html";
143 license = licenses.bsd3;
144 maintainers = with maintainers; [ fridh ];
145 };
146}