mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-27 11:22:03 +00:00
fix(update): avoid source-building uv on Termux
This commit is contained in:
parent
6e88f7b6f7
commit
3e508363f7
2 changed files with 37 additions and 1 deletions
|
|
@ -109,6 +109,36 @@ class TestCmdUpdatePip:
|
|||
assert "env" not in mock_run.call_args.kwargs
|
||||
|
||||
|
||||
class TestCmdUpdateTermuxUvBootstrap:
|
||||
"""Regression tests for Termux-specific uv bootstrap behavior."""
|
||||
|
||||
@patch("shutil.which", return_value=None)
|
||||
@patch("subprocess.run")
|
||||
def test_termux_uv_bootstrap_uses_binary_only_install(
|
||||
self, mock_run, _mock_which, monkeypatch
|
||||
):
|
||||
from hermes_cli import main as hm
|
||||
|
||||
mock_run.return_value = subprocess.CompletedProcess([], 1, stdout="", stderr="")
|
||||
monkeypatch.setattr(hm, "_is_termux_env", lambda env=None: True)
|
||||
|
||||
uv_bin = hm._ensure_uv_for_termux(["/termux/python", "-m", "pip"])
|
||||
|
||||
assert uv_bin is None
|
||||
assert mock_run.call_count == 1
|
||||
assert mock_run.call_args.args[0] == [
|
||||
"/termux/python",
|
||||
"-m",
|
||||
"pip",
|
||||
"install",
|
||||
"uv",
|
||||
"--only-binary",
|
||||
":all:",
|
||||
]
|
||||
assert mock_run.call_args.kwargs["cwd"] == PROJECT_ROOT
|
||||
assert mock_run.call_args.kwargs["check"] is False
|
||||
|
||||
|
||||
class TestCmdUpdateBranchFallback:
|
||||
"""cmd_update falls back to main when current branch has no remote counterpart."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue