Use common routines for pip install and pip sync (#3737)

## Summary

This PR takes the functions used in `pip install`, moves them into a
common module, and then replaces all the `pip sync` logic with calls
into those functions. The net effect is that `pip install` and `pip
sync` share far more code and demonstrate much more consistent behavior.

Closes https://github.com/astral-sh/uv/issues/3555.
This commit is contained in:
Charlie Marsh 2024-05-22 12:15:17 -04:00 committed by GitHub
parent b8ef436c42
commit 0313e7d78b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 1078 additions and 1031 deletions

View file

@ -44,9 +44,10 @@ impl Reinstall {
}
/// Whether to allow package upgrades.
#[derive(Debug, Clone)]
#[derive(Debug, Default, Clone)]
pub enum Upgrade {
/// Prefer pinned versions from the existing lockfile, if possible.
#[default]
None,
/// Allow package upgrades for all packages, ignoring the existing lockfile.