Skip to content

Commit 82f8f14

Browse files
committed
Rebasing to clean up history. Nearly done.
1 parent 08f77e8 commit 82f8f14

File tree

1 file changed

+63
-22
lines changed

1 file changed

+63
-22
lines changed

.github/workflows/build.yml

Lines changed: 63 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ${{ matrix.os }}
2525
strategy:
2626
matrix:
27-
os: [ubuntu-20.04, windows-2019, macos-11]
27+
os: [ubuntu-latest, windows-2019, macos-11]
2828

2929
steps:
3030
- uses: actions/checkout@v4
@@ -45,19 +45,10 @@ jobs:
4545
sudo apt-get update
4646
sudo apt-get install -y build-essential
4747
48-
- name: Setup C++ toolchain (Windows)
49-
if: runner.os == 'Windows'
50-
uses: microsoft/[email protected]
51-
5248
- name: Setup Visual Studio Developer Command Prompt
5349
if: runner.os == 'Windows'
5450
uses: ilammy/msvc-dev-cmd@v1
5551

56-
- name: Install Windows development tools
57-
if: runner.os == 'Windows'
58-
run: |
59-
choco install visualstudio2019buildtools visualstudio2019-workload-vctools cmake
60-
6152
- name: Setup C++ toolchain (macOS)
6253
if: runner.os == 'macOS'
6354
run: |
@@ -66,21 +57,71 @@ jobs:
6657
- name: Install cibuildwheel
6758
run: python -m pip install cibuildwheel==2.16.2
6859

60+
- name: Set GEO src directory
61+
shell: bash
62+
run: |
63+
if [ "$RUNNER_OS" == "Windows" ]; then
64+
echo "GEO_DIR=D:/a/basemap/basemap/geo" >> $GITHUB_ENV
65+
else
66+
echo "GEO_DIR=/project/geo" >> $GITHUB_ENV
67+
fi
68+
6969
- name: Build wheels
7070
env:
71-
CIBW_SKIP: "pp* *-musllinux*"
71+
CIBW_BUILD: "cp{39,310,311,312}-{manylinux_x86_64,win_amd64,macosx_x86_64}"
72+
CIBW_SKIP: "*-manylinux_i686 *-musllinux* pp*"
7273
CIBW_BEFORE_BUILD: >
73-
python -c "import utils; utils.GeosLibrary('${{ env.GEO_VERSION }}').build('extern', njobs=16)"
74-
CIBW_ENVIRONMENT: >
75-
GEOS_DIR=${{ github.workspace }}${{ runner.os == 'Windows' && '\\extern' || '/extern' }}
76-
CFLAGS=-I${{ github.workspace }}${{ runner.os == 'Windows' && '\\extern\\include' || '/extern/include' }}
77-
LDFLAGS=-L${{ github.workspace }}${{ runner.os == 'Windows' && '\\extern\\lib' || '/extern/lib' }}
78-
CIBW_TEST_COMMAND: >
79-
cd {project}
80-
pip install pytest
81-
python -m pytest --cov="mpl_toolkits.basemap"
82-
--cov-report=term --ignore=dist --ignore=build
83-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
74+
python -c "import utils; utils.GeosLibrary('${{ env.GEO_VERSION }}').build('${{ env.GEO_DIR}}', njobs=16)"
75+
76+
CIBW_ENVIRONMENT_WINDOWS: |
77+
GEOS_DIR=${{ env.GEO_DIR }}
78+
INCLUDE=${{ env.GEO_DIR }}/include;%%INCLUDE%%
79+
LIB=${{ env.GEO_DIR }}/lib;%%LIB%%
80+
PATH=${{ env.GEO_DIR }}/bin;%%PATH%%
81+
82+
CIBW_ENVIRONMENT_LINUX: |
83+
GEOS_DIR=${{ env.GEO_DIR }}
84+
CFLAGS="-I${{ env.GEO_DIR }}/include"
85+
LDFLAGS="-L${{ env.GEO_DIR }}/lib"
86+
LD_LIBRARY_PATH="${{ env.GEO_DIR }}/lib:$LD_LIBRARY_PATH"
87+
88+
CIBW_ENVIRONMENT_MACOS: |
89+
GEOS_DIR=${{ env.GEO_DIR }}
90+
CFLAGS=-I${{ env.GEO_DIR }}/include
91+
LDFLAGS=-L${{ env.GEO_DIR }}/lib
92+
DYLD_LIBRARY_PATH=${{ env.GEO_DIR }}/lib:$DYLD_LIBRARY_PATH
93+
94+
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >-
95+
mkdir -p {dest_dir}/.libs &&
96+
cp ${{ env.GEO_DIR }}/lib/libgeos*.so* {dest_dir}/.libs/ &&
97+
auditwheel repair
98+
--lib-sdir .libs
99+
-w {dest_dir}
100+
{wheel}
101+
102+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
103+
mkdir "{dest_dir}\libs" &&
104+
copy "%GEO_DIR%\bin\geos*.dll" "{dest_dir}\libs\" &&
105+
copy "{wheel}" "{dest_dir}\" &&
106+
dir /s /b "{dest_dir}\libs"
107+
108+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >-
109+
mkdir -p {dest_dir}/.libs &&
110+
cp ${{ env.GEO_DIR }}/lib/libgeos*.dylib {dest_dir}/.libs/ &&
111+
delocate-wheel -w {dest_dir} -v {wheel}
112+
113+
CIBW_TEST_COMMAND_WINDOWS: >-
114+
pip install pytest pytest-cov &&
115+
echo "Project path: {project}" &&
116+
dir /s /b "{project}" &&
117+
dir /s /b "{project}\packages\basemap" &&
118+
python -m pytest "{project}\packages\basemap\test" --cov="mpl_toolkits.basemap" --cov-report=term --ignore=dist --ignore=build
119+
120+
CIBW_TEST_COMMAND: >-
121+
cd {project} &&
122+
pip install pytest pytest-cov &&
123+
python -m pytest --cov="mpl_toolkits.basemap" --cov-report=term --ignore=dist --ignore=build
124+
84125
run: |
85126
cd ${{ env.PKGDIR }}
86127
python -m cibuildwheel --output-dir wheelhouse

0 commit comments

Comments
 (0)