From 5cd82b2c4d410f45c85e033098e0da2b4533bdf2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Jun 2026 13:27:01 +0000 Subject: [PATCH 1/2] Build abi3 wheels so installs don't recompile on macOS/Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release workflow built macOS and Windows wheels with a bare `maturin build`, which only targets the runner's single Python interpreter (3.11). As a result PyPI only had cp311 wheels for macOS/Windows, while Linux had cp310-cp313 (built via `-i` in maturin-action). Users on other Python versions — e.g. an M1 Mac on 3.12 — found no matching wheel and fell back to compiling the Rust sources from sdist on install (issue #163). Enable PyO3's stable ABI (`abi3-py310`) so each platform ships a single `cpXX-abi3` wheel that installs on all CPython >= 3.10, including future releases. This is the same approach datafusion-python uses for the same pyo3 + arrow + datafusion-ffi stack. The manylinux jobs no longer need to enumerate every interpreter, so they build with a single `-i python3.10`. The mac/win job needs no change: maturin auto-detects abi3 from Cargo.toml. Verified with `cargo check`: the extension only uses abi3-safe APIs. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01DDK8JtQyRQDdwJMgqADbe5 --- .github/workflows/publish.yml | 8 ++++++-- Cargo.lock | 2 +- Cargo.toml | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a0008bc..28cb478 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -91,7 +91,9 @@ jobs: manylinux: 2_28 rustup-components: rust-std rustfmt sccache: 'true' - args: --release --strip --out dist -i python3.10 python3.11 python3.12 python3.13 + # abi3 (see Cargo.toml) produces one wheel for all CPython >= 3.10, + # so a single interpreter is enough to build it. + args: --release --strip --out dist -i python3.10 - uses: actions/upload-artifact@v6 with: @@ -113,7 +115,9 @@ jobs: manylinux: 2_28 rustup-components: rust-std rustfmt sccache: 'true' - args: --release --strip --out dist -i python3.10 python3.11 python3.12 python3.13 + # abi3 (see Cargo.toml) produces one wheel for all CPython >= 3.10, + # so a single interpreter is enough to build it. + args: --release --strip --out dist -i python3.10 - uses: actions/upload-artifact@v6 with: diff --git a/Cargo.lock b/Cargo.lock index 8b58e75..21dfa95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3375,7 +3375,7 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "xarray_sql" -version = "0.2.3" +version = "0.3.0" dependencies = [ "arrow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index 1dc95bd..e708379 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,11 @@ async-trait = "0.1" datafusion = { version = "52.0.0" } datafusion-ffi = { version = "52.0.0" } futures = { version = "0.3" } -pyo3 = { version = "0.26.0", features = ["extension-module"] } +# `abi3-py310` builds against CPython's stable ABI, so a single wheel per +# platform works on all CPython >= 3.10 (matching `requires-python`). This +# lets the release workflow ship pre-built wheels for every interpreter +# without compiling per-version, avoiding local rebuilds on install. +pyo3 = { version = "0.26.0", features = ["extension-module", "abi3-py310"] } tokio = { version = "1.46.1", features = ["rt"] } From 1d171a896777bc45df2b24b2ec3351081b6c1d50 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Jun 2026 13:31:31 +0000 Subject: [PATCH 2/2] Don't publish to PyPI on workflow_dispatch Gate the upload-to-pypi job on `release` events so the publish workflow can be run manually (workflow_dispatch) to build and verify wheels as artifacts without performing an irreversible PyPI upload. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01DDK8JtQyRQDdwJMgqADbe5 --- .github/workflows/publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 28cb478..ab567eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -195,6 +195,10 @@ jobs: upload-to-pypi: needs: verify-built-dist runs-on: ubuntu-latest + # Only publish for real releases. `workflow_dispatch` runs build and + # verify the wheels (uploaded as artifacts) without pushing to PyPI, so + # the workflow can be exercised manually without cutting a release. + if: github.event_name == 'release' steps: - uses: actions/download-artifact@v6 with: