-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix numpy ABI compatible and Use CIBuildWheel and github action to bu…
…ild python wheels automatically (#67) * use oldest-supported-numpy; adjust cypthon install requirement setup * add cibuildwheel in github action * change the numpy range to 1.14.5, according to the oldest_support_numpy https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg\#L54 * change numpy version in setup.py * test override numpy version for python 3.7 * update matrix os variables * remove unnecessary setup requirement in setup.py * fix typo? * add 3.6 * workaround for error in windows os: CCompiler_spawn() got an unexpected keyword argument https://github.com/pypa/distutils/issues/15\#issuecomment-685029840 * skip pypy 3.7 macos, due to error would build wheel with unsupported tag pp37 pypy37_pp73 macosx_10_9_x86_64 * add pytest after build * add pytest folder * add CIBW archs * indicate tests folder explicitly * fix test in CIBW * skip pypy37 for mac linux and window * also skip other pypy for mac linux and window * skip all pypy for mac linux and window * test cibuildwheel 2.6.1, since 2.7 gives standard_init_linux.go:228: exec user process caused: exec format error * try use python -m to see if can workaroudn the aarch64 error * use different pytest command * skip linux aarch64 * change version name to 0.3.2rc3 * fix musllinux No lapack/blas resources found * skip musllinux * add pypi into release destination * update version and update release strategy * update version and readme Co-authored-by: Zhe Sun <info@sun-analytics.nl> Co-authored-by: Stephane Collot <stephane.collot@ing.com>
- Loading branch information
1 parent
09d1ec8
commit a6f8d06
Showing
6 changed files
with
122 additions
and
15 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,98 @@ | ||
name: Build Python wheels and publish | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# run pipeline on push event of main or release branch | ||
push: | ||
branches: | ||
- 'test/**' | ||
- 'release/**' | ||
# run pipeline on pull request | ||
pull_request: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test-python: | ||
strategy: | ||
matrix: | ||
platform: [linux, macos, windows] | ||
include: | ||
- platform: linux | ||
os: ubuntu-latest | ||
# Here we skip aarch64, since we got error | ||
# ` standard_init_linux.go:228: exec user process caused: exec format error` | ||
# and we don't know how to fix it | ||
archs: "x86_64" | ||
- platform: macos | ||
os: macos-latest | ||
archs: "x86_64 arm64" | ||
- platform: windows | ||
os: windows-latest | ||
archs: AMD64 | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
CIBW_ENVIRONMENT_WINDOWS: SETUPTOOLS_USE_DISTUTILS=stdlib | ||
CIBW_SKIP: "pp3* *-musllinux_*" | ||
CIBW_ARCHS: ${{ matrix.archs }} | ||
CIBW_TEST_REQUIRES: pytest pandas | ||
CIBW_TEST_COMMAND: pytest -ra --capture=no --showlocals {package}/tests | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@2.6.1 | ||
|
||
- name: Keep wheel files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheelhouse | ||
path: ./wheelhouse/*.whl | ||
|
||
|
||
publish-wheels: | ||
needs: build-and-test-python | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: x64 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheelhouse | ||
path: wheelhouse | ||
|
||
- name: List assets | ||
run: | | ||
ls ./wheelhouse/*.whl -al | ||
- name: Upload wheels to test PyPI | ||
if: (github.event_name == 'push') || (github.event_name == 'workflow_dispatch') | ||
run: | | ||
pip install twine | ||
echo "Publish to Test PyPI..." | ||
twine upload --verbose --repository testpypi wheelhouse/* | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_TEST_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASS }} | ||
|
||
- name: Upload wheels to official PyPI | ||
if: contains(github.ref, 'release') && ((github.event_name == 'push') || (github.event_name == 'workflow_dispatch')) | ||
run: | | ||
pip install twine | ||
echo "Publish to PyPI..." | ||
twine upload --verbose wheelhouse/* | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
"wheel", | ||
"cython", | ||
"oldest-supported-numpy" | ||
] | ||
build-backend = "setuptools.build_meta" |
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,4 +1,4 @@ | ||
numpy>=1.16.6 | ||
numpy>=1.14.5 | ||
setuptools>=45.2.0 | ||
Cython>=0.29.15 | ||
scipy>=1.4.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