Hermes pins every one of its ~120 dependencies with == and declares Requires-Python >=3.11,<3.14, so it can neither be built against Arch's Python 3.14 nor share the python-* packages, and Arch's next Python bump would break any venv this package built. So it ships a wrapper instead and lets mise give Hermes a private environment -- the arrangement omarchy-mise-install already makes for the other coding agents. Two things the wrapper has to work around. mise reads [...] as its own tool options rather than as Python extras, so the extras have to be spelled [extras=all]; written [all] they are dropped without a word and the install comes out byte-identical to a bare one. And given no compatible interpreter to hand, uv builds the venv against the system Python in violation of Hermes' own bound, reports success, and leaves the breakage to surface later inside some dependency. The interpreter is therefore pinned on install and re-checked on every run, since mise up reinstalls without the pin. The icon is upstream's own 1024x1024 app icon -- the mark the site serves as its favicon -- downscaled at build time so menus don't smudge it themselves.
47 lines
1.8 KiB
Bash
Executable File
47 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Hermes is a Python application that pins every one of its dependencies
|
|
# exactly and declares Requires-Python >=3.11,<3.14, so it cannot be built
|
|
# against Arch's Python or share the python-* packages. mise builds it a
|
|
# private environment instead, on first run and on demand.
|
|
#
|
|
# The interpreter pin below is not belt-and-braces. Given no compatible
|
|
# interpreter to hand, uv builds the venv against the system Python in
|
|
# violation of Hermes' own bound, reports success, and leaves the failure to
|
|
# surface later inside a dependency.
|
|
|
|
set -euo pipefail
|
|
|
|
readonly tool='pipx:hermes-agent[extras=all]'
|
|
readonly python="${HERMES_PYTHON:-3.13}"
|
|
|
|
export UV_PYTHON="$python"
|
|
|
|
# `mise up` -- which omarchy update runs -- reinstalls without this wrapper's
|
|
# UV_PYTHON, so an upgrade can quietly move Hermes onto the system Python.
|
|
# Check the interpreter that is actually there, not merely that something is.
|
|
hermes_installed_on_pinned_python() {
|
|
local prefix
|
|
prefix=$(mise where "$tool" 2>/dev/null) || return 1
|
|
[[ -d "$prefix/hermes-agent/lib/python$python" ]]
|
|
}
|
|
|
|
if ! hermes_installed_on_pinned_python; then
|
|
echo "Installing Hermes on Python $python (this takes a minute)..." >&2
|
|
|
|
# Hermes ships several times a week, so mise's release cooldown would hold a
|
|
# new version back for days. Same call omarchy-mise-install makes.
|
|
MISE_MINIMUM_RELEASE_AGE=0 mise use -g --quiet --force "$tool" || exit 1
|
|
fi
|
|
|
|
# Installed as /usr/bin/hermes, with hermes-agent and hermes-acp symlinked to
|
|
# it, so the name we were invoked under picks the entry point. Anything else --
|
|
# someone running this file straight out of a checkout -- means hermes.
|
|
command=$(basename "$0")
|
|
case "$command" in
|
|
hermes | hermes-agent | hermes-acp) ;;
|
|
*) command='hermes' ;;
|
|
esac
|
|
|
|
exec mise x "$tool" -- "$command" "$@"
|