Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, affine 4, attrs 5, boto3 6, buildPythonPackage 7, click 8, click-plugins 9, cligj 10, certifi 11, cython 12, fetchFromGitHub 13, gdal 14, hypothesis 15, matplotlib 16, ipython 17, numpy 18, packaging 19, pytest-randomly 20, pytestCheckHook 21, pythonOlder 22, setuptools 23, shapely 24, snuggs 25}: 26 27buildPythonPackage rec { 28 pname = "rasterio"; 29 version = "1.3.7"; 30 format = "pyproject"; 31 32 disabled = pythonOlder "3.8"; 33 34 src = fetchFromGitHub { 35 owner = "rasterio"; 36 repo = "rasterio"; 37 rev = "refs/tags/${version}"; 38 hash = "sha256-6AtGRXGuAXMrePqS2lmNdOuPZi6LHuiWP2LJyxH3L3M="; 39 }; 40 41 nativeBuildInputs = [ 42 cython 43 gdal 44 ]; 45 46 propagatedBuildInputs = [ 47 affine 48 attrs 49 click 50 click-plugins 51 cligj 52 certifi 53 numpy 54 snuggs 55 setuptools 56 ]; 57 58 passthru.optional-dependencies = { 59 ipython = [ 60 ipython 61 ]; 62 plot = [ 63 matplotlib 64 ]; 65 s3 = [ 66 boto3 67 ]; 68 }; 69 70 nativeCheckInputs = [ 71 hypothesis 72 packaging 73 pytest-randomly 74 pytestCheckHook 75 shapely 76 ]; 77 78 pytestFlagsArray = [ 79 "-m 'not network'" 80 ]; 81 82 disabledTests = lib.optionals stdenv.isDarwin [ 83 "test_reproject_error_propagation" 84 ]; 85 86 pythonImportsCheck = [ 87 "rasterio" 88 ]; 89 90 doInstallCheck = true; 91 92 installCheckPhase = '' 93 $out/bin/rio --show-versions | grep -E "rasterio:\s${version}" > /dev/null 94 $out/bin/rio --show-versions | grep -E "GDAL:\s[0-9]+(\.[0-9]+)*" > /dev/null 95 $out/bin/rio --show-versions | grep -E "PROJ:\s[0-9]+(\.[0-9]+)*" > /dev/null 96 $out/bin/rio --show-versions | grep -E "GEOS:\s[0-9]+(\.[0-9]+)*" > /dev/null 97 ''; 98 99 meta = with lib; { 100 description = "Python package to read and write geospatial raster data"; 101 homepage = "https://rasterio.readthedocs.io/"; 102 changelog = "https://github.com/rasterio/rasterio/blob/${version}/CHANGES.txt"; 103 license = licenses.bsd3; 104 maintainers = teams.geospatial.members; 105 }; 106}