packs: ship python deps with the pack
A pack now owns the python deps its skills/bridge need, at packs/<name>/requirements.txt (standard pip format). SkillPack.requirements_file resolves it; the install plan lists the selected/enabled packs that ship one (setup.build_plan / plan_from_config -> pack_requirements); bootstrap installs each into .runtime/venv, so a host that never enables a pack installs nothing for it. Move the browser deps (Playwright) out of the agent repo's requirements/ into packs/browser/requirements.txt; the Playwright binary download stays a browser-specific bootstrap stage. --browser force-adds the pack's deps. Docs (PACKGEN.md, AGENTS.md, README.md) describe the pattern; tests keep every pack requirements.txt pinned and consistent with the manifest's requires.
This commit is contained in:
1 parent
bf071ee529
commit
b1a7bfd272
12 files changed
+180
-59
No files matched your search
@@ -50,6 +50,17 @@ class SkillPack:
|
||||
{category for category, _ in self.store.list_skills()}
|
||||
)
|
||||
|
||||
@property
|
||||
def requirements_file(self) -> Path | None:
|
||||
"""The pack's optional pip requirements file, if it ships one.
|
||||
|
||||
A pack owns its python deps: ``packs/<name>/requirements.txt`` (standard
|
||||
pip format) is installed by ``scripts/bootstrap.sh`` when the pack is
|
||||
selected (see ``setup.build_plan``). Returns ``None`` when absent.
|
||||
"""
|
||||
path = self.path / "requirements.txt"
|
||||
return path if path.is_file() else None
|
||||
|
||||
|
||||
def _parse_pack(manifest_path: Path) -> SkillPack:
|
||||
data = json.loads(manifest_path.read_text())
|
||||
|
||||
@@ -616,6 +616,11 @@ def build_plan(answers: Answers, packs: Sequence[SkillPack]) -> dict:
|
||||
"authoring": answers.new_skill_creation,
|
||||
"packs": list(answers.packs),
|
||||
"bridge_packs": bridge_packs,
|
||||
# Packs that ship their own python deps (packs/<name>/requirements.txt);
|
||||
# bootstrap pip-installs each. See PACKGEN.md, "Pack python deps".
|
||||
"pack_requirements": [
|
||||
p.name for p in packs if p.name in answers.packs and p.requirements_file
|
||||
],
|
||||
"gateways": list(answers.gateways),
|
||||
# Platforms the systemd gateway unit runs (voice is foreground-only).
|
||||
"gateway_platforms": daemon_gateways,
|
||||
@@ -648,6 +653,9 @@ def plan_from_config(config: dict, packs: Sequence[SkillPack]) -> dict:
|
||||
"authoring": str(config.get("new_skill_creation", "deny") or "deny"),
|
||||
"packs": enabled,
|
||||
"bridge_packs": bridge_packs,
|
||||
"pack_requirements": [
|
||||
p.name for p in packs if p.name in enabled and p.requirements_file
|
||||
],
|
||||
"gateways": gateways,
|
||||
"gateway_platforms": daemon_gateways,
|
||||
"install_engine": engine_provider == "semif",
|
||||
|
||||
Reference in new issue
Block a user