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