mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Add test case for wheel installation with different path (#4396)
Regression test for #4391 / https://github.com/astral-sh/uv/pull/4393
This commit is contained in:
parent
f219f88553
commit
549d7dfe37
3 changed files with 57 additions and 0 deletions
|
@ -3178,6 +3178,63 @@ requires-python = ">=3.8"
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Install from a direct path (wheel) with changed versions in the path.
|
||||
#[test]
|
||||
fn path_version_change() {
|
||||
let context = TestContext::new("3.12");
|
||||
|
||||
uv_snapshot!(context.filters(), context.install()
|
||||
.arg(context.workspace_root.join("scripts/links/ok-1.0.0-py3-none-any.whl")), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved 1 package in [TIME]
|
||||
Prepared 1 package in [TIME]
|
||||
Installed 1 package in [TIME]
|
||||
+ ok==1.0.0 (from file://[WORKSPACE]/scripts/links/ok-1.0.0-py3-none-any.whl)
|
||||
"###
|
||||
);
|
||||
|
||||
// Installing the same path again should be a no-op
|
||||
uv_snapshot!(context.filters(), context.install()
|
||||
.arg(context.workspace_root.join("scripts/links/ok-1.0.0-py3-none-any.whl")), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Audited 1 package in [TIME]
|
||||
"###
|
||||
);
|
||||
|
||||
// Installing a new path should succeed
|
||||
uv_snapshot!(context.filters(), context.install()
|
||||
.arg(context.workspace_root.join("scripts/links/ok-2.0.0-py3-none-any.whl")), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved 1 package in [TIME]
|
||||
Audited 1 package in [TIME]
|
||||
"###
|
||||
);
|
||||
|
||||
// Installing a new path should succeed regardless of which version is "newer"
|
||||
uv_snapshot!(context.filters(), context.install()
|
||||
.arg(context.workspace_root.join("scripts/links/ok-1.0.0-py3-none-any.whl")), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Audited 1 package in [TIME]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
/// Ignore a URL dependency with a non-matching marker.
|
||||
#[test]
|
||||
fn editable_url_with_marker() -> Result<()> {
|
||||
|
|
BIN
scripts/links/ok-1.0.0-py3-none-any.whl
Normal file
BIN
scripts/links/ok-1.0.0-py3-none-any.whl
Normal file
Binary file not shown.
BIN
scripts/links/ok-2.0.0-py3-none-any.whl
Normal file
BIN
scripts/links/ok-2.0.0-py3-none-any.whl
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue