fix: numpy 2.0 compatibility #49
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 | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.6, 3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U -r requirements_dev.txt | |
pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox | |
build_wheels: | |
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Ensure that a wheel builder finishes even if another fails | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
python: [36, 37, 38, 39] | |
bitness: [32, 64] | |
manylinux_image: [manylinux1, manylinux2010] | |
include: | |
# Run 32 and 64 bit version in parallel for Linux and Windows | |
- os: windows-latest | |
bitness: 64 | |
platform_id: win_amd64 | |
- os: windows-latest | |
bitness: 32 | |
platform_id: win32 | |
- os: ubuntu-latest | |
bitness: 64 | |
platform_id: manylinux_x86_64 | |
- os: ubuntu-latest | |
bitness: 32 | |
platform_id: manylinux_i686 | |
- os: macos-latest | |
bitness: 64 | |
platform_id: macosx_x86_64 | |
exclude: | |
- os: macos-latest | |
bitness: 32 | |
# Remove manylinux1 from the windows and osx build matrix since | |
# manylinux_image is not used for these platforms | |
- os: windows-latest | |
manylinux_image: manylinux1 | |
- os: macos-latest | |
manylinux_image: manylinux1 | |
steps: | |
- name: Checkout mt2 | |
uses: actions/checkout@v2 | |
# Used to host cibuildwheel | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==1.9.0 | |
- name: Build wheels | |
env: | |
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: "3.8" | |
- name: Install numpy (imported by setup.py) | |
run: python -m pip install numpy | |
- name: Build sdist | |
run: python setup.py sdist | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist, test] | |
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') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |