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:
@@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user