Skip to content

The agent that grows with you

fix(pm): keep streamed build-backend output without uv's DEBUG spew

ethernetfdf9cebe2cf2
diff --git a/pm/environment.py b/pm/environment.py
index 3c4c63840aa..fa8e17aa078 100644
--- a/pm/environment.py
+++ b/pm/environment.py
@@ -262,9 +262,12 @@ class PythonEnvironment:
command.append("--offline")
try:
if self.output is not None:
- # 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.
+ # uv hides build-backend output until failure without verbose mode,
+ # but --verbose alone is uv's DEBUG level: ~200 lines of interpreter
+ # and cache internals on every streamed run. RUST_LOG scopes it to the
+ # build frontend, so only the backend's own lines reach the user.
+ command.append("--verbose")
+ env.setdefault("RUST_LOG", "uv_build_frontend=debug")
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 e854602a780..5983ede6075 100644
--- a/tests/pm/test_index_bridging.py
+++ b/tests/pm/test_index_bridging.py
@@ -57,15 +57,19 @@ def test_streamed_runs_do_not_request_uv_debug_output(tmp_path, monkeypatch):
from pm import environment
seen: list[list[str]] = []
+ kwargs_seen: list[dict] = []
def record(command, **kwargs):
seen.append(command)
+ kwargs_seen.append(kwargs)
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])
+ (command,), (kwargs,) = seen, kwargs_seen
+ # Verbose only where the build backend speaks; uv's own DEBUG stays silent.
+ assert "--verbose" in command and kwargs["env"]["RUST_LOG"] == "uv_build_frontend=debug"
def test_uv_timeout_names_the_mirror_knobs(tmp_path, monkeypatch):