depot/third_party/nixpkgs/pkgs/development/python-modules/rasterio/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

106 lines
1.9 KiB
Nix

{ lib
, stdenv
, affine
, attrs
, boto3
, buildPythonPackage
, click
, click-plugins
, cligj
, certifi
, cython
, fetchFromGitHub
, gdal
, hypothesis
, matplotlib
, ipython
, numpy
, packaging
, pytest-randomly
, pytestCheckHook
, pythonOlder
, setuptools
, shapely
, snuggs
}:
buildPythonPackage rec {
pname = "rasterio";
version = "1.3.7";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "rasterio";
repo = "rasterio";
rev = "refs/tags/${version}";
hash = "sha256-6AtGRXGuAXMrePqS2lmNdOuPZi6LHuiWP2LJyxH3L3M=";
};
nativeBuildInputs = [
cython
gdal
];
propagatedBuildInputs = [
affine
attrs
click
click-plugins
cligj
certifi
numpy
snuggs
setuptools
];
passthru.optional-dependencies = {
ipython = [
ipython
];
plot = [
matplotlib
];
s3 = [
boto3
];
};
nativeCheckInputs = [
hypothesis
packaging
pytest-randomly
pytestCheckHook
shapely
];
pytestFlagsArray = [
"-m 'not network'"
];
disabledTests = lib.optionals stdenv.isDarwin [
"test_reproject_error_propagation"
];
pythonImportsCheck = [
"rasterio"
];
doInstallCheck = true;
installCheckPhase = ''
$out/bin/rio --show-versions | grep -E "rasterio:\s${version}" > /dev/null
$out/bin/rio --show-versions | grep -E "GDAL:\s[0-9]+(\.[0-9]+)*" > /dev/null
$out/bin/rio --show-versions | grep -E "PROJ:\s[0-9]+(\.[0-9]+)*" > /dev/null
$out/bin/rio --show-versions | grep -E "GEOS:\s[0-9]+(\.[0-9]+)*" > /dev/null
'';
meta = with lib; {
description = "Python package to read and write geospatial raster data";
homepage = "https://rasterio.readthedocs.io/";
changelog = "https://github.com/rasterio/rasterio/blob/${version}/CHANGES.txt";
license = licenses.bsd3;
maintainers = teams.geospatial.members;
};
}