2018-11-25 09:23:33 +00:00
|
|
|
{ buildPythonPackage, lib, fetchPypi
|
2019-10-07 22:30:48 +01:00
|
|
|
, pytest_4, filelock, mock, pep8
|
2019-06-16 20:59:06 +01:00
|
|
|
, cython, isPy27
|
2019-07-14 07:02:29 +01:00
|
|
|
, six, pyshp, shapely, geos, numpy
|
2018-11-25 09:23:33 +00:00
|
|
|
, gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
|
2019-05-04 23:16:06 +01:00
|
|
|
, xvfb_run
|
2019-07-14 07:02:29 +01:00
|
|
|
, proj_5 # see https://github.com/SciTools/cartopy/pull/1252 for status on proj 6 support
|
2018-11-25 09:23:33 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cartopy";
|
|
|
|
version = "0.17.0";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "Cartopy";
|
|
|
|
sha256 = "0q9ckfi37cxj7jwnqnzij62vwcf4krccx576vv5lhvpgvplxjjs2";
|
|
|
|
};
|
|
|
|
|
2019-10-07 22:30:48 +01:00
|
|
|
checkInputs = [ filelock mock pytest_4 pep8 ];
|
2018-11-25 09:23:33 +00:00
|
|
|
|
2019-05-04 23:16:06 +01:00
|
|
|
# several tests require network connectivity: we disable them.
|
|
|
|
# also py2.7's tk is over-eager in trying to open an x display,
|
|
|
|
# so give it xvfb
|
|
|
|
checkPhase = let
|
|
|
|
maybeXvfbRun = lib.optionalString isPy27 "${xvfb_run}/bin/xvfb-run";
|
|
|
|
in ''
|
2018-11-25 09:23:33 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2019-05-04 23:16:06 +01:00
|
|
|
${maybeXvfbRun} pytest --pyargs cartopy \
|
2018-11-25 09:23:33 +00:00
|
|
|
-m "not network and not natural_earth" \
|
2019-07-14 07:02:29 +01:00
|
|
|
-k "not test_nightshade_image and not background_img"
|
2018-11-25 09:23:33 +00:00
|
|
|
'';
|
|
|
|
|
2019-03-26 15:48:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
geos # for geos-config
|
2019-07-14 07:02:29 +01:00
|
|
|
proj_5
|
2019-03-26 15:48:57 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2019-07-14 07:02:29 +01:00
|
|
|
geos proj_5
|
2019-03-26 15:48:57 +00:00
|
|
|
];
|
2018-11-25 09:23:33 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
# required
|
2019-03-26 15:48:57 +00:00
|
|
|
six pyshp shapely numpy
|
2018-11-25 09:23:33 +00:00
|
|
|
|
|
|
|
# optional
|
|
|
|
gdal pillow matplotlib pyepsg pykdtree scipy fiona owslib
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Process geospatial data to create maps and perform analyses";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
homepage = https://scitools.org.uk/cartopy/docs/latest/;
|
|
|
|
maintainers = with maintainers; [ mredaelli ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|