Allow uv pip sync to clear an environment with opt-in (#4517)

Closes https://github.com/astral-sh/uv/issues/4516

Open to some deliberation about the opt-in strategy here.
This commit is contained in:
Zanie Blue 2024-07-02 09:14:27 -04:00 committed by GitHub
parent d9f389a58d
commit 2c0cb6e021
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 116 additions and 7 deletions

View file

@ -826,6 +826,13 @@ pub struct PipSyncArgs {
#[arg(long, conflicts_with = "no_build")]
pub only_binary: Option<Vec<PackageNameSpecifier>>,
/// Allow sync of empty requirements, which will clear the environment of all packages.
#[arg(long, overrides_with("no_allow_empty_requirements"))]
pub allow_empty_requirements: bool,
#[arg(long, overrides_with("allow_empty_requirements"))]
pub no_allow_empty_requirements: bool,
/// The minimum Python version that should be supported by the requirements (e.g.,
/// `3.7` or `3.7.9`).
///