From e48fa78780570db2551d46a194256d1e0ed45e09 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 21 Oct 2025 13:00:39 +0000 Subject: [PATCH] python3Packages.rasterio: cleanup --- .../python-modules/rasterio/default.nix | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/pkgs/development/python-modules/rasterio/default.nix b/pkgs/development/python-modules/rasterio/default.nix index 9fc55c214146..167d493cc892 100644 --- a/pkgs/development/python-modules/rasterio/default.nix +++ b/pkgs/development/python-modules/rasterio/default.nix @@ -1,42 +1,43 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, - pytestCheckHook, - pythonOlder, - stdenv, - testers, + # build-system + cython, + gdal, + numpy, + setuptools, + + # dependencies affine, attrs, - boto3, certifi, click, click-plugins, cligj, - cython, - fsspec, - gdal, - hypothesis, + snuggs, + + # optional-dependencies ipython, matplotlib, - numpy, - packaging, - pytest-randomly, - setuptools, - shapely, - snuggs, - wheel, + boto3, - rasterio, # required to run version test + # tests + fsspec, + hypothesis, + packaging, + pytestCheckHook, + pytest-randomly, + shapely, + versionCheckHook, }: buildPythonPackage rec { pname = "rasterio"; version = "1.4.3"; - format = "pyproject"; - - disabled = pythonOlder "3.8"; + pyproject = true; src = fetchFromGitHub { owner = "rasterio"; @@ -50,15 +51,14 @@ buildPythonPackage rec { --replace-fail "cython~=3.0.2" cython ''; - nativeBuildInputs = [ + build-system = [ cython gdal numpy setuptools - wheel ]; - propagatedBuildInputs = [ + dependencies = [ affine attrs certifi @@ -83,7 +83,9 @@ buildPythonPackage rec { pytestCheckHook pytest-randomly shapely + versionCheckHook ]; + versionCheckProgramArg = "--version"; preCheck = '' rm -r rasterio # prevent importing local rasterio @@ -107,18 +109,12 @@ buildPythonPackage rec { pythonImportsCheck = [ "rasterio" ]; - passthru.tests.version = testers.testVersion { - package = rasterio; - version = version; - command = "${rasterio}/bin/rio --version"; - }; - - meta = with lib; { + meta = { description = "Python package to read and write geospatial raster data"; mainProgram = "rio"; homepage = "https://rasterio.readthedocs.io/"; changelog = "https://github.com/rasterio/rasterio/blob/${version}/CHANGES.txt"; - license = licenses.bsd3; - teams = [ teams.geospatial ]; + license = lib.licenses.bsd3; + teams = [ lib.teams.geospatial ]; }; }