Skip to content

Commit

Permalink
Always display absolute paths in uv python find (#6522)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Aug 23, 2024
1 parent 44e2c62 commit 2ee9276
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
5 changes: 4 additions & 1 deletion crates/uv/src/commands/python/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ pub(crate) async fn find(
cache,
)?;

println!("{}", python.interpreter().sys_executable().user_display());
println!(
"{}",
python.interpreter().sys_executable().simplified_display()
);

Ok(ExitStatus::Success)
}
13 changes: 5 additions & 8 deletions crates/uv/tests/python_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,20 @@ fn python_find_venv() {
.with_filtered_virtualenv_bin();

// Create a virtual environment
uv_snapshot!(context.filters(), context.venv().arg("--python").arg("3.12"), @r###"
uv_snapshot!(context.filters(), context.venv().arg("--python").arg("3.12").arg("-q"), @r###"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Using Python 3.12.[X] interpreter at: [PYTHON-3.12]
Creating virtualenv at: .venv
Activate with: source .venv/[BIN]/activate
"###);

// We should find it first
uv_snapshot!(context.filters(), context.python_find(), @r###"
success: true
exit_code: 0
----- stdout -----
.venv/[BIN]/python3
[VENV]/[BIN]/python3
----- stderr -----
"###);
Expand All @@ -279,7 +276,7 @@ fn python_find_venv() {
success: true
exit_code: 0
----- stdout -----
.venv/[BIN]/python3
[VENV]/[BIN]/python3
----- stderr -----
"###);
Expand Down Expand Up @@ -345,7 +342,7 @@ fn python_find_venv() {
success: true
exit_code: 0
----- stdout -----
.venv/[BIN]/python3
[TEMP_DIR]/child/.venv/[BIN]/python3
----- stderr -----
"###);
Expand All @@ -368,7 +365,7 @@ fn python_find_venv() {
success: true
exit_code: 0
----- stdout -----
child/.venv/[BIN]/python3
[TEMP_DIR]/child/.venv/[BIN]/python3
----- stderr -----
"###);
Expand Down

0 comments on commit 2ee9276

Please sign in to comment.