Skip to content

Fix PyPI upload: remove duplicate force-include causing duplicate filenames in wheels - #246

Merged
jeduden merged 1 commit into
mainfrom
claude/upload-mdsmith-0-13-2
May 9, 2026
Merged

Fix PyPI upload: remove duplicate force-include causing duplicate filenames in wheels#246
jeduden merged 1 commit into
mainfrom
claude/upload-mdsmith-0-13-2

Conversation

@Claude

@Claude Claude AI commented May 9, 2026

Copy link
Copy Markdown
Contributor

PyPI rejected the v0.13.2 wheels with "Duplicate filename in local headers". The pyproject.toml had both artifacts (explicitly listing binary files) and force-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. The artifacts list alone correctly includes the platform-specific binary.

  • internal/release/buildwheels_test.go: Added zipFileNames() and hasDuplicates() helpers. Updated assertWheel() to verify wheels contain no duplicate entries (regression guard for future builds).

Context

# Before: both mechanisms include the binaries
[tool.hatch.build.targets.wheel]
artifacts = ["mdsmith/_bin/mdsmith", "mdsmith/_bin/mdsmith.exe"]

[tool.hatch.build.targets.wheel.force-include]
"mdsmith/_bin" = "mdsmith/_bin"  # Duplicates the artifacts above

# After: artifacts alone
[tool.hatch.build.targets.wheel]
artifacts = ["mdsmith/_bin/mdsmith", "mdsmith/_bin/mdsmith.exe"]

…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

codecov Bot commented May 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.32%. Comparing base (4bd9517) to head (5dfad2f).

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           
Flag Coverage Δ
go 95.31% <ø> (ø)
typescript 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Claude
Claude AI requested a review from jeduden May 9, 2026 00:03
@jeduden
jeduden marked this pull request as ready for review May 9, 2026 00:04
Copilot AI review requested due to automatic review settings May 9, 2026 00:04
@jeduden
jeduden merged commit d5cd49d into main May 9, 2026
17 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-include config so binaries are only included via the explicit artifacts list.
  • 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.

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.

3 participants