Skip to content

Add prebuilt Packages #5

Add prebuilt Packages

Add prebuilt Packages #5

Workflow file for this run

name: Build Python Packages
on:
push:
branches: [ "main" ]
tags:
- v*
pull_request:
branches: [ "main" ]
jobs:
build-python-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]
arch: [auto64]
include:
- os: ubuntu-20.04
arch: aarch64
- os: macos-13
arch: arm64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: docker/setup-qemu-action@v3
if: ${{ matrix.arch == 'aarch64' }}
name: Set up QEMU
- name: Setup UV
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: python/wheelhouse
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: pp* *-musllinux_*
CIBW_BUILD_FRONTEND: "build[uv]"
- name: Upload Python wheels
uses: actions/upload-artifact@v4
with:
name: python-wheels-${{ runner.os }}-${{ matrix.arch }}
path: python/wheelhouse
# # We could test the Python wheels using cibuildwheel but we prefer to run the tests outside
# # the build environment to ensure wheels correctly embed all dependencies.
# test-python-wheels:
# needs: [build-python-wheels]
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-20.04, windows-2019]
# steps:
# - name: Set up Python 3.8
# uses: actions/setup-python@v5
# with:
# python-version: 3.8
# - uses: actions/checkout@v4
# - name: Prepare test environment
# shell: bash
# run: |
# ./python/tools/prepare_test_environment.sh
# - name: Download Python wheels
# uses: actions/download-artifact@v4
# with:
# pattern: python-wheels-${{ runner.os }}-*
# merge-multiple: true
# path: .
# - name: Install wheel
# if: startsWith(matrix.os, 'ubuntu')
# run: |
# pip install *cp38*manylinux*x86_64.whl
# - name: Install wheel
# if: startsWith(matrix.os, 'windows')
# shell: bash
# run: |
# pip install *cp38*win*.whl
# - name: Run tests
# shell: bash
# run: |
# pytest -v python/tests/
# check-python-style:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python 3.8
# uses: actions/setup-python@v5
# with:
# python-version: 3.8
# - name: Install dependencies
# run: |
# python -m pip install black==22.* flake8==3.8.* isort==5.*
# - name: Check code format with Black
# working-directory: python
# run: |
# black --check .
# - name: Check imports order with isort
# working-directory: python
# run: |
# isort --check-only .
# - name: Check code style with Flake8
# working-directory: python
# if: ${{ always() }}
# run: |
# flake8 .
# publish-python-wheels-on-pypi:
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# needs: [build-and-test-cpp-x86_64, build-python-wheels, test-python-wheels, check-python-style]
# runs-on: ubuntu-20.04
# steps:
# - name: Download Python wheels
# uses: actions/download-artifact@v4
# with:
# pattern: python-wheels-*
# merge-multiple: true
# path: .
# - name: Publish Python wheels to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages-dir: .