Support requirements.txt files in uv tool install and uv tool run (#5362)

## Summary

Closes https://github.com/astral-sh/uv/issues/5347.
Closes https://github.com/astral-sh/uv/issues/5348.
This commit is contained in:
Charlie Marsh 2024-07-23 16:06:17 -04:00 committed by GitHub
parent 7ddf67a72b
commit 2cdcc61da9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 234 additions and 42 deletions

View file

@ -2208,10 +2208,14 @@ pub struct ToolRunArgs {
#[arg(long)]
pub from: Option<String>,
/// Include the following extra requirements.
/// Run with the given packages installed.
#[arg(long)]
pub with: Vec<String>,
/// Run with all packages listed in the given `requirements.txt` files.
#[arg(long, value_parser = parse_maybe_file_path)]
pub with_requirements: Vec<Maybe<PathBuf>>,
#[command(flatten)]
pub installer: ResolverInstallerArgs,
@ -2252,6 +2256,10 @@ pub struct ToolInstallArgs {
#[arg(long)]
pub with: Vec<String>,
/// Run all requirements listed in the given `requirements.txt` files.
#[arg(long, value_parser = parse_maybe_file_path)]
pub with_requirements: Vec<Maybe<PathBuf>>,
#[command(flatten)]
pub installer: ResolverInstallerArgs,