1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 affine,
11 dask,
12 numpy,
13 odc-geo,
14 odc-loader,
15 pandas,
16 pystac,
17 rasterio,
18 toolz,
19 xarray,
20
21 # optional-dependencies
22 botocore,
23
24 # tests
25 geopandas,
26 distributed,
27 pystac-client,
28 pytestCheckHook,
29}:
30
31buildPythonPackage rec {
32 pname = "odc-stac";
33 version = "0.4.0rc2";
34 pyproject = true;
35
36 src = fetchFromGitHub {
37 owner = "opendatacube";
38 repo = "odc-stac";
39 tag = "v${version}";
40 hash = "sha256-I25qAJEryYaYO7KIVIoTlgzLS6PWkNG6b4NFyhghyKQ=";
41 };
42
43 build-system = [
44 hatchling
45 ];
46
47 dependencies = [
48 affine
49 dask
50 numpy
51 odc-geo
52 odc-loader
53 pandas
54 pystac
55 rasterio
56 toolz
57 xarray
58 ];
59
60 optional-dependencies = {
61 botocore = [ botocore ];
62 };
63
64 nativeCheckInputs = [
65 geopandas
66 distributed
67 pystac-client
68 pytestCheckHook
69 ] ++ optional-dependencies.botocore;
70
71 pytestFlagsArray = [ "-m 'not network'" ];
72
73 disabledTests = [
74 # pystac href error (possible related to network)
75 "test_extract_md"
76 "test_parse_item"
77 "test_parse_item_no_proj"
78 # urllib url open error
79 "test_norm_geom"
80 "test_output_geobox"
81 ];
82
83 pythonImportsCheck = [
84 "odc.stac"
85 ];
86
87 meta = {
88 description = "Load STAC items into xarray Datasets.";
89 homepage = "https://github.com/opendatacube/odc-stac/";
90 changelog = "https://github.com/opendatacube/odc-stac/tag/v${version}";
91 license = lib.licenses.asl20;
92 maintainers = with lib.maintainers; [ daspk04 ];
93 };
94}