about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/cartopy
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-05-17 10:56:54 +0000
committerAlyssa Ross <hi@alyssa.is>2019-05-17 10:56:54 +0000
commitc1d22074139ab0d048a05b5e5116265d099114d6 (patch)
tree97977009422d675f8930f97c309b010481289e72 /nixpkgs/pkgs/development/python-modules/cartopy
parent4dc8afe4fd6b18437150129e0a1ecc23c6a1c0b9 (diff)
parentbc9df0f66110039e495b6debe3a6cda4a1bb0fed (diff)
downloadnixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.gz
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.bz2
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.lz
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.xz
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.zst
nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.zip
Merge commit 'bc9df0f66110039e495b6debe3a6cda4a1bb0fed'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/cartopy')
-rw-r--r--nixpkgs/pkgs/development/python-modules/cartopy/default.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/cartopy/default.nix b/nixpkgs/pkgs/development/python-modules/cartopy/default.nix
index 3fc4c3e84ed4..28148450f076 100644
--- a/nixpkgs/pkgs/development/python-modules/cartopy/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/cartopy/default.nix
@@ -1,8 +1,9 @@
 { buildPythonPackage, lib, fetchPypi
 , pytest, filelock, mock, pep8
-, cython, isPy37, glibcLocales
+, cython, isPy27, isPy37, glibcLocales
 , six, pyshp, shapely, geos, proj, numpy
 , gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
+, xvfb_run
 }:
 
 buildPythonPackage rec {
@@ -17,10 +18,14 @@ buildPythonPackage rec {
 
   checkInputs = [ filelock mock pytest pep8 ];
 
-  # several tests require network connectivity: we disable them
-  checkPhase = ''
+  # 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 ''
     export HOME=$(mktemp -d)
-    pytest --pyargs cartopy \
+    ${maybeXvfbRun} pytest --pyargs cartopy \
       -m "not network and not natural_earth" \
       -k "not test_nightshade_image"
   '';