Skip to content

Commit

Permalink
Add test case for wheel installation with different path (#4396)
Browse files Browse the repository at this point in the history
Regression test for #4391 / #4393
  • Loading branch information
zanieb committed Jun 19, 2024
1 parent f219f88 commit 549d7df
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions crates/uv/tests/pip_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
Binary file added scripts/links/ok-1.0.0-py3-none-any.whl
Binary file not shown.
Binary file added scripts/links/ok-2.0.0-py3-none-any.whl
Binary file not shown.

0 comments on commit 549d7df

Please sign in to comment.