From dc5ef1ac8ed9927bdf8e64749faa6b064f5c789e Mon Sep 17 00:00:00 2001 From: adybag14-cyber <252811164+adybag14-cyber@users.noreply.github.com> Date: Thu, 7 May 2026 19:38:52 +0100 Subject: [PATCH] fix: add termux-all install profile and safe fallbacks --- pyproject.toml | 25 ++++++++++++++++++++++--- scripts/install.sh | 23 +++++++++++++++-------- tests/test_termux_all_extra_compat.py | 23 +++++++++++++++++++++++ 3 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 tests/test_termux_all_extra_compat.py diff --git a/pyproject.toml b/pyproject.toml index 29010c09a1..bbc786b980 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,9 +68,7 @@ acp = ["agent-client-protocol>=0.9.0,<1.0"] mistral = ["mistralai>=2.3.0,<3"] bedrock = ["boto3>=1.35.0,<2"] termux = [ - # Tested Android / Termux path: keeps the core CLI feature-rich while - # avoiding extras that currently depend on non-Android wheels (notably - # faster-whisper -> ctranslate2 via the voice extra). + # Baseline Android / Termux path for reliable fresh installs. "python-telegram-bot[webhooks]>=22.6,<23", "hermes-agent[cron]", "hermes-agent[cli]", @@ -79,6 +77,27 @@ termux = [ "hermes-agent[honcho]", "hermes-agent[acp]", ] +termux-all = [ + # Best-effort "install all" profile for Termux: include broad extras that + # are known to resolve on Android, while intentionally excluding extras that + # currently hard-fail from missing/broken Android wheels/toolchains. + # + # Excluded for now: + # - matrix (mautrix[encryption] -> python-olm build failures on Termux) + # - voice (faster-whisper chain requires ctranslate2/av builds not packaged) + "hermes-agent[termux]", + "hermes-agent[messaging]", + "hermes-agent[slack]", + "hermes-agent[tts-premium]", + "hermes-agent[dingtalk]", + "hermes-agent[feishu]", + "hermes-agent[google]", + "hermes-agent[mistral]", + "hermes-agent[bedrock]", + "hermes-agent[homeassistant]", + "hermes-agent[sms]", + "hermes-agent[web]", +] dingtalk = ["dingtalk-stream>=0.20,<1", "alibabacloud-dingtalk>=2.0.0", "qrcode>=7.0,<8"] feishu = ["lark-oapi>=1.5.3,<2", "qrcode>=7.0,<8"] google = [ diff --git a/scripts/install.sh b/scripts/install.sh index 707951f4cd..ab305544bd 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -980,17 +980,24 @@ install_deps() { fi "$PIP_PYTHON" -m pip install --upgrade pip setuptools wheel >/dev/null - if ! "$PIP_PYTHON" -m pip install -e '.[termux]' -c constraints-termux.txt; then - log_warn "Termux feature install (.[termux]) failed, trying base install..." - if ! "$PIP_PYTHON" -m pip install -e '.' -c constraints-termux.txt; then - log_error "Package installation failed on Termux." - log_info "Ensure these packages are installed: pkg install clang rust make pkg-config libffi openssl" - log_info "Then re-run: cd $INSTALL_DIR && python -m pip install -e '.[termux]' -c constraints-termux.txt" - exit 1 + + # Try the broad Termux profile first (best-effort "install all" for Android), + # then fall back to the conservative Termux baseline, then base package. + if ! "$PIP_PYTHON" -m pip install -e '.[termux-all]' -c constraints-termux.txt; then + log_warn "Termux broad profile (.[termux-all]) failed, trying baseline Termux profile..." + if ! "$PIP_PYTHON" -m pip install -e '.[termux]' -c constraints-termux.txt; then + log_warn "Termux baseline profile (.[termux]) failed, trying base install..." + if ! "$PIP_PYTHON" -m pip install -e '.' -c constraints-termux.txt; then + log_error "Package installation failed on Termux." + log_info "Ensure these packages are installed: pkg install clang rust make pkg-config libffi openssl ca-certificates curl" + log_info "Then re-run: cd $INSTALL_DIR && python -m pip install -e '.[termux-all]' -c constraints-termux.txt" + exit 1 + fi fi fi log_success "Main package installed" + log_info "Termux note: matrix e2ee and local faster-whisper extras are excluded from .[termux-all] due to upstream Android wheel/toolchain blockers." log_info "Termux note: browser/WhatsApp tooling is not installed by default; see the Termux guide for optional follow-up steps." if [ -d "tinker-atropos" ] && [ -f "tinker-atropos/pyproject.toml" ]; then @@ -1082,7 +1089,7 @@ setup_path() { log_warn "hermes entry point not found at $HERMES_BIN" log_info "This usually means the pip install didn't complete successfully." if [ "$DISTRO" = "termux" ]; then - log_info "Try: cd $INSTALL_DIR && python -m pip install -e '.[termux]' -c constraints-termux.txt" + log_info "Try: cd $INSTALL_DIR && python -m pip install -e '.[termux-all]' -c constraints-termux.txt" else log_info "Try: cd $INSTALL_DIR && uv pip install -e '.[all]'" fi diff --git a/tests/test_termux_all_extra_compat.py b/tests/test_termux_all_extra_compat.py new file mode 100644 index 0000000000..0a1ee11aae --- /dev/null +++ b/tests/test_termux_all_extra_compat.py @@ -0,0 +1,23 @@ +"""Regression coverage for the Termux broad install profile.""" + +from pathlib import Path + + +REPO_ROOT = Path(__file__).resolve().parent.parent +PYPROJECT = REPO_ROOT / "pyproject.toml" +INSTALL_SH = REPO_ROOT / "scripts" / "install.sh" + + +def test_pyproject_defines_termux_all_without_known_blockers() -> None: + text = PYPROJECT.read_text() + assert "termux-all = [" in text + assert '"hermes-agent[termux]"' in text + assert '"hermes-agent[matrix]"' not in text.split("termux-all = [", 1)[1].split("]", 1)[0] + assert '"hermes-agent[voice]"' not in text.split("termux-all = [", 1)[1].split("]", 1)[0] + + +def test_install_script_prefers_termux_all_then_fallbacks() -> None: + text = INSTALL_SH.read_text() + assert "pip install -e '.[termux-all]' -c constraints-termux.txt" in text + assert "Termux broad profile (.[termux-all]) failed, trying baseline Termux profile..." in text + assert "Termux baseline profile (.[termux]) failed, trying base install..." in text