mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
refactor: remove pip and brew installation paths
This commit is contained in:
parent
8fd5b25898
commit
76c2f0aae2
83 changed files with 433 additions and 2509 deletions
|
|
@ -576,7 +576,6 @@ def main(argv: list[str]) -> int:
|
|||
REPO_ROOT / "plugins",
|
||||
REPO_ROOT / "scripts",
|
||||
REPO_ROOT / "acp_adapter",
|
||||
REPO_ROOT / "acp_registry",
|
||||
]
|
||||
roots = [r for r in roots if r.exists()]
|
||||
elif args.diff:
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ NO_SKILLS=false
|
|||
BRANCH="main"
|
||||
INSTALL_COMMIT=""
|
||||
ENSURE_DEPS=""
|
||||
POSTINSTALL_MODE=false
|
||||
|
||||
MANIFEST_MODE=false
|
||||
STAGE_NAME=""
|
||||
JSON_OUTPUT=false
|
||||
|
|
@ -150,10 +150,7 @@ while [[ $# -gt 0 ]]; do
|
|||
ENSURE_DEPS="$2"
|
||||
shift 2
|
||||
;;
|
||||
--postinstall)
|
||||
POSTINSTALL_MODE=true
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--help)
|
||||
echo "Hermes Agent Installer"
|
||||
echo ""
|
||||
|
|
@ -190,9 +187,7 @@ while [[ $# -gt 0 ]]; do
|
|||
echo " --ensure DEPS Install only specified deps (comma-separated)"
|
||||
echo " Supported: node, browser, ripgrep, ffmpeg"
|
||||
echo " Does NOT clone repo or create venv"
|
||||
echo " --postinstall Run post-install setup only (for pip users)"
|
||||
echo " Installs optional deps + runs hermes setup"
|
||||
echo " Does NOT clone repo or create venv"
|
||||
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
|
|
@ -2584,29 +2579,6 @@ ensure_mode() {
|
|||
done
|
||||
}
|
||||
|
||||
postinstall_mode() {
|
||||
print_banner
|
||||
detect_os
|
||||
|
||||
log_info "Post-install mode: setting up Hermes for pip install"
|
||||
|
||||
check_node
|
||||
check_network_prerequisites
|
||||
install_system_packages
|
||||
|
||||
if [ "$HAS_NODE" = true ] && [ "$SKIP_BROWSER" = false ]; then
|
||||
ensure_browser
|
||||
fi
|
||||
|
||||
HERMES_CMD="$(command -v hermes 2>/dev/null || echo "")"
|
||||
if [ -n "$HERMES_CMD" ]; then
|
||||
log_info "Running hermes setup..."
|
||||
"$HERMES_CMD" setup
|
||||
else
|
||||
log_warn "hermes command not found on PATH"
|
||||
log_info "Try: python -m hermes_cli.main setup"
|
||||
fi
|
||||
}
|
||||
|
||||
# Clear the cached Electron download + any half-written unpacked output so the
|
||||
# next `npm run pack` re-downloads and re-stages from scratch. A corrupt zip in
|
||||
|
|
@ -3150,8 +3122,6 @@ elif [ -n "$STAGE_NAME" ]; then
|
|||
run_stage_protocol "$STAGE_NAME"
|
||||
elif [ -n "$ENSURE_DEPS" ]; then
|
||||
ensure_mode
|
||||
elif [ "$POSTINSTALL_MODE" = true ]; then
|
||||
postinstall_mode
|
||||
else
|
||||
main
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -34,11 +34,6 @@ REPO_ROOT = Path(__file__).resolve().parent.parent
|
|||
VERSION_FILE = REPO_ROOT / "hermes_cli" / "__init__.py"
|
||||
PYPROJECT_FILE = REPO_ROOT / "pyproject.toml"
|
||||
|
||||
# ACP Registry manifest must stay version-locked with pyproject.toml.
|
||||
# tests/acp/test_registry_manifest.py enforces this lockstep so the release
|
||||
# bump touches both files atomically.
|
||||
ACP_REGISTRY_MANIFEST = REPO_ROOT / "acp_registry" / "agent.json"
|
||||
|
||||
# ──────────────────────────────────────────────────────────────────────
|
||||
# Git email → GitHub username mapping
|
||||
# ──────────────────────────────────────────────────────────────────────
|
||||
|
|
@ -2203,70 +2198,6 @@ def update_version_files(semver: str, calver_date: str):
|
|||
)
|
||||
desktop_pkg.write_text(pkg_text, encoding="utf-8")
|
||||
|
||||
# Update ACP Registry manifest + npm launcher (must stay version-locked
|
||||
# with pyproject — enforced by tests/acp/test_registry_manifest.py).
|
||||
_update_acp_registry_versions(semver)
|
||||
|
||||
|
||||
def _update_acp_registry_versions(semver: str) -> None:
|
||||
"""Bump the ACP Registry manifest's version + uvx package pin in lockstep
|
||||
with pyproject.
|
||||
|
||||
Skips silently if the manifest is missing — older release branches predate
|
||||
the ACP Registry assets.
|
||||
"""
|
||||
if ACP_REGISTRY_MANIFEST.exists():
|
||||
manifest = json.loads(ACP_REGISTRY_MANIFEST.read_text(encoding="utf-8"))
|
||||
manifest["version"] = semver
|
||||
uvx = manifest.get("distribution", {}).get("uvx", {})
|
||||
if "package" in uvx:
|
||||
uvx["package"] = f"hermes-agent[acp]=={semver}"
|
||||
# Preserve trailing newline + 2-space indent the file already uses.
|
||||
ACP_REGISTRY_MANIFEST.write_text(
|
||||
json.dumps(manifest, indent=2) + "\n", encoding="utf-8"
|
||||
)
|
||||
|
||||
|
||||
def build_release_artifacts(semver: str) -> list[Path]:
|
||||
"""Build sdist/wheel artifacts for the current release.
|
||||
|
||||
Tries ``uv build`` first (matching the CI workflow), falls back to
|
||||
``python -m build`` if uv is unavailable.
|
||||
"""
|
||||
dist_dir = REPO_ROOT / "dist"
|
||||
shutil.rmtree(dist_dir, ignore_errors=True)
|
||||
|
||||
# Prefer uv build (matches CI workflow), fall back to python -m build.
|
||||
uv_bin = shutil.which("uv")
|
||||
if uv_bin:
|
||||
cmd = [uv_bin, "build", "--sdist", "--wheel"]
|
||||
else:
|
||||
cmd = [sys.executable, "-m", "build", "--sdist", "--wheel"]
|
||||
|
||||
result = subprocess.run(
|
||||
cmd,
|
||||
cwd=str(REPO_ROOT),
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
if result.returncode != 0:
|
||||
print(" ⚠ Could not build Python release artifacts.")
|
||||
stderr = result.stderr.strip()
|
||||
stdout = result.stdout.strip()
|
||||
if stderr:
|
||||
print(f" {stderr.splitlines()[-1]}")
|
||||
elif stdout:
|
||||
print(f" {stdout.splitlines()[-1]}")
|
||||
print(" Install uv or the 'build' package to attach sdist/wheel assets.")
|
||||
return []
|
||||
|
||||
artifacts = sorted(p for p in dist_dir.iterdir() if p.is_file())
|
||||
matching = [p for p in artifacts if semver in p.name]
|
||||
if not matching:
|
||||
print(" ⚠ Built artifacts did not match the expected release version.")
|
||||
return []
|
||||
return matching
|
||||
|
||||
|
||||
def resolve_author(name: str, email: str) -> str:
|
||||
"""Resolve a git author to a GitHub @mention."""
|
||||
|
|
@ -2606,8 +2537,6 @@ def main():
|
|||
|
||||
# Commit version bump
|
||||
add_files = [str(VERSION_FILE), str(PYPROJECT_FILE)]
|
||||
if ACP_REGISTRY_MANIFEST.exists():
|
||||
add_files.append(str(ACP_REGISTRY_MANIFEST))
|
||||
add_result = git_result("add", *add_files)
|
||||
if add_result.returncode != 0:
|
||||
print(f" ✗ Failed to stage version files: {add_result.stderr.strip()}")
|
||||
|
|
@ -2640,14 +2569,6 @@ def main():
|
|||
print(" Continue manually after fixing access:")
|
||||
print(" git push origin HEAD --tags")
|
||||
|
||||
# Build semver-named Python artifacts so downstream packagers
|
||||
# (e.g. Homebrew) can target them without relying on CalVer tag names.
|
||||
artifacts = build_release_artifacts(new_version)
|
||||
if artifacts:
|
||||
print(" ✓ Built release artifacts:")
|
||||
for artifact in artifacts:
|
||||
print(f" - {artifact.relative_to(REPO_ROOT)}")
|
||||
|
||||
# Create GitHub release
|
||||
changelog_file = REPO_ROOT / ".release_notes.md"
|
||||
changelog_file.write_text(changelog, encoding="utf-8")
|
||||
|
|
@ -2657,7 +2578,6 @@ def main():
|
|||
"--title", f"Hermes Agent v{new_version} ({calver_date})",
|
||||
"--notes-file", str(changelog_file),
|
||||
]
|
||||
gh_cmd.extend(str(path) for path in artifacts)
|
||||
|
||||
gh_bin = shutil.which("gh")
|
||||
if gh_bin:
|
||||
|
|
@ -2682,9 +2602,9 @@ def main():
|
|||
print(" Tag was created locally. Create the release manually:")
|
||||
print(
|
||||
f" gh release create {tag_name} --title 'Hermes Agent v{new_version} ({calver_date})' "
|
||||
f"--notes-file .release_notes.md {' '.join(str(path) for path in artifacts)}"
|
||||
f"--notes-file .release_notes.md"
|
||||
)
|
||||
print(f"\n ✓ Release artifacts prepared for manual publish: v{new_version} ({tag_name})")
|
||||
print(f"\n ✓ Release v{new_version} ({tag_name}) prepared for manual publish.")
|
||||
else:
|
||||
print(f"\n{'='*60}")
|
||||
print(" Dry run complete. To publish, add --publish")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue