Repository navigation
fix(tests): assert the packaging manifest, not whatever is in dist/ - #35
Merged
Merged
Conversation
The wheel-membership assertion read dist/ and so depended on ambient state. dist/ is gitignored, so CI had none and the test skipped, while a stale local artifact failed it -- the precise local/CI asymmetry this work set out to remove, reintroduced by the test meant to guard it. mtime cannot fix it either. The artifact that exposed this was *newer* than the source and still wrong: it was built during a mutation test from a deliberately broken tree. Freshness and correctness are different questions, and only one of them is visible from a timestamp. So assert the actual trap where it is deterministic. pyproject lists packages explicitly, so a new package directory is dropped from the wheel silently; comparing that list against the package directories on disk catches it from source, with no build and nothing ambient. The test now runs everywhere instead of skipping in the one environment that matters. End-to-end proof stays in just check-install, which builds, installs and imports, and already runs in the package job. Mutation-tested against the real trap: an undeclared subpackage fails this test, and twine check passes on the same tree -- confirming again that metadata validation cannot see archive contents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a test I added in #30 that reintroduced the exact bug this work set out to remove.
The flaw
The wheel-membership assertion read
dist/and so depended on ambient state.dist/is gitignored, so CI has none and the test skips, while a stale local artifact fails it. Local/CI asymmetry — in the test meant to guard against exactly that.mainis red locally right now because of it.Why mtime wouldn't have fixed it
The artifact that exposed this was newer than the source and still wrong — built during a mutation test from a deliberately broken tree. Freshness and correctness are different questions, and only one is visible from a timestamp. Any staleness heuristic here would have been a second guess dressed as a check.
The fix
Assert the trap where it's deterministic.
pyproject.tomllists packages explicitly, so a new package directory is dropped from the wheel silently. Comparing that list against the package directories on disk catches it from source — no build, nothing ambient, and it now runs everywhere instead of skipping in the one environment that matters.End-to-end proof stays in
just check-install, which builds, installs and imports every__all__name, and already runs in thepackagejob.Mutation-tested
Suite goes from 43 tests with 1 skip to 44 with none.