Skip to content

build(sdist): drop .github/workflows so CI-only commits stop moving the sdist hash - #58

Merged
vdavez merged 1 commit into
mainfrom
fix/sdist-excludes-ci-workflows
Aug 4, 2026
Merged

build(sdist): drop .github/workflows so CI-only commits stop moving the sdist hash#58
vdavez merged 1 commit into
mainfrom
fix/sdist-excludes-ci-workflows

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

The sdist whitelist included /.github/workflows, so any CI-only commit changed the sdist for an otherwise-unchanged package.

That defeats the --check-url flag added in #57. uv publish --check-url compares each freshly-built file against the index and errors on a mismatch — which is correct behavior, since a same-name-different-bytes artifact is exactly what you want a publisher to refuse. But it means a version already on PyPI stops being recognizable as already-published the moment CI changes.

The worked example

v1.5.0, which is why this surfaced:

  1. Published by hand from the release commit 0b1e94c.
  2. ci(publish): make the PyPI upload idempotent so a Release cannot go red over a duplicate #57 added --check-url to publish.yml — a workflow-only change that nonetheless altered the sdist, because the workflow file ships inside it.
  3. The Release's publish run skipped the wheel correctly (already exists, skipping) and then failed on the sdist:
    error: Local file and index file do not match for tango_python-1.5.0.tar.gz.
    Local: sha256=22043b72…  Remote: sha256=13694bb0…
    

No tag target could have avoided it. A release event takes both the workflow and the checkout from the tagged commit (confirmed on the failed run: headSha=83c3003, event=release). Tagging the pre-fix commit runs a publish without --check-url and fails on the duplicate instead. The failure was locked in the moment 1.5.0 was published from a tree whose publish.yml predated the fix.

Fix

Remove /.github/workflows from the sdist whitelist, with a comment at the whitelist explaining the omission so it does not get "helpfully" restored later.

CI definitions are not buildable-from-source content — nobody runs this project's GitHub Actions from a PyPI tarball — so the entry bought nothing and cost hash stability.

Verification

  • Stability, measured: built the sdist, appended a line to .github/workflows/lint.yml, rebuilt. Both hash to a53243c1…. Before this change the hash moved.
  • Completeness: uv build still builds the wheel from the sdist, so the whitelist has not lost anything the build needs. Top level is tango tests docs scripts README.md LICENSE CHANGELOG.md pyproject.toml.
  • Reproducibility (bonus finding): the sdist build is deterministic across machines — rebuilding v1.5.0 at 0b1e94c locally reproduced PyPI's remote hash 13694bb0… exactly. That is what made this diagnosable rather than guesswork, and it is worth preserving.
  • 345 tests pass.

Scope

This does not retroactively fix v1.5.0's red publish run — nothing can, since its sdist is already on PyPI. It makes 1.6.0 onward clean, and makes --check-url reliable rather than conditional on nobody having touched CI.

…he sdist hash

The sdist whitelist included `/.github/workflows`, so any commit touching CI changed the sdist for an otherwise-unchanged package. That defeats `uv publish --check-url`, which compares the freshly-built file against the index and errors on a mismatch — so a version already on PyPI stops being recognizable as already-published.

v1.5.0 hit exactly this: published by hand from the release commit, then #57 added `--check-url` to publish.yml, a workflow-only change that altered the sdist because the workflow ships inside it. The Release's publish run skipped the wheel and failed on the sdist hash.

CI definitions are not buildable-from-source content, so the entry bought nothing and cost hash stability.

Also trims the comment #57 left on the publish step, and keeps the note here to one line.

Verified: appending a line to `.github/workflows/lint.yml` and rebuilding now yields an identical sha256, where before the hash moved. `uv build` still builds the wheel from the sdist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vdavez
vdavez force-pushed the fix/sdist-excludes-ci-workflows branch from 72fbf3d to 975f6b7 Compare August 4, 2026 14:23
@vdavez
vdavez merged commit a92f16b into main Aug 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant