-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
) ## Summary The idea here is that we hide all resolver output (the grayed out resolver messages, plus the list of environment modifications) by default in `uv run` and `uv tool run`. You can pass `--show-resolution` to re-enable them. Closes #5458.
- Loading branch information
1 parent
f7494f2
commit d6c319a
Showing
9 changed files
with
125 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,12 +139,12 @@ fn tool_run_at_version() { | |
|
||
// When `--from` is used, `@` is not treated as a version request | ||
uv_snapshot!(filters, context.tool_run() | ||
.arg("--from") | ||
.arg("pytest") | ||
.arg("[email protected]") | ||
.arg("--version") | ||
.env("UV_TOOL_DIR", tool_dir.as_os_str()) | ||
.env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" | ||
.arg("--from") | ||
.arg("pytest") | ||
.arg("[email protected]") | ||
.arg("--version") | ||
.env("UV_TOOL_DIR", tool_dir.as_os_str()) | ||
.env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
|
@@ -262,13 +262,13 @@ fn tool_run_warn_executable_not_in_from() { | |
filters.push(("(?s)fastapi` instead.*", "fastapi` instead.")); | ||
|
||
uv_snapshot!(filters, context.tool_run() | ||
.arg("--from") | ||
.arg("fastapi") | ||
.arg("fastapi") | ||
.env("UV_EXCLUDE_NEWER", "2024-05-04T00:00:00Z") // TODO: Remove this once EXCLUDE_NEWER is bumped past 2024-05-04 | ||
// (FastAPI 0.111 is only available from this date onwards) | ||
.env("UV_TOOL_DIR", tool_dir.as_os_str()) | ||
.env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" | ||
.arg("--from") | ||
.arg("fastapi") | ||
.arg("fastapi") | ||
.env("UV_EXCLUDE_NEWER", "2024-05-04T00:00:00Z") // TODO: Remove this once EXCLUDE_NEWER is bumped past 2024-05-04 | ||
// (FastAPI 0.111 is only available from this date onwards) | ||
.env("UV_TOOL_DIR", tool_dir.as_os_str()) | ||
.env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
|
@@ -811,3 +811,27 @@ fn tool_run_list_installed() { | |
warning: `uv tool run` is experimental and may change without warning | ||
"###); | ||
} | ||
|
||
/// By default, omit resolver and installer output. | ||
#[test] | ||
fn tool_run_without_output() { | ||
let context = TestContext::new("3.12").with_filtered_counts(); | ||
let tool_dir = context.temp_dir.child("tools"); | ||
let bin_dir = context.temp_dir.child("bin"); | ||
|
||
uv_snapshot!(context.filters(), context.tool_run() | ||
.env_remove("UV_SHOW_RESOLUTION") | ||
.arg("--") | ||
.arg("pytest") | ||
.arg("--version") | ||
.env("UV_TOOL_DIR", tool_dir.as_os_str()) | ||
.env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
pytest 8.1.1 | ||
----- stderr ----- | ||
warning: `uv tool run` is experimental and may change without warning | ||
"###); | ||
} |