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 ] ++ optional-dependencies.all; 60 61 disabledTests = [ 62 # Require internet access 63 "test_mem_reader" 64 "test_memreader_zarr" 65 ]; 66 67 pythonImportsCheck = [ 68 "odc.loader" 69 ]; 70 71 meta = { 72 description = "Tools for constructing xarray objects from parsed metadata"; 73 homepage = "https://github.com/opendatacube/odc-loader/"; 74 changelog = "https://github.com/opendatacube/odc-loader/tag/${version}"; 75 license = lib.licenses.asl20; 76 maintainers = with lib.maintainers; [ daspk04 ]; 77 }; 78}