-
Notifications
You must be signed in to change notification settings - Fork 59
feat: build wheels #416
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
Merged
Merged
feat: build wheels #416
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9925786
feat: build wheels
beckermr 6f3d8f6
fix: no more mambaforge
beckermr 5f8cdc5
fix: always build wheels for testing
beckermr aa10815
fix: only publish for release events
beckermr 61676ef
fix: add bzip2 for linux
beckermr e2659a9
fix: typo in github context name
beckermr 11c6a0a
fix: need single quotes for gha
beckermr 3d8abf7
fix: need to have bzip2 around now I guess?
beckermr 1e59136
fix: use bzip2 from conda
beckermr 8909c8c
prod: update setup-miniconda
beckermr 2d00f8c
fix: use yum instead for bzip2
beckermr 4ee8c05
prod: update gha versions and syntax
beckermr d8f5a00
fix: ubuntu uses apt :facepalm:
beckermr f0de506
fix: try this name
beckermr db0f3d8
fix: use correct bzip2 dev package for wheels just in case
beckermr 0151c02
Add concurrency group to wheel workflow
beckermr 955607d
feat: add dependabot
beckermr 31dcf40
fix: set python version in wheel build
beckermr 16a66d3
fix: spacing
beckermr d18597e
fix: add support for workflow dispatch
beckermr 6379942
test: add tests for wheels
beckermr 22417b8
test: add tests for other wheels
beckermr 42e1f52
fix: run tests for alpine
beckermr 34b0952
fix: test w/e version of python we have for musl
beckermr db9f140
debug: what is this
beckermr d0fa875
fix: use a venv
beckermr 441ff81
fix: buggy activation
beckermr 995befb
Update wheel.yml
beckermr cab9af6
feat: skip existing things
beckermr 7ef1142
Merge branch 'beckermr-patch-1' of https://github.com/esheldon/fitsio…
beckermr 76758cc
feat: add token secret for publishing
beckermr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
groups: | ||
github-actions: | ||
patterns: | ||
- '*' |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
# this is based on the wheel workflow in GalSim, but adapted to our needs | ||
name: build wheels and sdist | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: 'The git ref to build wheels for. This will trigger a pypi upload.' | ||
default: '' | ||
required: false | ||
type: string | ||
cibw_skip: | ||
description: 'Python versions to skip when building wheels.' | ||
default: 'cp36* cp37* pp* cp38*' | ||
required: false | ||
type: string | ||
pull_request: null | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
group: pypi | ||
cancel-in-progress: false | ||
|
||
env: | ||
PYVER: '3.11' | ||
beckermr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CIBW_SKIP_VAL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.cibw_skip || 'cp36* cp37* pp* cp38*' }} | ||
|
||
jobs: | ||
linux-manylinux: | ||
name: linux-manylinux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || '' }} | ||
|
||
- uses: actions/setup-python@v5 | ||
beckermr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
python-version: '${{ env.PYVER }}' | ||
|
||
- name: build wheels | ||
uses: pypa/cibuildwheel@v2.21.1 | ||
env: | ||
CIBW_BUILD: "*manylinux*" | ||
CIBW_ARCHS: auto64 | ||
CIBW_SKIP: ${{ env.CIBW_SKIP_VAL }} | ||
# I think yum might always work here. But leave all options available. | ||
CIBW_BEFORE_ALL: yum install -y bzip2-devel || apt-get install libbz2-dev || apk add --upgrade bzip2-dev | ||
esheldon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: test wheel for python ${{ env.PYVER }} | ||
run: | | ||
pystr='${{ env.PYVER }}' | ||
pystr=${pystr//./} | ||
python -m pip install pip | ||
pip install numpy pytest | ||
pip install ./wheelhouse/*cp${pystr}*.whl | ||
pytest --pyargs fitsio | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: whl-linux | ||
path: ./wheelhouse/*.whl | ||
|
||
linux-musl: | ||
name: linux-musl | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
beckermr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
python-version: '${{ env.PYVER }}' | ||
|
||
- name: build wheels | ||
uses: pypa/cibuildwheel@v2.21.1 | ||
env: | ||
CIBW_BUILD: "*musllinux*" | ||
CIBW_ARCHS: auto64 | ||
CIBW_SKIP: ${{ env.CIBW_SKIP_VAL }} | ||
# I think musl always uses apk, but keep all options available. | ||
CIBW_BEFORE_ALL: yum install -y bzip2-devel || apt-get install libbz2-dev || apk add --upgrade bzip2-dev | ||
|
||
- uses: jirutka/setup-alpine@v1 | ||
with: | ||
packages: "bzip2-dev python3 py3-pip py3-numpy" | ||
|
||
- name: test wheel for python | ||
shell: alpine.sh {0} | ||
run: | | ||
python --version | ||
pystr=$(python --version | cut -d' ' -f 2 | cut -d'.' -f 1)$(python --version | cut -d' ' -f 2 | cut -d'.' -f 2) | ||
mkdir test-venv | ||
python3 -m venv test-venv | ||
. test-venv/bin/activate | ||
pip install numpy pytest | ||
pip install ./wheelhouse/*cp${pystr}*musl*.whl | ||
pytest --pyargs fitsio | ||
deactivate | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: whl-musl | ||
path: ./wheelhouse/*.whl | ||
|
||
osx-intel: | ||
name: osx-intel | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
beckermr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
python-version: '${{ env.PYVER }}' | ||
|
||
- name: build wheels | ||
uses: pypa/cibuildwheel@v2.21.1 | ||
env: | ||
CIBW_BUILD: "*macosx*" | ||
CIBW_ARCHS: auto64 | ||
CIBW_SKIP: ${{ env.CIBW_SKIP_VAL }} | ||
# CIBW_BEFORE_ALL: brew install fftw || true | ||
CIBW_ENVIRONMENT: >- | ||
MACOSX_DEPLOYMENT_TARGET=13.0 | ||
|
||
- name: test wheel for python ${{ env.PYVER }} | ||
run: | | ||
pystr='${{ env.PYVER }}' | ||
pystr=${pystr//./} | ||
python -m pip install pip | ||
pip install numpy pytest | ||
pip install ./wheelhouse/*cp${pystr}*.whl | ||
pytest --pyargs fitsio | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: whl-macos | ||
path: ./wheelhouse/*.whl | ||
|
||
osx-arm: | ||
name: osx-arm | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
beckermr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
python-version: '${{ env.PYVER }}' | ||
|
||
- name: build wheels | ||
uses: pypa/cibuildwheel@v2.21.1 | ||
env: | ||
CIBW_BUILD: "*macosx*" | ||
CIBW_ARCHS: arm64 | ||
CIBW_SKIP: ${{ env.CIBW_SKIP_VAL }} | ||
# CIBW_BEFORE_ALL: brew install llvm libomp fftw eigen | ||
CIBW_ENVIRONMENT: >- | ||
MACOSX_DEPLOYMENT_TARGET=14.7 | ||
|
||
- name: test wheel for python ${{ env.PYVER }} | ||
run: | | ||
pystr='${{ env.PYVER }}' | ||
pystr=${pystr//./} | ||
python -m pip install pip | ||
pip install numpy pytest | ||
pip install ./wheelhouse/*cp${pystr}*.whl | ||
pytest --pyargs fitsio | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: whl-arm | ||
path: ./wheelhouse/*.whl | ||
|
||
sdist: | ||
name: sdist | ||
needs: [linux-manylinux, linux-musl, osx-intel, osx-arm] | ||
# Just need to build sdist on a single machine | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
pip install -U numpy setuptools | ||
|
||
- name: download wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./wheels | ||
pattern: whl-* | ||
merge-multiple: true | ||
|
||
- name: build sdist | ||
run: | | ||
python setup.py sdist | ||
ls -l dist | ||
tar tvfz dist/*.tar.gz | ||
|
||
- name: copy wheels to dist | ||
run: | | ||
echo ls -l wheels | ||
ls -l wheels | ||
cp wheels/*.whl dist | ||
echo ls -l dist | ||
ls -l dist | ||
|
||
- name: publish to pypi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: github.event_name == 'release' || github.event.action == 'workflow_dispatch' | ||
with: | ||
verbose: true | ||
skip-existing: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.