-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build wheeel on CI using cibuildwheel and modernize metadata (#147)
* add build wheeel on CI and modernize metadata * add concurency groups * Allow only binary numpy and scipy * skip pp37, use prefer binary * skip only tests * uimprove workflow name * skip testing pypy * skip pp37 on macosx * skip pypy 3.7 in general * skip musllinux * skip pypy 3.10 * skip manylinux i686 * proper skip musllinux * remve pip verbosity * add comments with explanation
- Loading branch information
Showing
5 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
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
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,76 @@ | ||
name: Build wheel and sdist | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
branches: | ||
- main | ||
- master | ||
- build_wheel | ||
pull_request: | ||
|
||
concurrency: | ||
group: wheel-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
make_sdist: | ||
name: Make SDist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Optional, use if you use setuptools_scm | ||
submodules: true # Optional, use if you have submodules | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.17.0 | ||
# env: | ||
# CIBW_SOME_OPTION: value | ||
# ... | ||
# with: | ||
# package-dir: . | ||
# output-dir: wheelhouse | ||
# config-file: "{package}/pyproject.toml" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
|
||
upload_all: | ||
needs: [ build_wheels, make_sdist ] | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
wheelhouse | ||
dist/ | ||
build/ | ||
mahotas.egg-info/ | ||
|
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,11 @@ | ||
[build-system] | ||
requires = ["setuptools", "numpy"] | ||
# When build with numpy>=1.25 the resulted binary wheel is compatybile with numpy >=1.16 | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.cibuildwheel] | ||
test-command = "pytest --import-mode=importlib {project}/mahotas/tests" | ||
test-extras = ["tests"] | ||
test-skip = ["pp*", "cp31*-win32"] # there are no scipy weels for this version | ||
skip= ["pp37*", "pp310*", "*musllinux*", "*manylinux*i686"] # there are no numpy wheels for this version | ||
environment = { PIP_PREFER_BINARY="1"} |
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