From 4b7c19481c3c64bcf4eb139f01ef9090de66ed19 Mon Sep 17 00:00:00 2001 From: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com> Date: Wed, 28 Oct 2026 03:19:20 +0000 Subject: [PATCH] Put the license at the sdist root and check metadata before upload PyPI rejected the 10.1.1 sdist: its License-File entry named LICENSE.md at the root, where maturin had not put it. The wheels uploaded; the sdist did not. The publish workflow now runs twine check --strict first. --- .github/workflows/publish-pypi.yml | 5 +++++ crates/spliterator-py/pyproject.toml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 668a70e..d7e691d 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -175,6 +175,11 @@ jobs: done test "$(ls dist/*.whl | wc -l)" -eq 7 || { echo "::error::expected 7 wheels"; exit 1; } + # PyPI validates metadata on upload and rejects a file mid-batch, leaving a release with some files and not + # others. Checking here fails before anything is uploaded. + - name: Check the metadata + run: pipx run twine check --strict dist/* + - name: "Dry run: summary" if: ${{ inputs.dry_run }} run: echo "::notice::DRY RUN — built and checked sister-software-spliterator ${{ needs.check.outputs.version }}; nothing uploaded." diff --git a/crates/spliterator-py/pyproject.toml b/crates/spliterator-py/pyproject.toml index 09f07e3..793ccdc 100644 --- a/crates/spliterator-py/pyproject.toml +++ b/crates/spliterator-py/pyproject.toml @@ -30,6 +30,9 @@ dev = ["pytest>=8"] python-source = "python" module-name = "spliterator._native" features = ["pyo3/extension-module"] +# The sdist puts pyproject.toml at its root but this directory's files under crates/spliterator-py/, so the license +# is also copied to the root, where the `License-File` metadata entry says it is. PyPI rejects an sdist without it. +include = [{ path = "LICENSE.md", format = "sdist" }] [tool.ruff] line-length = 120