1{ buildPythonPackage, lib, fetchPypi
2, pytest_4, filelock, mock, pep8
3, cython, isPy27
4, six, pyshp, shapely, geos, numpy
5, gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
6, xvfb_run
7, proj_5 # see https://github.com/SciTools/cartopy/pull/1252 for status on proj 6 support
8}:
9
10buildPythonPackage rec {
11 pname = "cartopy";
12 version = "0.18.0";
13
14 src = fetchPypi {
15 inherit version;
16 pname = "Cartopy";
17 sha256 = "0d24fk0cbp29gmkysrwq05vry13swmwi3vx3cpcy04c0ixz33ykz";
18 };
19
20 checkInputs = [ filelock mock pytest_4 pep8 ];
21
22 # several tests require network connectivity: we disable them.
23 # also py2.7's tk is over-eager in trying to open an x display,
24 # so give it xvfb
25 checkPhase = let
26 maybeXvfbRun = lib.optionalString isPy27 "${xvfb_run}/bin/xvfb-run";
27 in ''
28 export HOME=$(mktemp -d)
29 ${maybeXvfbRun} pytest --pyargs cartopy \
30 -m "not network and not natural_earth" \
31 -k "not test_nightshade_image and not background_img"
32 '';
33
34 nativeBuildInputs = [
35 cython
36 geos # for geos-config
37 proj_5
38 ];
39
40 buildInputs = [
41 geos proj_5
42 ];
43
44 propagatedBuildInputs = [
45 # required
46 six pyshp shapely numpy
47
48 # optional
49 gdal pillow matplotlib pyepsg pykdtree scipy fiona owslib
50 ];
51
52 meta = with lib; {
53 description = "Process geospatial data to create maps and perform analyses";
54 license = licenses.lgpl3;
55 homepage = "https://scitools.org.uk/cartopy/docs/latest/";
56 maintainers = with maintainers; [ mredaelli ];
57 };
58
59}