Skip to content

Commit

Permalink
Make: Parallel wheels compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Feb 14, 2024
1 parent 6d8c586 commit 0f5a946
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 35 deletions.
46 changes: 13 additions & 33 deletions .github/workflows/prerelease-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,24 @@ permissions:
contents: read

jobs:
build_wheels_linux:
name: Build wheels (Linux)
runs-on: ubuntu-latest
build_wheels:
name: Build wheels ${{ matrix.os }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'workflow_dispatch'
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse

build_wheels_macos:
name: Build wheels (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse

build_wheels_windows:
name: Build wheels (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: ${{ matrix.python-version }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For some languages, it also provides lazily-evaluated ranges, to avoid memory al
- 🍎 __[Swift](#quick-start-swift-🍏):__ Use the `String+StringZilla` extension
- 🦀 __[Rust](#quick-start-rust-🦀):__ Use the `StringZilla` traits crate
- 📚 Researcher? Jump to [Algorithms & Design Decisions](#algorithms--design-decisions-📚)
- 🤝 Want to help? Jump to [Contributing](CONTRIBUTING.md)
- 🤝 Want to benchmark or contribute? Jump to [Contributing](CONTRIBUTING.md)
- Code in other languages? Let [me](https://github.com/ashvardanian) know!

__Who is this for?__
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# This file configures wheels compilation for `cibuilwheel` for StringZilla CPython bindings.
# On a good day it will produce:
# - `manylinux` and `musllinux` wheels for Linux on x86_64, aarch64, i686, ppc64le, s390x;
# - `macos` wheels for x86_64, arm64, and universal2;
# - `windows` wheels for AMD64, x86, and ARM64.
# * for Python versions from 3.6 to 3.12.
# * running over 5,000 tests on each wheel.
# = meaning 16 platforms * 7 Python versions = 112 builds.
# = meaning over 500,000 tests.
[build-system]
requires = ["setuptools>=42", "wheel", "cmake>=3.22", "numpy"]
build-backend = "setuptools.build_meta"
Expand Down Expand Up @@ -25,7 +34,7 @@ build-verbosity = 0
archs = ["all"]

# Skip PyPy builds... we are implementing a CPython binding after all :)
skip = ["pp*", "*manylinux*"]
skip = ["pp*"]

[tool.cibuildwheel.linux]
before-build = ["rm -rf {project}/build"]
Expand Down

0 comments on commit 0f5a946

Please sign in to comment.