fix(platforms): QR fallback tip names Hermes' own uv when it is not on PATH

The installer drops uv in $HERMES_HOME/bin without exporting it, so the
bare `uv pip install --python ...` tip failed with `uv: command not found`
for installer-only users. The four copies of the tip (QQ Bot, Feishu, WeCom,
managed Telegram bot) now render through one helper, managed_uv.pip_install_hint,
which names the managed binary when present and falls back to `uv` otherwise.
This commit is contained in:
teknium1
2026-09-15 15:15:11 -07:00
committed by Teknium
parent c2b93ae5ac
commit 6062ad5aee
6 changed files with 32 additions and 7 deletions
+15
View File
@@ -184,6 +184,21 @@ class TestResolveUv:
assert resolve_uv() is None
class TestPipInstallHint:
def test_names_the_managed_uv_when_present(self, tmp_path):
uv = tmp_path / "bin" / _UV_BINARY_NAME
_make_executable(uv)
with patch("hermes_cli.managed_uv.get_hermes_home", return_value=tmp_path):
from hermes_cli.managed_uv import pip_install_hint
assert pip_install_hint("qrcode") == f"{uv} pip install --python {sys.executable} qrcode"
def test_falls_back_to_bare_uv_when_absent(self, tmp_path):
with patch("hermes_cli.managed_uv.get_hermes_home", return_value=tmp_path):
from hermes_cli.managed_uv import pip_install_hint
assert pip_install_hint("qrcode") == f"uv pip install --python {sys.executable} qrcode"
# ---------------------------------------------------------------------------
# ensure_uv
# ---------------------------------------------------------------------------