Skip to content

fix(packaging): ship src/ra in the wheel (uv_build module-name)#104

Merged
eren23 merged 2 commits into
masterfrom
fix/uv-build-ship-ra
Jun 14, 2026
Merged

fix(packaging): ship src/ra in the wheel (uv_build module-name)#104
eren23 merged 2 commits into
masterfrom
fix/uv-build-ship-ra

Conversation

@eren23

@eren23 eren23 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

The project is named kai, so uv_build's default module discovery packages only src/kai and silently drops src/ra — the recursive-LM framework that kai imports (from ra.agents import ..., from ra.core.types import ...). So pip install kai @ git+https://github.com/firstbatchxyz/kai-security.git produces an install that crashes on import ra.

This surfaced while wiring kai-security as a sub-harness plugin in kai-agent (firstbatchxyz/kai-agent#171): its default install spec is the git URL, and the PYTHONPATH workaround there only applies to a local KAI_SECURITY_REPO checkout — so the default install path (local and remote) was broken.

Fix

Declare both top-level modules under src/:

[tool.uv.build-backend]
module-root = "src"
module-name = ["kai", "ra"]

One file, additive.

Verification

  • Before: built wheel's top-level dirs = kai only (ra missing).
  • After: kai + ra.
  • Fresh Python 3.12 venv → pip install the built wheel (deps from PyPI, no source tree on path) → import kai.main; import ra.core.types succeeds.
  • Dev env unaffected: uv run imports both; full test suite still passes (one unrelated failure was a live httpbin.org 503).

Unblocks firstbatchxyz/kai-agent#171's default install and lets the sub-harness runner there drop its PYTHONPATH workaround.

🤖 Generated with Claude Code

eren23 and others added 2 commits June 14, 2026 15:01
The project is named "kai", so uv_build's default module discovery packages
only src/kai and silently drops src/ra — the recursive-LM framework that kai
imports (`from ra... import ...`). As a result `pip install kai @ git+...`
produces an install that crashes on `import ra`.

Declare both top-level modules so ra ships too:

    [tool.uv.build-backend]
    module-root = "src"
    module-name = ["kai", "ra"]

Verified: the unfixed wheel contained only `kai`; the fixed wheel contains
kai + ra; a fresh py3.12 venv installs the wheel and imports kai.main +
ra.core.types with no source tree on the path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The why is in the prior commit message + PR description.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@eren23 eren23 requested a review from aktasbatuhan June 14, 2026 13:06
@eren23 eren23 merged commit 544b897 into master Jun 14, 2026
2 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.

2 participants