Skip to content

Commit

Permalink
Remove extraneous installations in uv sync by default (#4366)
Browse files Browse the repository at this point in the history
## Summary

First step of #4358. `uv sync`
will now remove any extraneous installations by default.
  • Loading branch information
ibraheemdev committed Jun 17, 2024
1 parent 47d3834 commit 05d79f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/uv/src/commands/project/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub(super) async fn do_sync(
pip::operations::install(
&resolution,
site_packages,
Modifications::Sufficient,
Modifications::Exact,
reinstall,
build_options,
*link_mode,
Expand Down
15 changes: 12 additions & 3 deletions crates/uv/tests/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,13 @@ fn remove_registry() -> Result<()> {
warning: `uv remove` is experimental and may change without warning.
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Uninstalled 1 package in [TIME]
Uninstalled 4 packages in [TIME]
Installed 1 package in [TIME]
- anyio==3.7.0
- idna==3.6
- project==0.1.0 (from file://[TEMP_DIR]/)
+ project==0.1.0 (from file://[TEMP_DIR]/)
- sniffio==1.3.1
"###);

let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?;
Expand Down Expand Up @@ -808,10 +811,13 @@ fn remove_dev() -> Result<()> {
warning: `uv remove` is experimental and may change without warning.
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Uninstalled 1 package in [TIME]
Uninstalled 4 packages in [TIME]
Installed 1 package in [TIME]
- anyio==3.7.0
- idna==3.6
- project==0.1.0 (from file://[TEMP_DIR]/)
+ project==0.1.0 (from file://[TEMP_DIR]/)
- sniffio==1.3.1
"###);

let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?;
Expand Down Expand Up @@ -917,10 +923,13 @@ fn remove_all_registry() -> Result<()> {
warning: `uv remove` is experimental and may change without warning.
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Uninstalled 1 package in [TIME]
Uninstalled 4 packages in [TIME]
Installed 1 package in [TIME]
- anyio==3.7.0
- idna==3.6
- project==0.1.0 (from file://[TEMP_DIR]/)
+ project==0.1.0 (from file://[TEMP_DIR]/)
- sniffio==1.3.1
"###);

let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?;
Expand Down

0 comments on commit 05d79f8

Please sign in to comment.