about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/rasterio
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-05-03 15:14:25 +0200
committerAlyssa Ross <hi@alyssa.is>2024-05-07 11:19:19 +0200
commitd92b2b6a1bbd322dd65a8b6f51019610d350046e (patch)
tree7f7c21927b9cc05676501f297c51eb76b49e326c /nixpkgs/pkgs/development/python-modules/rasterio
parent93c9e56b40530cc627d921cfc255c05b495d4017 (diff)
parent49050352f602fe87d16ff7b2b6a05b79eb20dc6f (diff)
downloadnixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.gz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.bz2
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.lz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.xz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.zst
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable-small'
Conflicts:
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/rasterio')
-rw-r--r--nixpkgs/pkgs/development/python-modules/rasterio/default.nix41
1 files changed, 22 insertions, 19 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/rasterio/default.nix b/nixpkgs/pkgs/development/python-modules/rasterio/default.nix
index eef18524c217..b11ff18fc9db 100644
--- a/nixpkgs/pkgs/development/python-modules/rasterio/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/rasterio/default.nix
@@ -1,10 +1,10 @@
 { lib
 , buildPythonPackage
 , fetchFromGitHub
-, fetchpatch
 , pytestCheckHook
 , pythonOlder
 , stdenv
+, testers
 
 , affine
 , attrs
@@ -13,24 +13,25 @@
 , click
 , click-plugins
 , cligj
-, cython_3
+, cython
 , gdal
 , hypothesis
 , ipython
 , matplotlib
 , numpy
-, oldest-supported-numpy
 , packaging
 , pytest-randomly
 , setuptools
 , shapely
 , snuggs
 , wheel
+
+, rasterio  # required to run version test
 }:
 
 buildPythonPackage rec {
   pname = "rasterio";
-  version = "1.3.9";
+  version = "1.3.10";
   format = "pyproject";
 
   disabled = pythonOlder "3.8";
@@ -39,26 +40,23 @@ buildPythonPackage rec {
     owner = "rasterio";
     repo = "rasterio";
     rev = "refs/tags/${version}";
-    hash = "sha256-Tp6BSU33FaszrIXQgU0Asb7IMue0C939o/atAKz+3Q4=";
+    hash = "sha256-FidUaSpbTR8X1/Cqy/IwApkOOl2RRtPqYJaSISRPThI=";
   };
 
-  patches = [
-    # fix tests failing with GDAL 3.8.0
-    (fetchpatch {
-      url = "https://github.com/rasterio/rasterio/commit/54ec554a6d9ee52207ad17dee42cbc51c613f709.diff";
-      hash = "sha256-Vjt9HRYNAWyj0myMdtSUENbcLjACfzegEClzZb4BxY8=";
-    })
-    (fetchpatch {
-      url = "https://github.com/rasterio/rasterio/commit/5a72613c58d1482bf297d08cbacf27992f52b2c4.diff";
-      hash = "sha256-bV6rh3GBmeqq9+Jff2b8/1wOuyF3Iqducu2eN4CT3lM=";
-    })
-  ];
+  postPatch = ''
+    # remove useless import statement requiring distutils to be present at the runtime
+    substituteInPlace rasterio/rio/calc.py \
+      --replace-fail "from distutils.version import LooseVersion" ""
+
+    # relax dependency on yet non-packaged, RC version of numpy
+    substituteInPlace pyproject.toml \
+      --replace-fail "numpy==2.0.0rc1" "numpy"
+    '';
 
   nativeBuildInputs = [
-    cython_3
+    cython
     gdal
     numpy
-    oldest-supported-numpy
     setuptools
     wheel
   ];
@@ -71,7 +69,6 @@ buildPythonPackage rec {
     click-plugins
     cligj
     numpy
-    setuptools
     snuggs
   ];
 
@@ -117,6 +114,12 @@ buildPythonPackage rec {
     "rasterio"
   ];
 
+  passthru.tests.version = testers.testVersion {
+    package = rasterio;
+    version = version;
+    command = "${rasterio}/bin/rio --version";
+  };
+
   meta = with lib; {
     description = "Python package to read and write geospatial raster data";
     mainProgram = "rio";