forked from astral-sh/rye
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cp-publish-twine
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use std::fs; | ||
|
||
use toml_edit::{value, ArrayOfTables, Table}; | ||
|
||
use crate::common::{rye_cmd_snapshot, Space}; | ||
|
@@ -86,3 +88,46 @@ fn test_add_from_find_links() { | |
+ tqdm==4.66.1 | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_add_flask_wrong_venv_exported() { | ||
let space = Space::new(); | ||
space.init("my-project"); | ||
let fake_venv = space.project_path().join("fake-venv"); | ||
fs::create_dir_all(&fake_venv).unwrap(); | ||
// add colorama to ensure we have this as a dependency on all platforms | ||
rye_cmd_snapshot!(space.rye_cmd().arg("add").arg("flask==3.0.0").arg("colorama").env("VIRTUAL_ENV", fake_venv.as_os_str()), @r###" | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
Initializing new virtualenv in [TEMP_PATH]/project/.venv | ||
Python version: [email protected] | ||
Added colorama>=0.4.6 as regular dependency | ||
Added flask>=3.0.0 as regular dependency | ||
Reusing already existing virtualenv | ||
Generating production lockfile: [TEMP_PATH]/project/requirements.lock | ||
Generating dev lockfile: [TEMP_PATH]/project/requirements-dev.lock | ||
Installing dependencies | ||
Done! | ||
----- stderr ----- | ||
Built 1 editable in [EXECUTION_TIME] | ||
Resolved 9 packages in [EXECUTION_TIME] | ||
Built 1 editable in [EXECUTION_TIME] | ||
Resolved 9 packages in [EXECUTION_TIME] | ||
Built 1 editable in [EXECUTION_TIME] | ||
Resolved 8 packages in [EXECUTION_TIME] | ||
Downloaded 8 packages in [EXECUTION_TIME] | ||
Installed 9 packages in [EXECUTION_TIME] | ||
+ blinker==1.7.0 | ||
+ click==8.1.7 | ||
+ colorama==0.4.6 | ||
+ flask==3.0.0 | ||
+ itsdangerous==2.1.2 | ||
+ jinja2==3.1.2 | ||
+ markupsafe==2.1.3 | ||
+ my-project==0.1.0 (from file:[TEMP_PATH]/project) | ||
+ werkzeug==3.0.1 | ||
"###); | ||
fs::remove_dir_all(&fake_venv).unwrap(); | ||
} |