Skip to content

Bump pyo3 from 0.27.1 to 0.29.0 #69

Bump pyo3 from 0.27.1 to 0.29.0

Bump pyo3 from 0.27.1 to 0.29.0 #69

Workflow file for this run

# This file was originally generated by maturin v1.7.0 (`maturin generate-ci github`).
# It has been customized for free-threaded wheels and resilience when setup-python /
# actions/python-versions temporarily lacks builds for a given OS/arch/version.
#
name: CI
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
target: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/setup-python@v5
id: setup_freethreaded
continue-on-error: true
with:
python-version: |
3.13t
3.14t
- name: Configure maturin interpreters
shell: bash
run: |
INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
INTERP="$INTERP 3.13t 3.14t"
else
echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
fi
echo "MATURIN_INTERPRETERS=$INTERP pypy3.11" >> "$GITHUB_ENV"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/setup-python@v5
id: setup_freethreaded
continue-on-error: true
with:
python-version: |
3.13t
3.14t
- name: Configure maturin interpreters
shell: bash
run: |
INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
INTERP="$INTERP 3.13t 3.14t"
else
echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
fi
echo "MATURIN_INTERPRETERS=$INTERP pypy3.11" >> "$GITHUB_ENV"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
# Windows: install standard CPython only first, run maturin, then add 3.13t/3.14t and maturin again.
# If both GIL and free-threaded are on PATH before a single maturin run, detection picks 3.13t for 3.13
# and cp313/cp314 wheels are missing on win_amd64 (see https://github.com/PyO3/maturin-action/issues/313).
- uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
3.14
architecture: ${{ matrix.platform.target }}
- name: Configure maturin interpreters (standard CPython)
shell: bash
run: echo "MATURIN_INTERPRETERS_STD=3.8 3.9 3.10 3.11 3.12 3.13 3.14" >> "$GITHUB_ENV"
- name: Build wheels (standard CPython)
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i ${{ env.MATURIN_INTERPRETERS_STD }}
sccache: 'true'
- uses: actions/setup-python@v5
id: setup_freethreaded
continue-on-error: true
with:
python-version: |
3.13t
3.14t
architecture: ${{ matrix.platform.target }}
- name: Warn if free-threaded Python unavailable
if: steps.setup_freethreaded.outcome != 'success'
run: |
echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
- name: Build wheels (free-threaded)
if: steps.setup_freethreaded.outcome == 'success'
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i 3.13t 3.14t
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-15-intel
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.9
3.10
3.11
3.12
3.13
3.14
- uses: actions/setup-python@v5
id: setup_freethreaded
continue-on-error: true
with:
python-version: |
3.13t
3.14t
- name: Configure maturin interpreters
shell: bash
run: |
INTERP='3.8 3.9 3.10 3.11 3.12 3.13 3.14'
if [[ '${{ steps.setup_freethreaded.outcome }}' == 'success' ]]; then
INTERP="$INTERP 3.13t 3.14t"
else
echo '::warning::Free-threaded Python (3.13t/3.14t) unavailable from setup-python; skipping cp313t/cp314t wheels this run.'
fi
echo "MATURIN_INTERPRETERS=$INTERP pypy3.11" >> "$GITHUB_ENV"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i ${{ env.MATURIN_INTERPRETERS }}
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
free-threaded:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Try 3.14t first, then 3.13t. Use outcome (not conclusion): continue-on-error leaves conclusion "success"
# even when setup fails, but outcome stays "failure" so we can chain fallbacks reliably.
- uses: actions/setup-python@v5
id: py314t
continue-on-error: true
with:
python-version: '3.14t'
- uses: actions/setup-python@v5
id: py313t
if: steps.py314t.outcome != 'success'
continue-on-error: true
with:
python-version: '3.13t'
- name: Resolve free-threaded interpreter
id: ft_py
run: |
ready=false
if [[ '${{ steps.py314t.outcome }}' == 'success' ]] || [[ '${{ steps.py313t.outcome }}' == 'success' ]]; then
ready=true
fi
echo "ready=${ready}" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@stable
if: steps.ft_py.outputs.ready == 'true'
- uses: astral-sh/setup-uv@v5
if: steps.ft_py.outputs.ready == 'true'
- name: Install dependencies (uv) and run tests
if: steps.ft_py.outputs.ready == 'true'
shell: bash
run: |
set -euo pipefail
if [[ '${{ steps.py314t.outcome }}' == 'success' ]]; then
export UV_PYTHON='${{ steps.py314t.outputs.python-path }}'
else
export UV_PYTHON='${{ steps.py313t.outputs.python-path }}'
fi
uv sync --extra dev --locked
uv run pytest tests/
- name: Free-threaded Python unavailable
if: steps.ft_py.outputs.ready != 'true'
run: |
echo '::notice::No free-threaded Python (3.14t / 3.13t) available from setup-python for this runner; skipping extension tests.'
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, musllinux, windows, macos, free-threaded, sdist]
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*