Skip to content

fix(hosting): drop redundant templates force-include causing wheel ZIP dupes - #54

Merged
antosubash merged 2 commits into
mainfrom
feature/kind-chandrasekhar-f4fb12
Apr 22, 2026
Merged

fix(hosting): drop redundant templates force-include causing wheel ZIP dupes#54
antosubash merged 2 commits into
mainfrom
feature/kind-chandrasekhar-f4fb12

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • Release run attempted to publish simple_module_hosting-0.0.1-py3-none-any.whl to PyPI and hit 400 Bad Request — Duplicate filename in local headers.
  • Root cause: framework/hosting/pyproject.toml declared both packages = [\"simple_module_hosting\"] and [tool.hatch.build.targets.wheel.force-include] \"simple_module_hosting/templates\" = \"simple_module_hosting/templates\". Hatchling already ships every file under a packaged directory (including non-.py template assets), so the force-include added each one a second time — 34 duplicate ZIP entries that PyPI's archive validator rejects.
  • Other modules' force-include blocks are not affected — they map package.json from the module root into the inner package dir, which packages = [\"<name>\"] wouldn't pick up.

Verification (local)

  • uv build --all-packages → 14 wheels, 14 sdists.
  • python -c ZIP scan across all 14 wheels: 0 duplicate entries.
  • twine check on all 28 artifacts: PASSED.
  • simple_module_hosting wheel: 99 → 65 entries, all 34 template files still present (e.g. templates/host/Makefile, templates/module/__PACKAGE__/endpoints/api.py.tpl).

Test plan

  • Merge, then re-dispatch release with version=0.0.1 target=pypi and confirm all 14 publish-pypi jobs reach upload successfully.

The workflow-level permissions block only listed contents/id-token, which
implicitly set actions to none. gh run list then returned nothing, the
2>/dev/null swallowed the error, and preflight spun out its 5-minute
timeout even though pr.yml had already finished green.

- add actions: read to the permissions block
- drop 2>/dev/null so future gh failures are visible in the log
…P dupes

packages = ["simple_module_hosting"] already includes the templates/
subdirectory and all its files (hatchling recurses into packaged dirs
and picks up non-.py files too). The force-include entry re-added every
file, producing 34 duplicate ZIP local headers. PyPI's upload validator
rejects such archives with a 400.

Other modules' force-include blocks stay — they ship package.json from
the module root into the inner package dir, which hatchling wouldn't
pick up from packages = ["<name>"] alone.

Verified: wheel goes from 99 entries (34 dupes) to 65 entries (0 dupes),
all 34 template files still shipped, twine check passes on all 14.
@antosubash
antosubash merged commit 9678887 into main Apr 22, 2026
10 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