Remove extraneous installations in uv sync by default (#4366)

## Summary

First step of https://github.com/astral-sh/uv/issues/4358. `uv sync`
will now remove any extraneous installations by default.
This commit is contained in:
Ibraheem Ahmed
2024-06-17 14:38:34 -04:00
committed by GitHub
parent 47d3834fd3
commit 05d79f8d38
2 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -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,
+12 -3
View File
@@ -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"))?;
@@ -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"))?;
@@ -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"))?;