Skip to content

Commit 804efe9

Browse files
committed
chore(ci): build wheels with cibuildwheel
1 parent c99efaf commit 804efe9

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,23 @@ jobs:
1717
platform:
1818
- runs-on: ubuntu-24.04
1919
arch: x86_64
20-
- runs-on: buildjet-2vcpu-ubuntu-2204-arm
21-
arch: arm64
22-
python-version:
23-
- "3.9"
24-
- "3.10"
25-
- "3.11"
26-
- "3.12"
27-
- "3.13"
20+
- runs-on: buildjet-8vcpu-ubuntu-2204-arm
21+
arch: aarch64
2822

2923
runs-on: ${{ matrix.platform.runs-on }}
3024
steps:
3125
- uses: actions/checkout@v4
32-
- uses: astral-sh/setup-uv@v4
33-
- uses: actions/setup-python@v2
34-
with:
35-
python-version: ${{ matrix.python-version }}
36-
37-
- name: Update APT cache # BuildJet doesn't cache APT well
38-
if: startsWith(matrix.platform.runs-on, 'buildjet-')
39-
run: sudo apt-get update
40-
41-
- name: Install valgrind
42-
run: sudo apt-get install valgrind -y
43-
44-
- name: Build the library
45-
run: uv build --wheel --out-dir dist/
26+
- name: Build wheels
27+
uses: pypa/[email protected]
4628
env:
47-
PYTEST_CODSPEED_FORCE_EXTENSION_BUILD: 1
29+
CIBW_ARCHS: ${{ matrix.platform.arch }}
30+
with:
31+
output-dir: wheelhouse
4832

4933
- uses: actions/upload-artifact@v4
5034
with:
51-
name: wheel-${{ matrix.python-version }}-${{ matrix.platform.arch }}
52-
path: dist/*.whl
35+
name: wheels-${{ matrix.platform.arch }}
36+
path: wheelhouse/*.whl
5337

5438
publish:
5539
needs: build-wheels

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ push = false
8181
'__semver_version__ = "{version}"',
8282
]
8383

84+
[tool.cibuildwheel]
85+
build = "cp*manylinux*"
86+
test-extras = ["build", "test", "compat"]
87+
test-command = "pytest -v --ignore={project}/tests/benchmarks {project}/tests"
88+
89+
[tool.cibuildwheel.linux]
90+
environment = { PYTEST_CODSPEED_FORCE_EXTENSION_BUILD = "1", PYTEST_CODSPEED_FORCE_VALGRIND_TESTS = "1" }
91+
archs = ["x86_64", "aarch64"]
92+
manylinux-x86_64-image = "manylinux_2_28"
93+
manylinux-aarch64-image = "manylinux_2_28"
94+
before-all = "yum -y install valgrind-devel || apk add --upgrad valgrind-dev"
95+
container-engine = { name = "docker", disable-host-mount = true }
8496

8597
[tool.mypy]
8698
python_version = "3.12"

0 commit comments

Comments
 (0)