Skip to content

fix: numpy 2.0 compatibility #59

fix: numpy 2.0 compatibility

fix: numpy 2.0 compatibility #59

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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 numpy>=2
run: tox
- name: Install numpy < 2
run: |
pip uninstall -y numpy
pip install 'numpy<2'
- name: Test with tox numpy<2
run: tox
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.arch }}
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: [38, 39, 310, 311, 312]
arch: [auto64]
build: ["cp"]
include:
# Run 32 and 64 bit version in parallel for Linux and Windows
- os: ubuntu-latest
arch: auto32
- os: ubuntu-latest
arch: auto32
steps:
- name: Checkout mt2
uses: actions/checkout@v4
# Used to host cibuildwheel
- name: Setup Python
uses: actions/setup-python@v5
- uses: pypa/[email protected]
env:
CIBW_BUILD: "${{ matrix.build }}*"
CIBW_ARCHS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
- 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@v4
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@v4
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/