From c0715220056add043f40b31435ec499e702114e3 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Tue, 31 Mar 2026 15:50:40 +0200 Subject: [PATCH] python3Packages.async-geotiff: init at 0.4.0 --- .../python-modules/async-geotiff/default.nix | 76 +++++++++++++++++++ .../async-geotiff/uv-build-relax-deps.patch | 49 ++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 127 insertions(+) create mode 100644 pkgs/development/python-modules/async-geotiff/default.nix create mode 100644 pkgs/development/python-modules/async-geotiff/uv-build-relax-deps.patch diff --git a/pkgs/development/python-modules/async-geotiff/default.nix b/pkgs/development/python-modules/async-geotiff/default.nix new file mode 100644 index 000000000000..eb9bd93ef26c --- /dev/null +++ b/pkgs/development/python-modules/async-geotiff/default.nix @@ -0,0 +1,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 ]; + }; +}) diff --git a/pkgs/development/python-modules/async-geotiff/uv-build-relax-deps.patch b/pkgs/development/python-modules/async-geotiff/uv-build-relax-deps.patch new file mode 100644 index 000000000000..68597869ca15 --- /dev/null +++ b/pkgs/development/python-modules/async-geotiff/uv-build-relax-deps.patch @@ -0,0 +1,49 @@ +diff --git i/pyproject.toml w/pyproject.toml +index 601e2e5..cd26339 100644 +--- i/pyproject.toml ++++ w/pyproject.toml +@@ -69,7 +69,7 @@ docs = [ + + + [build-system] +-requires = ["uv_build>=0.8.8,<0.9.0"] ++requires = ["uv_build>=0.8.8,<0.12.0"] + build-backend = "uv_build" + + [tool.ruff] +diff --git i/uv.lock w/uv.lock +index e7cd10f..2a74412 100644 +--- i/uv.lock ++++ w/uv.lock +@@ -55,7 +55,6 @@ dependencies = [ + { name = "defusedxml" }, + { name = "numpy" }, + { name = "pyproj" }, +- { name = "types-defusedxml" }, + ] + + [package.optional-dependencies] +@@ -77,6 +76,7 @@ dev = [ + { name = "pytest-asyncio" }, + { name = "rasterio", version = "1.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" }, + { name = "rasterio", version = "1.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, ++ { name = "types-defusedxml" }, + { name = "types-jsonschema" }, + ] + docs = [ +@@ -97,7 +97,6 @@ requires-dist = [ + { name = "morecantile", marker = "extra == 'morecantile'", specifier = ">=7.0,<8.0" }, + { name = "numpy", specifier = ">=2.0" }, + { name = "pyproj", specifier = ">=3.3.0" }, +- { name = "types-defusedxml", specifier = ">=0.7.0.20250822" }, + ] + provides-extras = ["morecantile"] + +@@ -114,6 +113,7 @@ dev = [ + { name = "pytest", specifier = ">=9.0.2" }, + { name = "pytest-asyncio", specifier = ">=1.3.0" }, + { name = "rasterio", specifier = ">=1.4.4" }, ++ { name = "types-defusedxml", specifier = ">=0.7.0.20250822" }, + { name = "types-jsonschema", specifier = ">=4.26.0.20260109" }, + ] + docs = [ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b0f810a11671..99af1ae3f9bb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1114,6 +1114,8 @@ self: super: with self; { async-generator = callPackage ../development/python-modules/async-generator { }; + async-geotiff = callPackage ../development/python-modules/async-geotiff { }; + async-interrupt = callPackage ../development/python-modules/async-interrupt { }; async-lru = callPackage ../development/python-modules/async-lru { };