Fixing pip install #217
Workflow file for this run
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
name: Build and upload to PyPI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
release: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
# List of platforms to build on (incl. Python version) | |
CIBW_BUILD: cp3{8,9,10,11}-manylinux_x86_64 cp3{8,9,10,11}-win_amd64 cp3{8,9,10,11}-macosx_x86_64 cp3{8,9,10,11}-macosx_arm64 | |
CIBW_BEFORE_BUILD: > | |
pip install numpy Cython scipy joblib | |
# Install test dependencies and run tests | |
CIBW_TEST_REQUIRES: pytest joblib | |
CIBW_TEST_COMMAND: > | |
pytest {project}/test | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
run: | | |
pip install numpy Cython scipy joblib | |
python setup.py sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: mint API token | |
id: mint | |
uses: tschm/[email protected] | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package distribution to PYPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ steps.mint.outputs.api-token }} |