Skip to content

Commit

Permalink
Avoid treating direct path archives as always dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jun 12, 2024
1 parent 16b4a88 commit 77f7d1b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/uv-installer/src/satisfies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ impl RequirementSatisfaction {
}

// Does the package have dynamic metadata?
if is_dynamic(requested_path) {
// TODO(charlie): Separate `RequirementSource` into `Path` and `Directory`.
if requested_path.is_dir() && is_dynamic(requested_path) {
trace!("Dynamic");
return Ok(Self::Dynamic);
}

Expand Down
14 changes: 14 additions & 0 deletions crates/uv/tests/pip_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,20 @@ fn install_local_wheel() -> Result<()> {
"###
);

// Reinstall into the same virtual environment. The wheel should _not_ be reinstalled.
uv_snapshot!(context.filters(), sync_without_exclude_newer(&context)
.arg("requirements.txt")
.arg("--strict"), @r###"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Resolved 1 package in [TIME]
Audited 1 package in [TIME]
"###
);

context.assert_command("import tomli").success();

Ok(())
Expand Down

0 comments on commit 77f7d1b

Please sign in to comment.