From 47be52a87a6b348c34fb376cec4751608a72bde3 Mon Sep 17 00:00:00 2001 From: Alex Merose Date: Sun, 15 Nov 2026 19:34:04 -0800 Subject: [PATCH] Publish: build only the sdist in the sdist job maturin build --sdist also built a wheel for the host runner. For 0.6.0 it was tagged manylinux_2_34 and uploaded as a second x86_64 wheel; for 0.7.0 it was tagged linux_x86_64, and PyPI rejected the upload. The check meant to catch this looked in target/wheels, but --out writes to dist. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NyN7idACeDMh94qrnFMu6h --- .github/workflows/publish.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 20a8158b..cdb58e68 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -141,20 +141,21 @@ jobs: with: rust-toolchain: stable rustup-components: rust-std rustfmt - # No `manylinux:` — sdist is platform-independent and runs on the - # host runner, which has python3 available. Running this in a - # manylinux container fails because maturin verifies the sdist by - # building a wheel from it, and the container has no interpreter. - args: --release --sdist --out dist - - - name: Assert sdist build does not generate wheels + # `maturin sdist` builds only the source distribution. `maturin + # build --sdist` also builds a wheel for the host runner, whose + # platform tag PyPI may reject (`linux_x86_64`). No `manylinux:`, + # since an sdist is platform-independent. + command: sdist + args: --out dist + + - name: Assert the sdist build made no wheels run: | - if [ -d "target/wheels" ] && [ "$(ls -A target/wheels)" ]; then - echo "Error: Sdist build generated wheels" + if ls dist/*.whl target/wheels/*.whl >/dev/null 2>&1; then + echo "Error: the sdist build made wheels:" + ls dist/*.whl target/wheels/*.whl 2>/dev/null exit 1 - else - echo "Directory is clean" fi + ls dist - uses: actions/upload-artifact@v6 with: