Files
hermes-agent/scripts/build/icon_environment.py
ethernet 5e4a2a3d24 refactor(pm): remove legacy dependency and launch managers
Competing installers and checkout-local venv assumptions bypassed PM
selection, install consent, and generation lifetimes. Route consumers
through PM and installation-bound launchers. Refresh source launchers
before obsolete Python entries can be collected.

Remove Node, browser, and CUA acquisition engines, obsolete venv-holder
handling, detached sync, and unused PM APIs. Keep historical updater
exports inert and preserve external tool ownership and native integration.

Share product freshness and prepared inputs across builders. Align plugin
admission, Docker provisioning, setup instructions, and behavioral tests.

Verified targeted Python and JavaScript tests, desktop and web typechecks,
scoped lint, real product builds, and the Docker frontend smoke test.
The missed post-setup test cleanup is included and verified.

Native Windows/macOS execution, full Rust compilation, and the complete
repository suite remain unverified. Historical compatibility requirements
were preserved and extended, not fully rescanned.
2026-09-12 14:57:38 -04:00

40 lines
1.3 KiB
Python

"""Prepare the locked icon-only environment through PM, then run the generator."""
from __future__ import annotations
import argparse
from pathlib import Path
import subprocess
import sys
from tempfile import TemporaryDirectory
# The Node wrapper can run this file from a separately prepared source tree.
ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(ROOT))
import pm
def main(argv: list[str] | None = None) -> int:
argv = list(sys.argv[1:] if argv is None else argv)
parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
parser.add_argument("--source", type=Path, default=ROOT)
parser.add_argument("--on-demand", action="store_true")
args, _ = parser.parse_known_args(argv)
if args.on_demand:
argv.remove("--on-demand")
source = args.source.resolve()
with TemporaryDirectory(prefix="hermes-icon-build-") as temporary:
python = pm.build_environment(
source=source, out=Path(temporary) / "venv",
groups=["icon-build"], only_groups=True, explicit=not args.on_demand,
cache=source / ".cache/icon-build",
)
return subprocess.run(
[str(python), "-I", str(ROOT / "scripts/generate_icons.py"), *argv],
cwd=source,
).returncode
if __name__ == "__main__":
raise SystemExit(main())