Skip to content

Commit acbea55

Browse files
committed
fix(cd): include LICENSE in sdist + skip-existing PyPI uploads
CD #64 (run 25943880454) successfully uploaded all 4 wheels (linux x86_64/aarch64, macos arm64, windows x86_64) to PyPI as treemapper 1.6.1 but then 400'd on the sdist with 'License-File LICENSE does not exist in distribution file'. Cause: maturin only ships files matching [tool.maturin].include in the sdist tarball, and LICENSE was not in that list. The wheel auto-embeds LICENSE via PEP 639 metadata so it passed; the sdist did not. - pyproject.toml: add LICENSE, README.md, CHANGELOG.md to the maturin sdist include list. Verified locally: 'maturin sdist' now produces a tarball that contains treemapper-1.6.1/LICENSE. - cd.yml: set skip-existing: true on pypa/gh-action-pypi-publish so re-running CD for v1.6.1 silently skips the already-published wheels and only uploads the new (fixed) sdist.
1 parent e0ed56a commit acbea55

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ jobs:
313313
with:
314314
packages-dir: ./dist
315315
print-hash: true
316+
# Idempotent re-runs: if a wheel for this version was already
317+
# uploaded in a previous (failed) CD run, skip it instead of
318+
# erroring out. New artifacts (e.g. a corrected sdist) still
319+
# publish.
320+
skip-existing: true
316321

317322
smoke-pypi:
318323
name: Post-publish smoke test (${{ matrix.os }} / py${{ matrix.python-version }})

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ module-name = "treemapper._diffctx"
117117
manifest-path = "diffctx/Cargo.toml"
118118
features = [ "pyo3/extension-module", "python" ]
119119
include = [
120+
{ path = "LICENSE", format = "sdist" },
121+
{ path = "README.md", format = "sdist" },
122+
{ path = "CHANGELOG.md", format = "sdist" },
120123
{ path = "diffctx/Cargo.toml", format = "sdist" },
121124
{ path = "diffctx/Cargo.lock", format = "sdist" },
122125
{ path = "diffctx/src/**/*", format = "sdist" },

0 commit comments

Comments
 (0)