Skip to content

Commit 2a53f92

Browse files
committed
CI: update wheel builds
Adds Linux ARM architecture. MacOS wheels are built without lz4 support because the libraries are not compatible with MacOS<14. Remove sparsehash which is not used anymore in osmium.
1 parent 2f1b27b commit 2a53f92

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

.github/workflows/build_wheels.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ on:
77

88
jobs:
99
build_wheels:
10-
name: Build wheels on ${{ matrix.os }}
10+
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
1111
runs-on: ${{ matrix.os }}
1212
strategy:
13+
fail-fast: false
1314
matrix:
14-
os: [ubuntu-20.04, windows-2019, macos-11, macos-14]
15+
os: [ubuntu-20.04, windows-2019, macos-13, macos-14]
16+
arch: [native]
17+
include:
18+
- os: ubuntu-20.04
19+
arch: aarch64
1520

1621
steps:
1722
- uses: actions/checkout@v4
@@ -34,22 +39,30 @@ jobs:
3439
ref: v2.20.0
3540
path: contrib/libosmium
3641

42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v3
44+
if: ${{ matrix.arch == 'aarch64' }}
45+
46+
- uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.8'
3749

3850
- name: Build wheels
39-
uses: pypa/cibuildwheel@v2.17.0
51+
uses: pypa/cibuildwheel@v2.21.1
4052
env:
41-
CIBW_ARCHS: native
42-
CIBW_SKIP: "pp* *musllinux* cp38-macosx_arm64"
53+
CIBW_ARCHS: ${{ matrix.arch }}
54+
CIBW_SKIP: "pp* *musllinux* cp37-macosx_* {cp37,cp38}-*linux_aarch64"
4355
CIBW_TEST_REQUIRES: pytest pytest-httpserver shapely
4456
CIBW_TEST_REQUIRES_LINUX: urllib3<2.0 pytest pytest-httpserver shapely
4557
CIBW_TEST_COMMAND: pytest {project}/test
4658
CIBW_BUILD_FRONTEND: build
47-
CIBW_BEFORE_BUILD_LINUX: yum install -y sparsehash-devel expat-devel boost-devel zlib-devel bzip2-devel lz4-devel
48-
CIBW_BEFORE_BUILD_MACOS: brew install boost google-sparsehash
59+
CIBW_BEFORE_BUILD_LINUX: yum install -y expat-devel boost-devel zlib-devel bzip2-devel lz4-devel
60+
CIBW_BEFORE_BUILD_MACOS: brew install boost
4961
CIBW_BEFORE_BUILD_WINDOWS: vcpkg install bzip2:x64-windows expat:x64-windows zlib:x64-windows boost-variant:x64-windows boost-iterator:x64-windows lz4:x86-windows
5062
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"'
63+
CIBW_ENVIRONMENT_MACOS: CMAKE_WITH_LZ4=OFF MACOSX_DEPLOYMENT_TARGET=11.0
5164

5265
- uses: actions/upload-artifact@v4
5366
with:
54-
name: pyosmium-wheels-${{ matrix.os }}
67+
name: pyosmium-wheels-${{ matrix.os }}-${{ matrix.arch }}
5568
path: ./wheelhouse/*.whl

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def build_extension(self, ext):
125125
if 'CMAKE_CXX_STANDARD' in env:
126126
cmake_args += ['-DCMAKE_CXX_STANDARD={}'.format(env['CMAKE_CXX_STANDARD'])]
127127

128+
cmake_args += [f"-DWITH_LZ4={env.get('CMAKE_WITH_LZ4', 'ON')}"]
129+
128130
if not os.path.exists(self.build_temp):
129131
os.makedirs(self.build_temp)
130132
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)

0 commit comments

Comments
 (0)