py-shapely: fix unit tests (#16500)
This commit is contained in:
parent
2139c8e53e
commit
18e1e2424f
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
class PyShapely(PythonPackage):
|
class PyShapely(PythonPackage):
|
||||||
@ -38,7 +39,8 @@ class PyShapely(PythonPackage):
|
|||||||
|
|
||||||
# https://github.com/Toblerity/Shapely/pull/891
|
# https://github.com/Toblerity/Shapely/pull/891
|
||||||
patch('https://github.com/Toblerity/Shapely/commit/98f6b36710bbe05b4ab59231cb0e08b06fe8b69c.patch',
|
patch('https://github.com/Toblerity/Shapely/commit/98f6b36710bbe05b4ab59231cb0e08b06fe8b69c.patch',
|
||||||
sha256='4984cd0590beb5091f213948a953f70cea08ea11c5db1de07ba98c19e3d13f06')
|
sha256='4984cd0590beb5091f213948a953f70cea08ea11c5db1de07ba98c19e3d13f06',
|
||||||
|
when='@:1.7')
|
||||||
|
|
||||||
@when('^python@3.7:')
|
@when('^python@3.7:')
|
||||||
def patch(self):
|
def patch(self):
|
||||||
@ -53,7 +55,14 @@ def setup_build_environment(self, env):
|
|||||||
env.set('GEOS_CONFIG',
|
env.set('GEOS_CONFIG',
|
||||||
join_path(self.spec['geos'].prefix.bin, '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):
|
def test(self):
|
||||||
# Tests fail when 'geos' library not found in usual search directories
|
python('-m', 'pytest')
|
||||||
# python('-m', 'pytest')
|
|
||||||
pass
|
|
||||||
|
Loading…
Reference in New Issue
Block a user