Skip to content

Commit e88393c

Browse files
authoredSep 22, 2022
TST: Handle OSError on shapely import (#1152)
1 parent 2c0abe3 commit e88393c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
 

‎.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh
134134
CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh
135135
CIBW_TEST_REQUIRES: cython pytest oldest-supported-numpy pandas xarray
136-
CIBW_BEFORE_TEST: python -m pip install shapely~=1.7.1 || echo "Shapely install failed"
136+
CIBW_BEFORE_TEST: python -m pip install shapely || echo "Shapely install failed"
137137
CIBW_TEST_COMMAND: >
138138
pyproj -v &&
139139
python -c "import pyproj; pyproj.Proj(init='epsg:4269')" &&

‎requirements-test.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ pytest>3.6
33
pytest-cov
44
numpy
55
pandas
6-
shapely; python_version < '3.11'
6+
shapely
77
xarray

‎test/test_doctest_wrapper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def test_doctests():
2626
failure_count = failure_count_proj + failure_count_crs + failure_count_geod
2727
expected_failure_count = 0
2828
try:
29-
import shapely # noqa: F401 pylint: disable=unused-import
30-
except ImportError:
29+
import shapely.geometry # noqa: F401 pylint: disable=unused-import
30+
except (ImportError, OSError):
3131
# missing shapely
3232
expected_failure_count = 6
3333

‎test/test_geod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from shapely.geometry.polygon import orient
2828

2929
SHAPELY_LOADED = True
30-
except ImportError:
30+
except (ImportError, OSError):
3131
SHAPELY_LOADED = False
3232

3333

0 commit comments

Comments
 (0)
Please sign in to comment.