Skip to content

chore: ensure Github actions run tests in Python 3.10 and 3.11 #87

chore: ensure Github actions run tests in Python 3.10 and 3.11

chore: ensure Github actions run tests in Python 3.10 and 3.11 #87

Workflow file for this run

name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD: cp310-* cp311-* # build for Python 3.10 and Python 3.11
CIBW_BUILD_VERBOSITY: 1
# right now, cp310 isn't building properly on aarch64
CIBW_SKIP: cp36-* *-win32 *-manylinux_i686 pp* *musllinux* cp310-*_aarch64
CIBW_ARCHS_MACOS: x86_64 arm64 # arm64 for Apple Sillicon support
CIBW_ARCHS_LINUX: auto aarch64 # allowing arm processors
CIBW_REPAIR_WHEEL_COMMAND_MACOS: 'delocate-listdeps {wheel} && delocate-wheel --require-archs {delocate_archs} --ignore-missing-dependencies -w {dest_dir} {wheel}'
# not needed because those packages are already in package requirements
# CIBW_TEST_REQUIRES: pytest scikit-learn
CIBW_TEST_COMMAND: 'cd {package} && pytest -sv tests/test_tree.py && pytest -sv tests/test_wrappers.py'
strategy:
matrix:
# we will be able to include ubuntu-latest when we fix this issue
# https://github.com/bigmlcom/sensenet/issues/37
os: [macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# Upload to PyPI on every tag push
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}