Update uv python install --reinstall to reinstall all previous versions (#11072)
Since we're shipping substantive updates to Python versions frequently, I want to lower the bar for reinstalling with the latest distributions. There's a follow-up task that's documented in a test case at https://github.com/astral-sh/uv/pull/11072/files#diff-f499c776e1d8cc5e55d7620786e32e8732b675abd98e246c0971130f5de9ed50R157-R158
This commit is contained in:
@@ -54,7 +54,7 @@ fn python_install() {
|
||||
"###);
|
||||
|
||||
// You can opt-in to a reinstall
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("--reinstall"), @r###"
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("3.13").arg("--reinstall"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
@@ -91,6 +91,82 @@ fn python_install() {
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn python_reinstall() {
|
||||
let context: TestContext = TestContext::new_with_versions(&[])
|
||||
.with_filtered_python_keys()
|
||||
.with_filtered_exe_suffix()
|
||||
.with_managed_python_dirs();
|
||||
|
||||
// Install a couple versions
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("3.12").arg("3.13"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Installed 2 versions in [TIME]
|
||||
+ cpython-3.12.8-[PLATFORM]
|
||||
+ cpython-3.13.1-[PLATFORM]
|
||||
"###);
|
||||
|
||||
// Reinstall a single version
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("3.13").arg("--reinstall"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Installed Python 3.13.1 in [TIME]
|
||||
~ cpython-3.13.1-[PLATFORM]
|
||||
"###);
|
||||
|
||||
// Reinstall multiple versions
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("--reinstall"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Installed 2 versions in [TIME]
|
||||
~ cpython-3.12.8-[PLATFORM]
|
||||
~ cpython-3.13.1-[PLATFORM]
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn python_reinstall_patch() {
|
||||
let context: TestContext = TestContext::new_with_versions(&[])
|
||||
.with_filtered_python_keys()
|
||||
.with_filtered_exe_suffix()
|
||||
.with_managed_python_dirs();
|
||||
|
||||
// Install a couple patch versions
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("3.12.6").arg("3.12.7"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Installed 2 versions in [TIME]
|
||||
+ cpython-3.12.6-[PLATFORM]
|
||||
+ cpython-3.12.7-[PLATFORM]
|
||||
"###);
|
||||
|
||||
// Reinstall all "3.12" versions
|
||||
// TODO(zanieb): This doesn't work today, because we need this to install the "latest" as there
|
||||
// is no workflow for `--upgrade` yet
|
||||
uv_snapshot!(context.filters(), context.python_install().arg("3.12").arg("--reinstall"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Installed Python 3.12.8 in [TIME]
|
||||
+ cpython-3.12.8-[PLATFORM]
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn python_install_automatic() {
|
||||
let context: TestContext = TestContext::new_with_versions(&[])
|
||||
|
||||
Reference in New Issue
Block a user