Skip to content

Support Python 3.12 #151

Support Python 3.12

Support Python 3.12 #151

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags: [ "*" ]
pull_request:
branches: [ main ]
jobs:
build_wheels:
runs-on: ${{ matrix.target[0] }}
strategy:
fail-fast: false
matrix:
target: # [ os, cibuildwheel-platform ]
- [ macos-latest, macosx_x86_64 ]
- [ macos-latest, macosx_arm64 ]
- [ ubuntu-latest, manylinux_aarch64 ]
- [ ubuntu-latest, manylinux_x86_64 ]
- [ windows-latest, win_amd64 ]
python-version: [ "cp38-", "cp39-", "cp310-", "cp311-", "cp312-" ]
steps:
- uses: actions/checkout@v3
- name: Build CMake targets
run: |
mkdir cmake-build-release
cd cmake-build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install twine
- if: matrix.target[0] == 'ubuntu-latest'
name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheel
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_ARCHS: all
CIBW_BUILD: ${{ matrix.python-version }}${{ matrix.target[1] }}
CIBW_BEFORE_BUILD: pip install numpy
CIBW_BEFORE_TEST: pip install numpy matplotlib
CIBW_TEST_COMMAND: cd {project}/Python && python advanced_example.py no_block && python simple_example.py no_block
CIBW_TEST_COMMAND_WINDOWS: cd /D {project}/Python && python advanced_example.py no_block && python simple_example.py no_block
- if: startsWith(github.ref, 'refs/tags/v')
name: Upload wheel
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TOKEN }}
run: python -m twine upload --verbose --repository pypi wheelhouse/* --skip-existing
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9" # build sdist on lowest supported Python
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy
python -m pip install twine
- name: Build sdist
run: python setup.py sdist
- if: startsWith(github.ref, 'refs/tags/v')
name: Upload sdist
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TOKEN }}
run: python -m twine upload --verbose --repository pypi dist/*