fix(ci): treat sdist VCS-ignore files as optional in distribution check - #27
Merged
Merged
Conversation
hatchling 1.31.0 ships only .gitignore in the sdist; older releases also bundled .hgignore. check_sdist required an exact member set including .hgignore, so the Validate workflow's package job failed on main once CI resolved the newer hatchling. Require the tracked source set plus the fixed metadata files, and accept .gitignore/.hgignore as optional members either way.
Owner
Author
|
@Jason-Morcos heads up: the |
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.
The
Validateworkflow'sPackage artifactsjob started failing onmainright after #21 merged:Cause
check_sdistcompared the sdist member list against an exact expected set that hardcoded.hgignore. hatchling bundles the VCS ignore files it finds, but which ones ship depends on the hatchling version — 1.31.0 (what CI resolved) ships only.gitignorein the sdist, while older releases also included.hgignore. #21 was validated against an older hatchling, so the exact-match check passed locally and failed in CI.The wheel check was unaffected.
Fix
Split the sdist expectation into a required set (tracked sources +
LICENSE,PKG-INFO,README.md,pyproject.toml,_version.py) and an optional set (.gitignore,.hgignore). The check now assertsrequired <= relative <= required | optional, so it passes whether hatchling emits one ignore file, both, or neither, while still catching any genuinely unexpected member.Validation
python -m build+python tools/check_distribution.py dist→distribution contents verified(hatchling 1.31.0, Python 3.14)pytest -q→52 passed