2022-04-15 01:41:22 +00:00
|
|
|
{ lib
|
2022-06-16 17:23:12 +00:00
|
|
|
, stdenv
|
2022-04-15 01:41:22 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# build time
|
|
|
|
, cython
|
|
|
|
, gdal
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, affine
|
|
|
|
, attrs
|
|
|
|
, boto3
|
|
|
|
, click
|
|
|
|
, click-plugins
|
|
|
|
, cligj
|
|
|
|
, matplotlib
|
|
|
|
, numpy
|
|
|
|
, snuggs
|
2022-06-16 17:23:12 +00:00
|
|
|
, setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, hypothesis
|
|
|
|
, packaging
|
|
|
|
, pytest-randomly
|
|
|
|
, pytestCheckHook
|
|
|
|
, shapely
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rasterio";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "4"; # not x.y[ab]z, those are alpha/beta versions
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2022-03-30 09:31:56 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Pypi doesn't ship the tests, so we fetch directly from GitHub
|
|
|
|
src = fetchFromGitHub {
|
2022-04-15 01:41:22 +00:00
|
|
|
owner = "rasterio";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "rasterio";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/release-test-${version}";
|
|
|
|
hash = "sha256-YO0FnmIEt+88f6k2mdXDSQg7UKq1Swr8wqVUGdRyQR4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
gdal
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
affine
|
|
|
|
attrs
|
|
|
|
boto3
|
|
|
|
click
|
|
|
|
click-plugins
|
|
|
|
cligj
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
snuggs
|
2022-06-16 17:23:12 +00:00
|
|
|
setuptools # needs pkg_resources at runtime
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
rm -rf rasterio
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-randomly
|
|
|
|
pytestCheckHook
|
|
|
|
packaging
|
|
|
|
hypothesis
|
|
|
|
shapely
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/rio --version | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python package to read and write geospatial raster data";
|
|
|
|
homepage = "https://rasterio.readthedocs.io/en/latest/";
|
2022-04-15 01:41:22 +00:00
|
|
|
license = licenses.bsd3;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ mredaelli ];
|
|
|
|
};
|
|
|
|
}
|