From e7461be2409dd38f6f947f9fbee57e85df04d111 Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Thu, 6 Jun 2024 16:36:32 +0200 Subject: [PATCH] python3-rasterio: format with nixfmt Nixpkgs PR: https://github.com/NixOS/nixpkgs/pull/313628 --- pkgs/rasterio/default.nix | 85 +++++++++++++---------------- pkgs/rasterio/nixpkgs/cython.patch | 30 +++++----- pkgs/rasterio/nixpkgs/replace.patch | 6 +- 3 files changed, 55 insertions(+), 66 deletions(-) diff --git a/pkgs/rasterio/default.nix b/pkgs/rasterio/default.nix index 150fe76..b03485e 100644 --- a/pkgs/rasterio/default.nix +++ b/pkgs/rasterio/default.nix @@ -1,32 +1,33 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, pytestCheckHook -, pythonOlder -, stdenv -, testers - -, affine -, attrs -, boto3 -, certifi -, click -, click-plugins -, cligj -, cython_3 -, gdal -, hypothesis -, ipython -, matplotlib -, numpy -, packaging -, pytest-randomly -, setuptools -, shapely -, snuggs -, wheel - -, rasterio # required to run version test +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + pythonOlder, + stdenv, + testers, + + affine, + attrs, + boto3, + certifi, + click, + click-plugins, + cligj, + cython_3, + gdal, + hypothesis, + ipython, + matplotlib, + numpy, + packaging, + pytest-randomly, + setuptools, + shapely, + snuggs, + wheel, + + rasterio, # required to run version test }: buildPythonPackage rec { @@ -51,7 +52,7 @@ buildPythonPackage rec { # relax dependency on yet non-packaged, RC version of numpy substituteInPlace pyproject.toml \ --replace "numpy==2.0.0rc1" "numpy" - ''; + ''; nativeBuildInputs = [ cython_3 @@ -73,15 +74,9 @@ buildPythonPackage rec { ]; passthru.optional-dependencies = { - ipython = [ - ipython - ]; - plot = [ - matplotlib - ]; - s3 = [ - boto3 - ]; + ipython = [ ipython ]; + plot = [ matplotlib ]; + s3 = [ boto3 ]; }; nativeCheckInputs = [ @@ -99,20 +94,14 @@ buildPythonPackage rec { rm -r rasterio # prevent importing local rasterio ''; - pytestFlagsArray = [ - "-m 'not network'" - ]; + pytestFlagsArray = [ "-m 'not network'" ]; disabledTests = [ # flaky "test_outer_boundless_pixel_fidelity" - ] ++ lib.optionals stdenv.isDarwin [ - "test_reproject_error_propagation" - ]; + ] ++ lib.optionals stdenv.isDarwin [ "test_reproject_error_propagation" ]; - pythonImportsCheck = [ - "rasterio" - ]; + pythonImportsCheck = [ "rasterio" ]; passthru.tests.version = testers.testVersion { package = rasterio; diff --git a/pkgs/rasterio/nixpkgs/cython.patch b/pkgs/rasterio/nixpkgs/cython.patch index f4ce2d9..d4378eb 100644 --- a/pkgs/rasterio/nixpkgs/cython.patch +++ b/pkgs/rasterio/nixpkgs/cython.patch @@ -1,18 +1,18 @@ -diff --git b/pkgs/rasterio/default.nix a/pkgs/rasterio/default.nix -index abf2de3..150fe76 100644 ---- b/pkgs/rasterio/default.nix -+++ a/pkgs/rasterio/default.nix -@@ -13,7 +13,7 @@ - , click - , click-plugins - , cligj --, cython -+, cython_3 - , gdal - , hypothesis - , ipython -@@ -54,7 +54,7 @@ buildPythonPackage rec { - ''; +diff --git a/pkgs/rasterio/default.nix b/pkgs/rasterio/default.nix +index 158394a..5143f3c 100644 +--- a/pkgs/rasterio/default.nix ++++ b/pkgs/rasterio/default.nix +@@ -14,7 +14,7 @@ + click, + click-plugins, + cligj, +- cython, ++ cython_3, + gdal, + hypothesis, + ipython, +@@ -55,7 +55,7 @@ buildPythonPackage rec { + ''; nativeBuildInputs = [ - cython diff --git a/pkgs/rasterio/nixpkgs/replace.patch b/pkgs/rasterio/nixpkgs/replace.patch index 9713407..fb5c643 100644 --- a/pkgs/rasterio/nixpkgs/replace.patch +++ b/pkgs/rasterio/nixpkgs/replace.patch @@ -1,8 +1,8 @@ diff --git a/pkgs/rasterio/default.nix b/pkgs/rasterio/default.nix -index 20eb3df..150fe76 100644 +index 158394a..26a729c 100644 --- a/pkgs/rasterio/default.nix +++ b/pkgs/rasterio/default.nix -@@ -46,11 +46,11 @@ buildPythonPackage rec { +@@ -47,11 +47,11 @@ buildPythonPackage rec { postPatch = '' # remove useless import statement requiring distutils to be present at the runtime substituteInPlace rasterio/rio/calc.py \ @@ -13,6 +13,6 @@ index 20eb3df..150fe76 100644 substituteInPlace pyproject.toml \ - --replace-fail "numpy==2.0.0rc1" "numpy" + --replace "numpy==2.0.0rc1" "numpy" - ''; + ''; nativeBuildInputs = [