Skip to content

fix: bundle Swift HUD source in wheel so uvx installs can auto-build#7

Merged
dshanklin-bv merged 1 commit into
mainfrom
fix/bundle-hud-source
Apr 30, 2026
Merged

fix: bundle Swift HUD source in wheel so uvx installs can auto-build#7
dshanklin-bv merged 1 commit into
mainfrom
fix/bundle-hud-source

Conversation

@dshanklin-bv

Copy link
Copy Markdown
Contributor

Summary

The v0.1-v0.4 wheels were Python-only — `hud/` was in the sdist but never the wheel. Under `uvx --from cept cept` (how the eidos-marketplace plugin invokes cept), `find_source_dir()` couldn't locate `hud/Package.swift`, `build()` returned None, and the HUD adapter silently fell back to noop. The popup feature shipped in v0.4.0 was structurally correct but invisible to anyone installing from PyPI.

What changed

  • `pyproject.toml`: hatchling `force-include` ships `hud/` → `cept/_hud_source/` inside the wheel
  • `hud_install.py`: `find_source_dir()` now checks the bundled path first; ancestor-walk preserved as fallback for editable / source-checkout layouts
  • `tests/test_hud_install.py`: new test pins the bundled-path-wins behavior

Verification

```
$ python3 -c "import zipfile; z=zipfile.ZipFile('dist/cept-0.4.1-py3-none-any.whl'); print([n for n in z.namelist() if '_hud_source' in n])"
['cept/_hud_source/Package.swift', 'cept/_hud_source/Sources/cept-hud/main.swift']

$ uv tool install --reinstall dist/cept-0.4.1-py3-none-any.whl
$ uvx --from cept python -c "from cept import hud_install; print(hud_install.find_source_dir())"
/Users/.../site-packages/cept/_hud_source
```

Test plan

  • `uv run pytest -x -q` — 95 passed (1 new)
  • `uv run ruff check` — clean
  • Wheel inspection shows hud source present
  • Installed wheel resolves `find_source_dir()` to the bundled path
  • Manual after release: real `uvx --from cept` install + `CEPT_EMIT=hud` MCP call → popup appears

🤖 Generated with Claude Code

The v0.1-0.4 wheels were Python-only (`packages = ["src/cept"]`).
Under `uvx --from cept cept` — which is how the eidos-marketplace plugin
invokes cept — `find_source_dir()` couldn't locate `hud/Package.swift`,
`build()` returned None, and the HUD adapter silently no-op'd. The
floating popup feature shipped in v0.4.0 was structurally correct but
invisible to anyone installing from PyPI.

Fix uses hatchling `force-include` to ship the swift source as
`cept/_hud_source/` inside the wheel. `find_source_dir()` now checks
that path first; existing editable / source-checkout layout still
works via the ancestor-walk fallback.

Verified: wheel inspection shows `cept/_hud_source/Package.swift` and
`cept/_hud_source/Sources/cept-hud/main.swift` present. Under
`uv tool install` of the built wheel, `find_source_dir()` resolves to
the bundled location and the build succeeds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dshanklin-bv dshanklin-bv merged commit 74bbf3b into main Apr 30, 2026
0 of 3 checks passed
@dshanklin-bv dshanklin-bv deleted the fix/bundle-hud-source branch April 30, 2026 15:44
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