Fix PyPI upload: remove duplicate force-include causing duplicate filenames in wheels - #246
Merged
Merged
Conversation
…enames in wheels The pyproject.toml had both `artifacts` and `force-include` for mdsmith/_bin/, causing hatchling to include the binary files twice in each wheel. PyPI rejects such wheels with "Duplicate filename in local headers". Removed the redundant force-include section and added regression test to verify wheels don't contain duplicates. Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/c8343920-2d8b-4854-90af-1f7dd55f34c4 Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #246 +/- ##
=======================================
Coverage 95.32% 95.32%
=======================================
Files 160 160
Lines 20131 20131
=======================================
Hits 19189 19189
Misses 578 578
Partials 364 364
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PyPI wheel upload failures caused by duplicate filenames inside the wheel ZIP (triggered by Hatchling including the staged binary twice). This aligns the Python packaging config with the Go release tooling that stages a single platform-specific binary per wheel.
Changes:
- Removed redundant Hatchling
force-includeconfig so binaries are only included via the explicitartifactslist. - Added wheel ZIP inspection helpers and extended the wheel layout test to assert there are no duplicate ZIP entry names (regression guard).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/pyproject.toml | Removes force-include that caused _bin/ contents to be included twice in wheels. |
| internal/release/buildwheels_test.go | Adds duplicate-entry detection and asserts wheels contain no duplicate ZIP filenames. |
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.
PyPI rejected the v0.13.2 wheels with "Duplicate filename in local headers". The
pyproject.tomlhad bothartifacts(explicitly listing binary files) andforce-include(recursively including the_bin/directory), causing hatchling to include each binary twice in the wheel ZIP.Changes
python/pyproject.toml: Removed redundant
[tool.hatch.build.targets.wheel.force-include]section. Theartifactslist alone correctly includes the platform-specific binary.internal/release/buildwheels_test.go: Added
zipFileNames()andhasDuplicates()helpers. UpdatedassertWheel()to verify wheels contain no duplicate entries (regression guard for future builds).Context