Skip to content

Commit 6ff0906

Browse files
committed
Update CI settings to build multiple wheels
We can no longer just build for the CPython 3.8 limited ABI, since pyo3 only supports buffer objects in the limited ABI from Python 3.11. So use non-ABI3 wheels for Python 3.8-3.10.
1 parent ad6c01b commit 6ff0906

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
fail-fast: false
9494
matrix:
9595
arch: [x86_64, aarch64]
96-
python: [cp38] # Using limited ABI, so newer versions are not required
96+
python: [cp38, cp39, cp310, cp311] # From 3.11 we can use the limited ABI
9797
# Set os based on arch
9898
include:
9999
- arch: x86_64
@@ -124,7 +124,7 @@ jobs:
124124
fail-fast: false
125125
matrix:
126126
arch: [x86_64, arm64]
127-
python: [cp38] # Using limited ABI, so newer versions are not required
127+
python: [cp38, cp39, cp310, cp311] # From 3.11 we can use the limited ABI
128128
runs-on: macos-14
129129
steps:
130130
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,21 @@ testpaths = "python/tests"
7070
[tool.cibuildwheel]
7171
build-frontend = "build"
7272
test-command = "pip install -r {project}/requirements.txt && pytest -v -ra {project}"
73-
[tool.cibuildwheel.config-settings]
74-
"--build-option" = "--py-limited-api=cp38"
7573
[tool.cibuildwheel.linux]
7674
environment = "PATH=$HOME/.cargo/bin:$PATH"
7775
environment-pass = ["RUST_VERSION"]
7876
archs = ["aarch64", "x86_64"]
7977
before-all = ".ci/before_all_linux.sh"
80-
repair-wheel-command = [
78+
# Pyo3 only supports buffer objects with the limited ABI from Python 3.11. So
79+
# we need to handle that differently to older Pythons.
80+
[[tool.cibuildwheel.overrides]]
81+
select = "cp311-*"
82+
config-settings = { "--build-option" = "--py-limited-api=cp11" }
83+
linux.repair-wheel-command = [
8184
"auditwheel repair -w {dest_dir} {wheel}",
8285
"pipx run abi3audit --strict --report {wheel}",
8386
]
84-
[tool.cibuildwheel.macos]
85-
repair-wheel-command = [
87+
macos.repair-wheel-command = [
8688
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
8789
"pipx run abi3audit --strict --report {wheel}",
8890
]

0 commit comments

Comments
 (0)