fix(pm): stop passing --verbose to streamed uv runs
--verbose is uv's DEBUG level: every first-run bootstrap and sync printed ~200 lines of interpreter discovery, cache and reflink internals to the user. Progress lines and build failures reach stderr without it.
This commit is contained in:
@@ -262,8 +262,9 @@ class PythonEnvironment:
|
||||
command.append("--offline")
|
||||
try:
|
||||
if self.output is not None:
|
||||
# uv hides build-backend output until failure without verbose mode.
|
||||
command.append("--verbose")
|
||||
# No --verbose: it is uv's DEBUG level and buries the progress
|
||||
# lines under interpreter/cache internals on every streamed run.
|
||||
# Build-backend output still arrives with the failure.
|
||||
return _run_streaming(command, cwd=cwd, env=env, timeout=timeout, output=self.output)
|
||||
return subprocess.run(command, cwd=str(cwd), env=env, capture_output=True,
|
||||
text=True, encoding="utf-8", errors="replace", timeout=timeout)
|
||||
|
||||
@@ -52,6 +52,22 @@ def test_pip_conf_is_bridged_only_when_uv_has_no_index(clean_index_env, monkeypa
|
||||
assert "UV_INDEX_URL" not in env
|
||||
|
||||
|
||||
def test_streamed_runs_do_not_request_uv_debug_output(tmp_path, monkeypatch):
|
||||
import io
|
||||
from pm import environment
|
||||
|
||||
seen: list[list[str]] = []
|
||||
|
||||
def record(command, **kwargs):
|
||||
seen.append(command)
|
||||
return subprocess.CompletedProcess(command, 0, "", "")
|
||||
|
||||
monkeypatch.setattr(environment, "_run_streaming", record)
|
||||
PythonEnvironment(uv=tmp_path / "uv", python=tmp_path / "python", destination=tmp_path / "venv",
|
||||
cache=tmp_path / "cache", env={}, output=io.StringIO())._run(["sync"], cwd=tmp_path, timeout=5)
|
||||
assert seen and not {"--verbose", "-v"} & set(seen[0])
|
||||
|
||||
|
||||
def test_uv_timeout_names_the_mirror_knobs(tmp_path, monkeypatch):
|
||||
def stall(*args, **kwargs):
|
||||
raise subprocess.TimeoutExpired(args[0], kwargs["timeout"])
|
||||
|
||||
Reference in New Issue
Block a user