fix(packaging): ship bundled skills in the wheel via setup.py data_files - #52113
fix(packaging): ship bundled skills in the wheel via setup.py data_files#52113Que0x wants to merge 2 commits into
Conversation
pyproject's [tool.setuptools.data-files] table silently overrode setup.py's data_files, so wheels shipped zero skills/ and optional-skills/ and sync_skills() returned total_bundled: 0 on sealed installs. Consolidate all bundled data dirs into one dynamic generator in setup.py (also fixes a Windows path-separator bug, excludes index-cache/__pycache__ cruft, and auto-includes the silently-dropped optional-mcps/unreal-engine). Remove the shadowing pyproject table and add regression tests.
runpy.run_path runs setup.py as "<run_path>", not "__main__", so the guard added earlier in this branch stopped setuptools.setup() from running and broke test_docker_webui_install_surface. Remove the guard; the packaging tests now capture data_files via runpy + a setuptools.setup patch (the same technique the docker-webui test uses) instead of importing the module.
|
Thanks for tracing this to the competing setuptools configuration sources. The premise still holds on current The PR's single dynamic generator preserves per-directory targets, includes the existing locales and MCP catalog payloads, and its proposed tests cover source completeness, target layout, excluded artifacts, and reintroduction of the shadowing table. No verified correctness issue was found in the diff. The affected packaging sections have not materially changed on current Automated hermes-sweeper review. |
Problem
Wheel installs shipped zero bundled skills.
setup.pygeneratesdata_filesforskills/+optional-skills/, but pyproject's[tool.setuptools.data-files]table silently overrides it — setuptools resolves that field from one source, never both. So_get_bundled_dir()finds nothing andsync_skills()returnstotal_bundled: 0on every wheel/sealed install. The earlier3a7ed7be0("ship bundled skills in wheel") never actually took effect.Fix
Make
setup.pythe single source of truth: dynamically generatedata_filesfor all four bundled dirs (skills,optional-skills,locales,optional-mcps) and remove the shadowing pyproject table. Side fixes in the generator: emit POSIX path separators (was baking in backslash targets), excludeindex-cache/__pycache__/*.pyccruft, and auto-include the silently-droppedoptional-mcps/unreal-engine.Tests
skills/447 files / 72 SKILL.md,optional-skills/444 / 101,locales/16,optional-mcps/3 — nested structure preserved, no cruft (before: skills/optional-skills = 0). sdist unchanged (still ships skills via MANIFEST).pytest tests/test_packaging_metadata.py→ 11 passed (rewrote the locale test for the new source; added 3 regressions: skills completeness/no-flatten/no-cruft, optional-mcps drift guard, pyproject-shadow guard).ruff check setup.py tests/test_packaging_metadata.py→ clean.