Skip to content

Commit

Permalink
chore(ci): build wheels with cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Dec 6, 2024
1 parent c99efaf commit 804efe9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,23 @@ jobs:
platform:
- runs-on: ubuntu-24.04
arch: x86_64
- runs-on: buildjet-2vcpu-ubuntu-2204-arm
arch: arm64
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- runs-on: buildjet-8vcpu-ubuntu-2204-arm
arch: aarch64

runs-on: ${{ matrix.platform.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Update APT cache # BuildJet doesn't cache APT well
if: startsWith(matrix.platform.runs-on, 'buildjet-')
run: sudo apt-get update

- name: Install valgrind
run: sudo apt-get install valgrind -y

- name: Build the library
run: uv build --wheel --out-dir dist/
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
PYTEST_CODSPEED_FORCE_EXTENSION_BUILD: 1
CIBW_ARCHS: ${{ matrix.platform.arch }}
with:
output-dir: wheelhouse

- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}-${{ matrix.platform.arch }}
path: dist/*.whl
name: wheels-${{ matrix.platform.arch }}
path: wheelhouse/*.whl

publish:
needs: build-wheels
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ push = false
'__semver_version__ = "{version}"',
]

[tool.cibuildwheel]
build = "cp*manylinux*"
test-extras = ["build", "test", "compat"]
test-command = "pytest -v --ignore={project}/tests/benchmarks {project}/tests"

[tool.cibuildwheel.linux]
environment = { PYTEST_CODSPEED_FORCE_EXTENSION_BUILD = "1", PYTEST_CODSPEED_FORCE_VALGRIND_TESTS = "1" }
archs = ["x86_64", "aarch64"]
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
before-all = "yum -y install valgrind-devel || apk add --upgrad valgrind-dev"
container-engine = { name = "docker", disable-host-mount = true }

[tool.mypy]
python_version = "3.12"
Expand Down

0 comments on commit 804efe9

Please sign in to comment.