From 2bdb7d338c475f428960f5c6dbd179b239102e4f Mon Sep 17 00:00:00 2001 From: ethernet Date: Mon, 21 Sep 2026 18:46:41 -0400 Subject: [PATCH] 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. --- pm/environment.py | 5 +++-- tests/pm/test_index_bridging.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pm/environment.py b/pm/environment.py index 0b7c4ff211..3c4c63840a 100644 --- a/pm/environment.py +++ b/pm/environment.py @@ -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) diff --git a/tests/pm/test_index_bridging.py b/tests/pm/test_index_bridging.py index 0f742d8bd1..e854602a78 100644 --- a/tests/pm/test_index_bridging.py +++ b/tests/pm/test_index_bridging.py @@ -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"])