Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, cython
6, setuptools-scm
7, geos
8, proj
9, matplotlib
10, numpy
11, pyproj
12, pyshp
13, shapely
14, owslib
15, pillow
16, gdal
17, scipy
18, fontconfig
19, pytest-mpl
20, pytestCheckHook
21}:
22
23buildPythonPackage rec {
24 pname = "cartopy";
25 version = "0.21.1";
26
27 disabled = pythonOlder "3.8";
28
29 format = "setuptools";
30
31 src = fetchPypi {
32 inherit version;
33 pname = "Cartopy";
34 hash = "sha256-idVklxLIWCIxxuEYJaBMhfbwzulNu4nk2yPqvKHMJQo=";
35 };
36
37 nativeBuildInputs = [
38 cython
39 geos # for geos-config
40 proj
41 setuptools-scm
42 ];
43
44 buildInputs = [
45 geos proj
46 ];
47
48 propagatedBuildInputs = [
49 matplotlib
50 numpy
51 pyproj
52 pyshp
53 shapely
54 ];
55
56 passthru.optional-dependencies = {
57 ows = [ owslib pillow ];
58 plotting = [ gdal pillow scipy ];
59 };
60
61 checkInputs = [
62 pytest-mpl
63 pytestCheckHook
64 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
65
66 preCheck = ''
67 export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
68 export HOME=$TMPDIR
69 '';
70
71 pytestFlagsArray = [
72 "--pyargs" "cartopy"
73 "-m" "'not network and not natural_earth'"
74 ];
75
76 disabledTests = [
77 "test_gridliner_labels_bbox_style"
78 ];
79
80 meta = with lib; {
81 description = "Process geospatial data to create maps and perform analyses";
82 license = licenses.lgpl3Plus;
83 homepage = "https://scitools.org.uk/cartopy/docs/latest/";
84 maintainers = with maintainers; [ mredaelli ];
85 };
86}