From 022036b0aaab2ffb257dc9ab9682eb95ec4900a4 Mon Sep 17 00:00:00 2001 From: Alex Maksimchuk Date: Wed, 15 Apr 2026 08:23:19 -0500 Subject: [PATCH] fix(update): use [termux] extras group on Android `hermes update` always installs `.[all]`, which pulls in heavy C-extension packages (faster-whisper, discord.py[voice], mautrix) that require source compilation on ARM. On a Pixel 8a this hangs pip for 30+ minutes before eventually failing. The install scripts (setup-hermes.sh, scripts/install.sh) already detect Termux and use `.[termux]` + constraints-termux.txt, but the Python update path in _install_python_dependencies_with_optional_fallback was never wired up. This commit reuses the existing hermes_constants.is_termux() to select the right extras group and constraint file at update time. --- hermes_cli/main.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index b45c9abb8d..b6ed91e035 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -3572,10 +3572,24 @@ def _install_python_dependencies_with_optional_fallback( *, env: dict[str, str] | None = None, ) -> None: - """Install base deps plus as many optional extras as the environment supports.""" + """Install base deps plus as many optional extras as the environment supports. + + On Termux/Android, uses the ``[termux]`` extras group and + ``constraints-termux.txt`` instead of ``[all]`` to avoid pulling in + heavy C-extension packages (voice, matrix, messaging) that require + source compilation on ARM and can hang for 30+ minutes. + """ + from hermes_constants import is_termux as _is_termux + + extras_group = "termux" if _is_termux() else "all" + install_args = ["install", "-e", f".[{extras_group}]", "--quiet"] + if _is_termux(): + constraints = PROJECT_ROOT / "constraints-termux.txt" + if constraints.exists(): + install_args += ["-c", str(constraints)] try: subprocess.run( - install_cmd_prefix + ["install", "-e", ".[all]", "--quiet"], + install_cmd_prefix + install_args, cwd=PROJECT_ROOT, check=True, env=env,