Skip to content

Commit 56d4e34

Browse files
committed
install geos depending on OS
1 parent 35996b9 commit 56d4e34

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,29 @@ jobs:
4343
- name: Build wheels
4444
env:
4545
CIBW_SKIP: "pp* *-musllinux*" # Skip PyPy and musllinux
46-
# Linux setup
47-
CIBW_BEFORE_ALL_LINUX: >
48-
sudo apt-get update &&
49-
sudo apt-get install -y software-properties-common &&
50-
sudo add-apt-repository ppa:ubuntugis/ppa &&
51-
sudo apt-get update &&
52-
sudo apt-get install -y libgeos-dev
53-
# Windows setup
54-
CIBW_BEFORE_ALL_WINDOWS: >
55-
choco install geos
56-
# macOS setup
57-
CIBW_BEFORE_ALL_MACOS: >
58-
brew install geos
59-
60-
CIBW_BEFORE_BUILD: >
61-
pip install --upgrade pip &&
62-
pip install numpy>=1.21.4 cython>=0.29.21 &&
63-
python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)"
64-
CIBW_ENVIRONMENT: >
65-
GEOS_DIR=/project/packages/basemap/extern
66-
SETUPTOOLS_USE_DISTUTILS=stdlib
67-
CIBW_TEST_COMMAND: >
68-
cd {project} && python -m pytest --cov="mpl_toolkits.basemap"
69-
--cov-report=term --ignore=dist --ignore=build
70-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
46+
CIBW_BEFORE_ALL: >
47+
if [ "$runner_os" == "linux" ]; then
48+
sudo apt-get update &&
49+
sudo apt-get install -y software-properties-common &&
50+
sudo add-apt-repository ppa:ubuntugis/ppa &&
51+
sudo apt-get update &&
52+
sudo apt-get install -y libgeos-dev
53+
elif [ "$runner_os" == "windows" ]; then
54+
choco install geos
55+
elif [ "$runner_os" == "macos" ]; then
56+
brew install geos
57+
fi
58+
CIBW_BEFORE_BUILD: >
59+
pip install --upgrade pip &&
60+
pip install numpy>=1.21.4 cython>=0.29.21 &&
61+
python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)"
62+
CIBW_ENVIRONMENT: >
63+
GEOS_DIR=/project/packages/basemap/extern
64+
SETUPTOOLS_USE_DISTUTILS=stdlib
65+
CIBW_TEST_COMMAND: >
66+
cd {project} && python -m pytest --cov="mpl_toolkits.basemap"
67+
--cov-report=term --ignore=dist --ignore=build
68+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
7169
run: |
7270
cd ${{ env.PKGDIR }}
7371
python -m cibuildwheel --output-dir wheelhouse

0 commit comments

Comments
 (0)