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.5"; 28 pyproject = true; 29 30 src = fetchFromGitHub { 31 owner = "xarray-contrib"; 32 repo = "cf-xarray"; 33 tag = "v${version}"; 34 hash = "sha256-ty7gPBs2vp0mVnn914F84Dg4+DLCBLl7aHMqqrXx9So="; 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 ] ++ lib.flatten (builtins.attrValues optional-dependencies); 61 62 pythonImportsCheck = [ "cf_xarray" ]; 63 64 disabledTestPaths = [ 65 # Tests require network access 66 "cf_xarray/tests/test_accessor.py" 67 "cf_xarray/tests/test_groupers.py" 68 "cf_xarray/tests/test_helpers.py" 69 ]; 70 71 meta = { 72 description = "Accessor for xarray objects that interprets CF attributes"; 73 homepage = "https://github.com/xarray-contrib/cf-xarray"; 74 changelog = "https://github.com/xarray-contrib/cf-xarray/releases/tag/${src.tag}"; 75 license = lib.licenses.asl20; 76 maintainers = with lib.maintainers; [ fab ]; 77 }; 78}