1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 setuptools, 8 setuptools-scm, 9 xarray, 10 11 # optional-dependencies 12 matplotlib, 13 pint, 14 pooch, 15 regex, 16 rich, 17 shapely, 18 19 # tests 20 dask, 21 pytestCheckHook, 22 scipy, 23}: 24 25buildPythonPackage rec { 26 pname = "cf-xarray"; 27 version = "0.10.9"; 28 pyproject = true; 29 30 src = fetchFromGitHub { 31 owner = "xarray-contrib"; 32 repo = "cf-xarray"; 33 tag = "v${version}"; 34 hash = "sha256-tYs+aZp/QbM166KNj4MjIjqS6LcuDCyXwghSoF5rj4M="; 35 }; 36 37 build-system = [ 38 setuptools 39 setuptools-scm 40 xarray 41 ]; 42 43 dependencies = [ xarray ]; 44 45 optional-dependencies = { 46 all = [ 47 matplotlib 48 pint 49 pooch 50 regex 51 rich 52 shapely 53 ]; 54 }; 55 56 nativeCheckInputs = [ 57 dask 58 pytestCheckHook 59 scipy 60 ] 61 ++ lib.flatten (builtins.attrValues optional-dependencies); 62 63 pythonImportsCheck = [ "cf_xarray" ]; 64 65 disabledTestPaths = [ 66 # Tests require network access 67 "cf_xarray/tests/test_accessor.py" 68 "cf_xarray/tests/test_groupers.py" 69 "cf_xarray/tests/test_helpers.py" 70 ]; 71 72 meta = { 73 description = "Accessor for xarray objects that interprets CF attributes"; 74 homepage = "https://github.com/xarray-contrib/cf-xarray"; 75 changelog = "https://github.com/xarray-contrib/cf-xarray/releases/tag/${src.tag}"; 76 license = lib.licenses.asl20; 77 maintainers = with lib.maintainers; [ fab ]; 78 }; 79}