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:
Zanie Blue 2024-06-19 10:39:55 -04:00 committed by GitHub
parent f219f88553
commit 549d7dfe37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 57 additions and 0 deletions

View file

@ -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<()> {

Binary file not shown.

Binary file not shown.