From 146cf39b548c8f3f27f64578b35212ab1ea3c15c Mon Sep 17 00:00:00 2001 From: hartsock Date: Sat, 27 Jun 2026 20:01:58 -0400 Subject: [PATCH] fix(publish): remove --abi3/--interpreter flags; abi3 via Cargo.toml feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WHAT: maturin-action v1 does not accept `--abi3` as a standalone CLI flag (maturin itself requires a value: `--abi3 ` is not a valid form either — abi3 is activated by PyO3's `abi3-py39` CRATE FEATURE, not a CLI flag). The original workflow passed `--interpreter python3.11 --abi3` which maturin rejected with "tip: to pass '--abi3' as a value, use '-- --abi3'". FIX: Drop `--interpreter` and `--abi3` from the `args:` lines entirely. `abi3-py39` is already declared in `Cargo.toml`'s pyo3 features; maturin detects it automatically and stamps the wheel `cp39-abi3`. Also move `MATURIN_PYPI_TOKEN` into the upload step env (not a global env) — the token is only needed by `maturin upload`, not the build steps. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_018R92DDLCsWorb4fSJQrdvD --- .github/workflows/publish.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3d2a687..1ef9bc0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,14 +5,13 @@ # same build + test steps that the `check` job in ci.yml runs. # # Publishes abi3 maturin wheels for: -# - linux x86_64 + aarch64 (via QEMU) -# - macOS x86_64 + arm64 (via two native runners, combined into universal2) +# - linux x86_64 + aarch64 (via QEMU / manylinux) +# - macOS universal2 (x86_64 + arm64 combined) # - windows x86_64 # -# The wheel uses cp39 abi3 (--interpreter python3.9 --abi3) so one wheel covers -# Python 3.9+ on each platform. pyproject.toml declares requires-python = ">=3.11" -# which is still compatible (the abi3 tag is the build ABI floor, not the runtime -# floor — pip enforces pyproject.toml's requires-python separately). +# abi3 is activated by the `pyo3/abi3-py39` crate feature (set in Cargo.toml), +# NOT by a --abi3 / --interpreter CLI flag to maturin. maturin detects the abi3 +# feature automatically and stamps the wheel tag `cp39-abi3`. name: publish @@ -24,12 +23,10 @@ on: inputs: tag: description: "Tag to publish (e.g. v0.1.0)" - required: true + required: false env: CARGO_TERM_COLOR: always - # maturin needs this to pick the right Python for abi3 builds. - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} jobs: # ── Linux x86_64 + aarch64 (manylinux) ─────────────────────────────────── @@ -44,11 +41,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" - - name: build wheel (manylinux abi3) + - name: build wheel (manylinux, abi3 via pyo3/abi3-py39 crate feature) uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --features extension-module --interpreter python3.11 --abi3 + args: --release --out dist --features extension-module manylinux: auto sccache: "true" - uses: actions/upload-artifact@v4 @@ -56,7 +53,7 @@ jobs: name: wheels-linux-${{ matrix.target }} path: dist - # ── macOS x86_64 + arm64 (combined into universal2) ────────────────────── + # ── macOS universal2 (x86_64 + arm64 combined) ─────────────────────────── macos: name: macos (universal2) runs-on: macos-latest @@ -65,11 +62,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" - - name: build wheel (universal2 abi3) + - name: build wheel (universal2, abi3 via pyo3/abi3-py39 crate feature) uses: PyO3/maturin-action@v1 with: target: universal2-apple-darwin - args: --release --out dist --features extension-module --interpreter python3.11 --abi3 + args: --release --out dist --features extension-module sccache: "true" - uses: actions/upload-artifact@v4 with: @@ -85,11 +82,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" - - name: build wheel (abi3) + - name: build wheel (abi3 via pyo3/abi3-py39 crate feature) uses: PyO3/maturin-action@v1 with: target: x86_64 - args: --release --out dist --features extension-module --interpreter python3.11 --abi3 + args: --release --out dist --features extension-module sccache: "true" - uses: actions/upload-artifact@v4 with: @@ -128,8 +125,12 @@ jobs: pattern: wheels-* merge-multiple: true path: dist + - name: list wheels + run: ls -la dist/ - name: publish uses: PyO3/maturin-action@v1 with: command: upload args: --non-interactive --skip-existing dist/* + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}