-
-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
rye fetch --force
to re-fetch a toolchain (#778)
- Loading branch information
Showing
7 changed files
with
66 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ Fetch a specific version of Python: | |
$ rye fetch 3.8.13 | ||
Downloading [email protected] | ||
Checking checksum | ||
success: Downloaded [email protected] | ||
Unpacking | ||
Downloaded [email protected] | ||
``` | ||
|
||
To fetch the pinned version of Python you can leave out the argument: | ||
|
@@ -20,7 +21,8 @@ To fetch the pinned version of Python you can leave out the argument: | |
$ rye fetch | ||
Downloading [email protected] | ||
Checking checksum | ||
success: Downloaded [email protected] | ||
Unpacking | ||
Downloaded [email protected] | ||
``` | ||
|
||
## Arguments | ||
|
@@ -31,6 +33,8 @@ success: Downloaded [email protected] | |
|
||
## Options | ||
|
||
* `-f, --force`: Fetch the Python toolchain even if it is already installed. | ||
|
||
* `-v, --verbose`: Enables verbose diagnostics | ||
|
||
* `-q, --quiet`: Turns off all output | ||
|
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use crate::common::{rye_cmd_snapshot, Space}; | ||
|
||
mod common; | ||
|
||
#[test] | ||
fn test_fetch() { | ||
let space = Space::new(); | ||
// Use a version not in use by other tests and will be supported for a long time. | ||
let version = "[email protected]"; | ||
|
||
// Make sure the version is installed. | ||
let status = space.rye_cmd().arg("fetch").arg(version).status().unwrap(); | ||
assert!(status.success()); | ||
|
||
// Fetching the same version again should be a no-op. | ||
rye_cmd_snapshot!(space.rye_cmd().arg("fetch").arg(version).arg("--verbose"), @r###" | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
Python version already downloaded. Skipping. | ||
----- stderr ----- | ||
"###); | ||
|
||
// Fetching the same version again with --force should re-download it. | ||
rye_cmd_snapshot!(space.rye_cmd().arg("fetch").arg(version).arg("--force"), @r###" | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
Removing the existing Python version | ||
Downloading [email protected] | ||
Checking checksum | ||
Unpacking | ||
Downloaded [email protected] | ||
----- stderr ----- | ||
"###); | ||
} |