Add --package argument to uv add and uv remove (#4556)

## Summary

Closes https://github.com/astral-sh/uv/issues/4550.
This commit is contained in:
Charlie Marsh 2024-06-26 13:46:07 -04:00 committed by GitHub
parent 1ee201da5a
commit 963a7b2ab5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 53 additions and 20 deletions

View file

@ -1639,6 +1639,10 @@ pub struct RunArgs {
#[command(flatten)]
pub refresh: RefreshArgs,
/// Run the command in a specific package in the workspace.
#[arg(long, conflicts_with = "isolated")]
pub package: Option<PackageName>,
/// The Python interpreter to use to build the run environment.
///
/// By default, `uv` uses the virtual environment in the current working directory or any parent
@ -1652,10 +1656,6 @@ pub struct RunArgs {
/// - `/home/ferris/.local/bin/python3.10` uses the exact Python at the given path.
#[arg(long, short, env = "UV_PYTHON", verbatim_doc_comment)]
pub python: Option<String>,
/// Run the command in a different package in the workspace.
#[arg(long, conflicts_with = "isolated")]
pub package: Option<PackageName>,
}
#[derive(Args)]
@ -1784,6 +1784,10 @@ pub struct AddArgs {
#[command(flatten)]
pub refresh: RefreshArgs,
/// Add the dependency to a specific package in the workspace.
#[arg(long, conflicts_with = "isolated")]
pub package: Option<PackageName>,
/// The Python interpreter into which packages should be installed.
///
/// By default, `uv` installs into the virtual environment in the current working directory or
@ -1811,6 +1815,10 @@ pub struct RemoveArgs {
#[arg(long)]
pub dev: bool,
/// Remove the dependency from a specific package in the workspace.
#[arg(long, conflicts_with = "isolated")]
pub package: Option<PackageName>,
/// The Python interpreter into which packages should be installed.
///
/// By default, `uv` installs into the virtual environment in the current working directory or