1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 flit,
8 setuptools,
9
10 # dependencies
11 dask,
12 numpy,
13 odc-geo,
14 rasterio,
15 xarray,
16
17 # optional-dependencies
18 botocore,
19 zarr,
20
21 # tests
22 geopandas,
23 pytestCheckHook,
24}:
25
26buildPythonPackage rec {
27 pname = "odc-loader";
28 version = "0.5.1";
29 pyproject = true;
30
31 src = fetchFromGitHub {
32 owner = "opendatacube";
33 repo = "odc-loader";
34 tag = "v${version}";
35 hash = "sha256-yBCityE9e29wUnPuD09MTeyyVY/o9X/1lUq3Su8sd6g=";
36 };
37
38 build-system = [
39 flit
40 ];
41
42 dependencies = [
43 dask
44 numpy
45 odc-geo
46 rasterio
47 xarray
48 ];
49
50 optional-dependencies = {
51 botocore = [ botocore ];
52 zarr = [ zarr ];
53 all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies));
54 };
55
56 nativeCheckInputs = [
57 geopandas
58 pytestCheckHook
59 ]
60 ++ optional-dependencies.all;
61
62 disabledTests = [
63 # Require internet access
64 "test_mem_reader"
65 "test_memreader_zarr"
66 ];
67
68 pythonImportsCheck = [
69 "odc.loader"
70 ];
71
72 meta = {
73 description = "Tools for constructing xarray objects from parsed metadata";
74 homepage = "https://github.com/opendatacube/odc-loader/";
75 changelog = "https://github.com/opendatacube/odc-loader/tag/${version}";
76 license = lib.licenses.asl20;
77 maintainers = with lib.maintainers; [ daspk04 ];
78 };
79}