Skip to content

Commit

Permalink
Install versioned Python executables into the bin directory during `u…
Browse files Browse the repository at this point in the history
…v python install`
  • Loading branch information
zanieb committed Oct 28, 2024
1 parent da87bf7 commit 28b6613
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions crates/uv/tests/it/python_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ fn python_install() {
Found existing installation for Python 3.13: cpython-3.13.0-[PLATFORM]
"###);

// You can opt-in to a reinstall
uv_snapshot!(context.filters(), context.python_install().arg("--reinstall"), @r###"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Searching for Python installations
Found: cpython-3.13.0-[PLATFORM]
Installed Python 3.13.0 in [TIME]
~ cpython-3.13.0-[PLATFORM]
warning: `[TEMP_DIR]/bin` is not on your PATH. To use the installed Python executable, run `export PATH="[TEMP_DIR]/bin:$PATH"`.
"###);

// The executable should still be present in the bin directory
bin_python.assert(predicate::path::exists());

// Uninstallation requires an argument
uv_snapshot!(context.filters(), context.python_uninstall(), @r###"
success: false
Expand All @@ -93,25 +110,6 @@ fn python_install() {
Uninstalled Python 3.13.0 in [TIME]
- cpython-3.13.0-[PLATFORM]
"###);

// The executable should still be present in the bin directory
bin_python.assert(predicate::path::exists());

// You can opt-in to a reinstall
uv_snapshot!(context.filters(), context.python_install().arg("--reinstall"), @r###"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Searching for Python installations
Installed Python 3.13.0 in [TIME]
+ cpython-3.13.0-[PLATFORM]
warning: `[TEMP_DIR]/bin` is not on your PATH. To use the installed Python executable, run `export PATH="[TEMP_DIR]/bin:$PATH"`.
"###);

// The executable should still be present in the bin directory
bin_python.assert(predicate::path::exists());
}

#[test]
Expand Down

0 comments on commit 28b6613

Please sign in to comment.