Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
python3-rasterio: format with nixfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
imincik committed Jun 6, 2024
1 parent cfda621 commit e7461be
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 66 deletions.
85 changes: 37 additions & 48 deletions pkgs/rasterio/default.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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
Expand All @@ -73,15 +74,9 @@ buildPythonPackage rec {
];

passthru.optional-dependencies = {
ipython = [
ipython
];
plot = [
matplotlib
];
s3 = [
boto3
];
ipython = [ ipython ];
plot = [ matplotlib ];
s3 = [ boto3 ];
};

nativeCheckInputs = [
Expand All @@ -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;
Expand Down
30 changes: 15 additions & 15 deletions pkgs/rasterio/nixpkgs/cython.patch
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkgs/rasterio/nixpkgs/replace.patch
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 = [

0 comments on commit e7461be

Please sign in to comment.