diff --git a/.github/workflows/maturin_ci.yml b/.github/workflows/maturin_ci.yml index f28a4263..b8551a29 100644 --- a/.github/workflows/maturin_ci.yml +++ b/.github/workflows/maturin_ci.yml @@ -1,4 +1,4 @@ -# This file is autogenerated by maturin v1.9.4 +# This file is autogenerated by maturin v1.12.6 # To update, run # # maturin generate-ci github --pytest --skip-attestation --output .github/workflows/maturin_ci.yml @@ -37,8 +37,8 @@ jobs: # - runner: ubuntu-22.04 # target: ppc64le steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.x - name: Build wheels @@ -48,8 +48,15 @@ jobs: args: --release --out dist --find-interpreter sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: auto + - name: Build free-threaded wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i python3.14t + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + manylinux: auto - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: wheels-linux-${{ matrix.platform.target }} path: dist @@ -93,36 +100,41 @@ jobs: - runner: ubuntu-22.04 target: armv7 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + manylinux: musllinux_1_2 + - name: Build free-threaded wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i python3.14t sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: musllinux_1_2 - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: wheels-musllinux-${{ matrix.platform.target }} path: dist - name: pytest if: ${{ startsWith(matrix.platform.target, 'x86_64') }} - uses: maus007/docker-run-action-fork@v1 - with: - image: alpine:latest - options: -v ${{ github.workspace }}:/io -w /io - run: | - set -e + run: | + set -e + docker run --rm -v ${{ github.workspace }}:/io -w /io alpine:latest sh -c ' apk add py3-pip py3-virtualenv python3 -m virtualenv .venv source .venv/bin/activate pip install math-core --no-index --find-links dist --force-reinstall pip install pytest pytest + ' - name: pytest if: ${{ !startsWith(matrix.platform.target, 'x86') }} uses: uraimo/run-on-arch-action@v2 @@ -147,27 +159,41 @@ jobs: platform: - runner: windows-latest target: x64 + python_arch: x64 # - runner: windows-latest # target: x86 + # python_arch: x86 + - runner: windows-11-arm + target: aarch64 + python_arch: arm64 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: - python-version: 3.x - architecture: ${{ matrix.platform.target }} + python-version: 3.13 + architecture: ${{ matrix.platform.python_arch }} - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - uses: actions/setup-python@v6 + with: + python-version: 3.14t + architecture: ${{ matrix.platform.python_arch }} + - name: Build free-threaded wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i python3.14t sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: wheels-windows-${{ matrix.platform.target }} path: dist - name: pytest - if: ${{ !startsWith(matrix.platform.target, 'aarch64') }} shell: bash run: | set -e @@ -182,23 +208,29 @@ jobs: strategy: matrix: platform: - # - runner: macos-13 - # target: x86_64 - - runner: macos-14 + - runner: macos-15-intel + target: x86_64 + - runner: macos-latest target: aarch64 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Build free-threaded wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist -i python3.14t sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: wheels-macos-${{ matrix.platform.target }} path: dist @@ -215,14 +247,14 @@ jobs: runs-on: ubuntu-latest if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build sdist uses: PyO3/maturin-action@v1 with: command: sdist args: --out dist - name: Upload sdist - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: wheels-sdist path: dist @@ -239,10 +271,10 @@ jobs: # Used to upload release artifacts contents: write steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v7 + - name: Install uv + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: astral-sh/setup-uv@v7 - name: Publish to PyPI if: ${{ startsWith(github.ref, 'refs/tags/') }} - uses: PyO3/maturin-action@v1 - with: - command: upload - args: --non-interactive --skip-existing wheels-*/* + run: uv publish --trusted-publishing always 'wheels-*/*' diff --git a/crates/math-core-python/Cargo.toml b/crates/math-core-python/Cargo.toml index 554aef59..34607b33 100644 --- a/crates/math-core-python/Cargo.toml +++ b/crates/math-core-python/Cargo.toml @@ -16,5 +16,5 @@ crate-type = ["cdylib"] [dependencies] math-core = { path = "../math-core", features = ["ariadne"] } ariadne = { workspace = true } -pyo3 = "0.28.2" +pyo3 = { version = "0.28.2", features = ["abi3-py310"] } rustc-hash = { workspace = true } diff --git a/pyproject.toml b/pyproject.toml index fd074d67..f3056afd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,6 @@ python-source = "python" python-packages = ["math_core"] include = ["python/math_core/py.typed", "python/math_core/_math_core_rust.pyi"] module-name = "math_core._math_core_rust" -features = ["pyo3/extension-module"] bindings = "pyo3" # compatibility = "pypi"