cibuildwheel

3.4.1 · active · verified Sun Apr 12

cibuildwheel simplifies the creation of Python wheels for various platforms and Python versions within Continuous Integration (CI) workflows. It builds manylinux, musllinux, macOS, and Windows wheels for CPython, PyPy, and GraalPy across multiple architectures. The library is actively maintained with frequent minor and patch releases, ensuring compatibility with the latest Python versions and CI environments.

Warnings

Install

Quickstart

This GitHub Actions workflow demonstrates how to build cross-platform Python wheels using cibuildwheel. It checks out the repository, sets up Python, installs cibuildwheel, builds wheels for various operating systems and architectures, and then uploads the generated wheel files as artifacts.

name: Build
on:
  [push, pull_request]

jobs:
  build_wheels:
    name: Build wheels on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]

    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false

      # Used to host cibuildwheel
      - uses: actions/setup-python@v6

      - name: Install cibuildwheel
        run: python -m pip install cibuildwheel==3.4.1

      - name: Build wheels
        run: python -m cibuildwheel --output-dir wheelhouse
        # to supply options, put them in 'env', like:
        # env:
        #   CIBW_SOME_OPTION: value

      - uses: actions/upload-artifact@v4
        with:
          name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
          path: ./wheelhouse/*.whl

view raw JSON →