Skip to content

Commit

Permalink
TST: Handle OSError on shapely import (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Sep 22, 2022
1 parent 2c0abe3 commit e88393c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Expand Up @@ -133,7 +133,7 @@ jobs:
CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh
CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh
CIBW_TEST_REQUIRES: cython pytest oldest-supported-numpy pandas xarray
CIBW_BEFORE_TEST: python -m pip install shapely~=1.7.1 || echo "Shapely install failed"
CIBW_BEFORE_TEST: python -m pip install shapely || echo "Shapely install failed"
CIBW_TEST_COMMAND: >
pyproj -v &&
python -c "import pyproj; pyproj.Proj(init='epsg:4269')" &&
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Expand Up @@ -3,5 +3,5 @@ pytest>3.6
pytest-cov
numpy
pandas
shapely; python_version < '3.11'
shapely
xarray
4 changes: 2 additions & 2 deletions test/test_doctest_wrapper.py
Expand Up @@ -26,8 +26,8 @@ def test_doctests():
failure_count = failure_count_proj + failure_count_crs + failure_count_geod
expected_failure_count = 0
try:
import shapely # noqa: F401 pylint: disable=unused-import
except ImportError:
import shapely.geometry # noqa: F401 pylint: disable=unused-import
except (ImportError, OSError):
# missing shapely
expected_failure_count = 6

Expand Down
2 changes: 1 addition & 1 deletion test/test_geod.py
Expand Up @@ -27,7 +27,7 @@
from shapely.geometry.polygon import orient

SHAPELY_LOADED = True
except ImportError:
except (ImportError, OSError):
SHAPELY_LOADED = False


Expand Down

0 comments on commit e88393c

Please sign in to comment.