1{ lib
2, stdenv
3, bokeh
4, buildPythonPackage
5, cloudpickle
6, distributed
7, fetchFromGitHub
8, fetchpatch
9, fsspec
10, jinja2
11, numpy
12, packaging
13, pandas
14, partd
15, pytest-rerunfailures
16, pytest-xdist
17, pytestCheckHook
18, pythonOlder
19, pyyaml
20, toolz
21, withExtraComplete ? false
22}:
23
24buildPythonPackage rec {
25 pname = "dask";
26 version = "2021.10.0";
27 format = "setuptools";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "dask";
33 repo = pname;
34 rev = version;
35 sha256 = "07ysrs46x5w8rc2df0j06rsw58ahcysd6lwjk5riqpjlpwdfmg7p";
36 };
37
38 patches = [
39 # remove with next bump
40 (fetchpatch {
41 name = "fix-tests-against-distributed-2021.10.0.patch";
42 url = "https://github.com/dask/dask/commit/cd65507841448ad49001cf27564102e2fb964d0a.patch";
43 includes = [ "dask/tests/test_distributed.py" ];
44 sha256 = "1i4i4k1lzxcydq9l80jyifq21ny0j3i47rviq07ai488pvx1r2al";
45 })
46 ];
47
48 propagatedBuildInputs = [
49 cloudpickle
50 fsspec
51 packaging
52 partd
53 pyyaml
54 toolz
55 pandas
56 jinja2
57 bokeh
58 numpy
59 ] ++ lib.optionals (withExtraComplete) [
60 # infinite recursion between distributed and dask
61 distributed
62 ];
63
64 doCheck = true;
65
66 checkInputs = [
67 pytestCheckHook
68 pytest-rerunfailures
69 pytest-xdist
70 ];
71
72 dontUseSetuptoolsCheck = true;
73
74 postPatch = ''
75 # versioneer hack to set version of github package
76 echo "def get_versions(): return {'dirty': False, 'error': None, 'full-revisionid': None, 'version': '${version}'}" > dask/_version.py
77
78 substituteInPlace setup.py \
79 --replace "version=versioneer.get_version()," "version='${version}'," \
80 --replace "cmdclass=versioneer.get_cmdclass()," ""
81 '';
82
83 pytestFlagsArray = [
84 # parallelize
85 "--numprocesses auto"
86 # rerun failed tests up to three times
87 "--reruns 3"
88 # don't run tests that require network access
89 "-m 'not network'"
90 ];
91
92 disabledTests = lib.optionals stdenv.isDarwin [
93 # this test requires features of python3Packages.psutil that are
94 # blocked in sandboxed-builds
95 "test_auto_blocksize_csv"
96 ] ++ [
97 # A deprecation warning from newer sqlalchemy versions makes these tests
98 # to fail https://github.com/dask/dask/issues/7406
99 "test_sql"
100 # Test interrupt fails intermittently https://github.com/dask/dask/issues/2192
101 "test_interrupt"
102 ];
103
104 __darwinAllowLocalNetworking = true;
105
106 pythonImportsCheck = [
107 "dask"
108 "dask.array"
109 "dask.bag"
110 "dask.bytes"
111 "dask.dataframe"
112 "dask.dataframe.io"
113 "dask.dataframe.tseries"
114 "dask.diagnostics"
115 ];
116
117 meta = with lib; {
118 description = "Minimal task scheduling abstraction";
119 homepage = "https://dask.org/";
120 changelog = "https://docs.dask.org/en/latest/changelog.html";
121 license = licenses.bsd3;
122 maintainers = with maintainers; [ fridh ];
123 };
124}