-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add cibuildwheel to build wheels (#1267)
* update environment to include cibuildwheel * add cibuildwheel workflow * add check for history * fix spacing in wheels workflow * add setuptools_scm * add pytest command * remove requires manifest * change odd xarray requirements * add path to tests * use cibuildwheel example verbatim * add pip install netcdf4 * Update .github/workflows/wheels.yml Co-authored-by: Clément Robert <[email protected]> * Update .github/workflows/wheels.yml Co-authored-by: Clément Robert <[email protected]> * Update .github/workflows/wheels.yml Co-authored-by: Clément Robert <[email protected]> * update build systems * Add additional flags * Only use 3.8 to 3.10 wheels * Add pip only binary flag * Remove duplicated statement * MNT: Test 64 for windows build, not definite. Co-authored-by: Clément Robert <[email protected]> Co-authored-by: zssherman <[email protected]>
- Loading branch information
1 parent
bd5e65e
commit 082efd6
Showing
4 changed files
with
103 additions
and
99 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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,101 @@ | ||
name: Build CI Wheels | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/wheels.yml' | ||
workflow_dispatch: | ||
|
||
env: | ||
CIBW_TEST_REQUIRES: pytest | ||
CIBW_TEST_COMMAND: "pytest {project}/tests" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ | ||
ubuntu-20.04, | ||
windows-2019, | ||
macos-11, | ||
] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch all history for all tags and branches | ||
run: | | ||
git fetch --prune --unshallow | ||
- name: Build wheels for CPython | ||
uses: pypa/[email protected] | ||
with: | ||
output-dir: dist | ||
env: | ||
CIBW_BUILD: "cp38-* cp39-* cp310-*" | ||
CIBW_SKIP: "*-musllinux_*" # numpy doesn't have wheels for musllinux so we can't build some quickly and without bloating | ||
CIBW_ARCHS_LINUX: "x86_64" | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
MACOSX_DEPLOYMENT_TARGET: "10.9" # as of CIBW 2.9, this is the default value, pin it so it can't be bumped silently | ||
CIBW_ARCHS_WINDOWS: "auto64" | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_ENVIRONMENT: PIP_ONLY_BINARY=":all:" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: ./dist/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sdist | ||
path: dist/*.tar.gz | ||
|
||
deploy: | ||
name: Publish to PyPI | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
# upload to PyPI on every tag starting with 'v-' | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
steps: | ||
- name: Download sdist | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: sdist | ||
path: dist | ||
|
||
- name: Download wheels | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} |
This file contains 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 |
---|---|---|
|
@@ -24,5 +24,6 @@ dependencies: | |
- shapely<1.8.3 | ||
- pip | ||
- pip: | ||
- cibuildwheel | ||
- pooch | ||
- versioneer |
This file contains 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 |
---|---|---|
|
@@ -7,4 +7,4 @@ cftime | |
Cython | ||
fsspec | ||
s3fs | ||
xarray>=0.21.1 | ||
xarray!=0.21.0 |