Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build wheels in CI #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

R2ZER0
Copy link

@R2ZER0 R2ZER0 commented Dec 8, 2021

We've found ourselves needing to install this package in a minimal container environment with no access to build tools like Cython or gcc, where the usual pip install -e ... isn't an option. So I've built pre-compiled binary wheels.

I figured others might have a similar use case, so if you're interested in building wheels too, this PR has the CI setup I used to build the wheels.

I based this off upstream yt's setup for building wheels: https://github.com/yt-project/yt/blob/main/.github/workflows/wheels.yaml
but simplified to remove the upstream/yt-specific stuff, and updated to use PyPa's recommended pre-built action: https://cibuildwheel.readthedocs.io/en/stable/setup/#github-actions

The result is using PyPa's cibuildwheel package and their integration with Github Actions (every open source repo/user has 2000 free Actions minutes per month).

Currently it's configured to build Python 3.7 through to 3.10, on Win32/64, Linux and macOS, but note that so far I've only tested the Linux wheels, and I don't have access to a Mac to test the macOS wheels.

The resulting wheels are pretty small, less than 1M each! Here's the output from today: https://github.com/R2ZER0/yt_georaster/actions/runs/1553724929

I'd be happy to make changes, e.g. if you'd prefer to use CircleCI as you already do (but note that apparantly CircleCI can't build Windows wheels: https://cibuildwheel.readthedocs.io/en/stable/#usage), or if you'd like to build wheels for extra branches, or only certain tags etc.

@R2ZER0 R2ZER0 force-pushed the build-wheels branch 2 times, most recently from b43b4cf to 81f6547 Compare December 16, 2021 17:38
Using pypa's cibuildwheel package and their integration with Github
Actions.

See: https://github.com/pypa/cibuildwheel#example-setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant