about summary refs log tree commit diff
path: root/pkgs/development/python-modules/cf-xarray/default.nix
blob: 2ea7714f2081143a4e9970f87aceb54d1d72b65d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
  lib,
  buildPythonPackage,
  dask,
  fetchFromGitHub,
  matplotlib,
  pint,
  pooch,
  pytestCheckHook,
  pythonOlder,
  regex,
  rich,
  scipy,
  setuptools,
  setuptools-scm,
  shapely,
  wheel,
  xarray,
}:

buildPythonPackage rec {
  pname = "cf-xarray";
  version = "0.9.1";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "xarray-contrib";
    repo = "cf-xarray";
    rev = "refs/tags/v${version}";
    hash = "sha256-Og84lB99576G3IZz8LNafF86TyYP+ooe2tL8wb60RPw=";
  };

  nativeBuildInputs = [
    setuptools
    setuptools-scm
    wheel
    xarray
  ];

  propagatedBuildInputs = [ xarray ];

  passthru.optional-dependencies = {
    all = [
      matplotlib
      pint
      pooch
      regex
      rich
      shapely
    ];
  };

  nativeCheckInputs = [
    dask
    pytestCheckHook
    scipy
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  pythonImportsCheck = [ "cf_xarray" ];

  disabledTestPaths = [
    # Tests require network access
    "cf_xarray/tests/test_accessor.py"
    "cf_xarray/tests/test_helpers.py"
  ];

  meta = with lib; {
    description = "An accessor for xarray objects that interprets CF attributes";
    homepage = "https://github.com/xarray-contrib/cf-xarray";
    changelog = "https://github.com/xarray-contrib/cf-xarray/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
  };
}