Real python package #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: wheels | |
on: [push, pull_request] | |
jobs: | |
wheels: | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
platform: [ {os: "ubuntu-latest", target: "manylinux_x86_64", arch: "x86_64"}, | |
{os: "ubuntu-latest", target: "manylinux_aarch64", arch: "aarch64"}, | |
{os: "macos-14", target: "macosx_arm64", arch: "arm64"} ] | |
python: [ {cp: "cp311", py: "3.11"}, {cp: "cp312", py: "3.12"} ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Building wheel | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" | |
CIBW_ARCHS: "${{ matrix.platform.arch }}" | |
CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" | |
CIBW_BEFORE_BUILD_MACOS: "bash {project}/scripts/macos_dependencies.sh" | |
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" | |
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" | |
CIBW_TEST_COMMAND: pip install -r {project}/requirements.txt && pytest {package} | |
- uses: actions/setup-python@v5 | |
if: ${{ matrix.platform.arch != 'aarch64' }} | |
with: | |
python-version: ${{ matrix.python.py }} | |
- name: Installing the wheel | |
if: ${{ matrix.platform.arch != 'aarch64' }} | |
run: | | |
pip install --break-system-packages ./wheelhouse/*.whl | |
- name: Saving wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.platform.target }}-${{ matrix.python.cp }} | |
path: ./wheelhouse/*.whl |