2022-04-15 01:41:22 +00:00
|
|
|
{ lib
|
2024-01-02 11:29:13 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-06-16 17:23:12 +00:00
|
|
|
, stdenv
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
, affine
|
|
|
|
, attrs
|
|
|
|
, boto3
|
2024-01-02 11:29:13 +00:00
|
|
|
, certifi
|
2022-04-15 01:41:22 +00:00
|
|
|
, click
|
|
|
|
, click-plugins
|
|
|
|
, cligj
|
2023-11-16 04:20:00 +00:00
|
|
|
, cython_3
|
2023-02-02 18:25:31 +00:00
|
|
|
, gdal
|
|
|
|
, hypothesis
|
|
|
|
, ipython
|
2024-01-02 11:29:13 +00:00
|
|
|
, matplotlib
|
2022-04-15 01:41:22 +00:00
|
|
|
, numpy
|
2023-10-09 19:29:22 +00:00
|
|
|
, oldest-supported-numpy
|
2022-04-15 01:41:22 +00:00
|
|
|
, packaging
|
|
|
|
, pytest-randomly
|
2023-02-02 18:25:31 +00:00
|
|
|
, setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
, shapely
|
2023-02-02 18:25:31 +00:00
|
|
|
, snuggs
|
2023-10-09 19:29:22 +00:00
|
|
|
, wheel
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rasterio";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "4";
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-04-15 01:41:22 +00:00
|
|
|
owner = "rasterio";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "rasterio";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/release-test-${version}";
|
|
|
|
hash = "sha256-YO0FnmIEt+88f6k2mdXDSQg7UKq1Swr8wqVUGdRyQR4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
nativeBuildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
cython_3
|
2022-04-15 01:41:22 +00:00
|
|
|
gdal
|
2023-10-09 19:29:22 +00:00
|
|
|
numpy
|
|
|
|
oldest-supported-numpy
|
|
|
|
setuptools
|
|
|
|
wheel
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
affine
|
|
|
|
attrs
|
2024-01-02 11:29:13 +00:00
|
|
|
certifi
|
2022-04-15 01:41:22 +00:00
|
|
|
click
|
|
|
|
click-plugins
|
|
|
|
cligj
|
|
|
|
numpy
|
2023-02-02 18:25:31 +00:00
|
|
|
setuptools
|
2024-01-02 11:29:13 +00:00
|
|
|
snuggs
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
ipython = [
|
|
|
|
ipython
|
|
|
|
];
|
|
|
|
plot = [
|
|
|
|
matplotlib
|
|
|
|
];
|
|
|
|
s3 = [
|
|
|
|
boto3
|
|
|
|
];
|
|
|
|
};
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-07-15 17:15:38 +00:00
|
|
|
boto3
|
2023-02-02 18:25:31 +00:00
|
|
|
hypothesis
|
|
|
|
packaging
|
2022-04-15 01:41:22 +00:00
|
|
|
pytestCheckHook
|
2024-01-02 11:29:13 +00:00
|
|
|
pytest-randomly
|
2022-04-15 01:41:22 +00:00
|
|
|
shapely
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
rm -r rasterio # prevent importing local rasterio
|
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-m 'not network'"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
"test_reproject_error_propagation"
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"rasterio"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python package to read and write geospatial raster data";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://rasterio.readthedocs.io/";
|
|
|
|
changelog = "https://github.com/rasterio/rasterio/blob/${version}/CHANGES.txt";
|
2022-04-15 01:41:22 +00:00
|
|
|
license = licenses.bsd3;
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = teams.geospatial.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|