summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/odc-loader/default.nix
blob: 70b9f86b74fd559d5d28bd2022bb50161e0ea45a (plain)
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
77
78
79
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  flit,
  setuptools,

  # dependencies
  dask,
  numpy,
  odc-geo,
  rasterio,
  xarray,

  # optional-dependencies
  botocore,
  zarr,

  # tests
  geopandas,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "odc-loader";
  version = "0.5.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "opendatacube";
    repo = "odc-loader";
    tag = "v${version}";
    hash = "sha256-yBCityE9e29wUnPuD09MTeyyVY/o9X/1lUq3Su8sd6g=";
  };

  build-system = [
    flit
  ];

  dependencies = [
    dask
    numpy
    odc-geo
    rasterio
    xarray
  ];

  optional-dependencies = {
    botocore = [ botocore ];
    zarr = [ zarr ];
    all = lib.concatAttrValues (lib.removeAttrs optional-dependencies [ "all" ]);
  };

  nativeCheckInputs = [
    geopandas
    pytestCheckHook
  ]
  ++ optional-dependencies.all;

  disabledTests = [
    # Require internet access
    "test_mem_reader"
    "test_memreader_zarr"
  ];

  pythonImportsCheck = [
    "odc.loader"
  ];

  meta = {
    description = "Tools for constructing xarray objects from parsed metadata";
    homepage = "https://github.com/opendatacube/odc-loader/";
    changelog = "https://github.com/opendatacube/odc-loader/releases/tag/${version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ daspk04 ];
  };
}