From 8a02f6352a75a532caca5a6ca4ec93617a548958 Mon Sep 17 00:00:00 2001 From: Yusuf Bham Date: Fri, 16 Jan 2026 08:50:43 -0500 Subject: [PATCH] Add `-t` shortform for `--target` to `uv pip` subcommands (#17501) ## Summary This adds `-t` to `uv pip` to preserve drop-in compatibility with pip's `-t` shortform Closes #17495 ## Test Plan Just interactively checked to make sure it works in the same places as `--test` ```bash uv pip install -t test ansible uv pip list -t test echo 'ansible' > requirements.txt uv pip sync -t test requirements.txt ``` --- crates/uv-cli/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 577edef9b..6befc34b9 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -1919,7 +1919,7 @@ pub struct PipSyncArgs { /// environment and only searches for a Python interpreter to use for package resolution. /// If a suitable Python interpreter cannot be found, uv will install one. /// To disable this, add `--no-python-downloads`. - #[arg(long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] + #[arg(short = 't', long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] pub target: Option, /// Install packages into `lib`, `bin`, and other top-level folders under the specified @@ -2296,7 +2296,7 @@ pub struct PipInstallArgs { /// environment and only searches for a Python interpreter to use for package resolution. /// If a suitable Python interpreter cannot be found, uv will install one. /// To disable this, add `--no-python-downloads`. - #[arg(long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] + #[arg(short = 't', long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] pub target: Option, /// Install packages into `lib`, `bin`, and other top-level folders under the specified @@ -2512,7 +2512,7 @@ pub struct PipUninstallArgs { pub no_break_system_packages: bool, /// Uninstall packages from the specified `--target` directory. - #[arg(long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] + #[arg(short = 't', long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] pub target: Option, /// Uninstall packages from the specified `--prefix` directory. @@ -2579,7 +2579,7 @@ pub struct PipFreezeArgs { pub no_system: bool, /// List packages from the specified `--target` directory. - #[arg(long, conflicts_with_all = ["prefix", "paths"], value_hint = ValueHint::DirPath)] + #[arg(short = 't', long, conflicts_with_all = ["prefix", "paths"], value_hint = ValueHint::DirPath)] pub target: Option, /// List packages from the specified `--prefix` directory. @@ -2663,7 +2663,7 @@ pub struct PipListArgs { pub no_system: bool, /// List packages from the specified `--target` directory. - #[arg(long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] + #[arg(short = 't', long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] pub target: Option, /// List packages from the specified `--prefix` directory. @@ -2789,7 +2789,7 @@ pub struct PipShowArgs { pub no_system: bool, /// Show a package from the specified `--target` directory. - #[arg(long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] + #[arg(short = 't', long, conflicts_with = "prefix", value_hint = ValueHint::DirPath)] pub target: Option, /// Show a package from the specified `--prefix` directory.