Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 98 lines 2.2 kB view raw
1{ lib 2, stdenv 3, bokeh 4, buildPythonPackage 5, fetchpatch 6, fetchFromGitHub 7, fsspec 8, pytestCheckHook 9, pytest-rerunfailures 10, pythonOlder 11, cloudpickle 12, numpy 13, toolz 14, dill 15, pandas 16, partd 17, pytest-xdist 18, withExtraComplete ? false 19, distributed 20}: 21 22buildPythonPackage rec { 23 pname = "dask"; 24 version = "2021.03.0"; 25 disabled = pythonOlder "3.5"; 26 27 src = fetchFromGitHub { 28 owner = "dask"; 29 repo = pname; 30 rev = version; 31 sha256 = "LACv7lWpQULQknNGX/9vH9ckLsypbqKDGnsNBgKT1eI="; 32 }; 33 34 propagatedBuildInputs = [ 35 bokeh 36 cloudpickle 37 dill 38 fsspec 39 numpy 40 pandas 41 partd 42 toolz 43 ] ++ lib.optionals withExtraComplete [ 44 distributed 45 ]; 46 47 doCheck = true; 48 49 checkInputs = [ 50 pytestCheckHook 51 pytest-rerunfailures 52 pytest-xdist 53 ]; 54 55 dontUseSetuptoolsCheck = true; 56 57 patches = [ 58 # dask dataframe cannot be imported in sandboxed builds 59 # See https://github.com/dask/dask/pull/7601 60 (fetchpatch { 61 url = "https://github.com/dask/dask/commit/9ce5b0d258cecb3ef38fd844135ad1f7ac3cea5f.patch"; 62 sha256 = "sha256-1EVRYwAdTSEEH9jp+UOnrijzezZN3iYR6q6ieYJM3kY="; 63 name = "fix-dask-dataframe-imports-in-sandbox.patch"; 64 }) 65 ]; 66 67 postPatch = '' 68 # versioneer hack to set version of github package 69 echo "def get_versions(): return {'dirty': False, 'error': None, 'full-revisionid': None, 'version': '${version}'}" > dask/_version.py 70 71 substituteInPlace setup.py \ 72 --replace "version=versioneer.get_version()," "version='${version}'," \ 73 --replace "cmdclass=versioneer.get_cmdclass()," "" 74 ''; 75 76 pytestFlagsArray = [ 77 "-n $NIX_BUILD_CORES" 78 "-m 'not network'" 79 ]; 80 81 disabledTests = lib.optionals stdenv.isDarwin [ 82 # this test requires features of python3Packages.psutil that are 83 # blocked in sandboxed-builds 84 "test_auto_blocksize_csv" 85 ]; 86 87 __darwinAllowLocalNetworking = true; 88 89 pythonImportsCheck = [ "dask.dataframe" "dask" "dask.array" ]; 90 91 meta = with lib; { 92 description = "Minimal task scheduling abstraction"; 93 homepage = "https://dask.org/"; 94 changelog = "https://docs.dask.org/en/latest/changelog.html"; 95 license = licenses.bsd3; 96 maintainers = with maintainers; [ fridh ]; 97 }; 98}