summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/async-geotiff/default.nix
blob: eb9bd93ef26c677d797ced5964900f49eba1d8a2 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch2,
  pytestCheckHook,
  uv-build,

  affine,
  async-tiff,
  defusedxml,
  numpy,
  pyproj,

  # tests
  pydantic,
  rasterio,
  morecantile,
  jsonschema,
  pytest-asyncio,
}:
buildPythonPackage (finalAttrs: {
  pname = "async-geotiff";
  version = "0.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "developmentseed";
    repo = "async-geotiff";
    tag = "v${finalAttrs.version}";
    hash = "sha256-J72/VRDAgqGOm7rYmlkURKgWSIa11L260LX447MQWbc=";
    fetchSubmodules = true;
  };

  patches = [
    # see https://github.com/developmentseed/async-geotiff/pull/136
    ./uv-build-relax-deps.patch
    # see https://github.com/developmentseed/async-tiff/pull/292
    (fetchpatch2 {
      url = "https://github.com/developmentseed/async-geotiff/commit/f8325c0decb2a7e61faf3db5e51ec5a104d3cbdb.patch?full_index=1";
      hash = "sha256-RLqMWKtjDSmxQkUXz9dXKIIqRXM7BWkuJIbbeHxCPyQ=";
    })
  ];

  build-system = [ uv-build ];

  # see https://github.com/developmentseed/async-geotiff/pull/133
  pythonRemoveDeps = [ "types-defusedxml" ];

  dependencies = [
    affine
    async-tiff
    defusedxml
    numpy
    pyproj
  ];

  pythonImportsCheck = [ "async_geotiff" ];

  nativeCheckInputs = [ pytestCheckHook ];

  checkInputs = [
    jsonschema
    morecantile
    rasterio
    pydantic
    pytest-asyncio
  ];

  meta = {
    description = "Fast, async GeoTIFF and COG reader for Python";
    homepage = "https://developmentseed.org/async-geotiff/latest/";
    license = lib.licenses.mit;
    teams = [ lib.teams.geospatial ];
  };
})