summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2020-05-06 20:44:55 -0500
committerGitHub <noreply@github.com>2020-05-06 20:44:55 -0500
commit18e1e2424fb10cb13bcbd2b2d1d986700912e35c (patch)
treede90378ed60664bb975319eb2d8e51e223ae5367
parent2139c8e53ebde69095b643302291a35c4474515c (diff)
downloadspack-18e1e2424fb10cb13bcbd2b2d1d986700912e35c.tar.gz
spack-18e1e2424fb10cb13bcbd2b2d1d986700912e35c.tar.bz2
spack-18e1e2424fb10cb13bcbd2b2d1d986700912e35c.tar.xz
spack-18e1e2424fb10cb13bcbd2b2d1d986700912e35c.zip
py-shapely: fix unit tests (#16500)
-rw-r--r--var/spack/repos/builtin/packages/py-shapely/package.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/py-shapely/package.py b/var/spack/repos/builtin/packages/py-shapely/package.py
index a6b2e8ceee..a25e4d214f 100644
--- a/var/spack/repos/builtin/packages/py-shapely/package.py
+++ b/var/spack/repos/builtin/packages/py-shapely/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
+import sys
class PyShapely(PythonPackage):
@@ -38,7 +39,8 @@ class PyShapely(PythonPackage):
# https://github.com/Toblerity/Shapely/pull/891
patch('https://github.com/Toblerity/Shapely/commit/98f6b36710bbe05b4ab59231cb0e08b06fe8b69c.patch',
- sha256='4984cd0590beb5091f213948a953f70cea08ea11c5db1de07ba98c19e3d13f06')
+ sha256='4984cd0590beb5091f213948a953f70cea08ea11c5db1de07ba98c19e3d13f06',
+ when='@:1.7')
@when('^python@3.7:')
def patch(self):
@@ -53,7 +55,14 @@ class PyShapely(PythonPackage):
env.set('GEOS_CONFIG',
join_path(self.spec['geos'].prefix.bin, 'geos-config'))
+ # Shapely uses ctypes.util.find_library, which searches LD_LIBRARY_PATH
+ # Our RPATH logic works fine, but the unit tests fail without this
+ # https://github.com/Toblerity/Shapely/issues/909
+ libs = ':'.join(self.spec['geos'].libs.directories)
+ if sys.platform == 'darwin':
+ env.prepend_path('DYLD_FALLBACK_LIBRARY_PATH', libs)
+ else:
+ env.prepend_path('LD_LIBRARY_PATH', libs)
+
def test(self):
- # Tests fail when 'geos' library not found in usual search directories
- # python('-m', 'pytest')
- pass
+ python('-m', 'pytest')