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