Add --package support to uv build (#6990)
## Summary This PR adds `--package` support to `uv build`, such that you can use `--package` from anywhere in a workspace to build any member. If a source directory is provided, we use that as the workspace root. If a file is provided, we error. For now, `uv build` only builds the current package, making it semantically identical to `uv sync`.
This commit is contained in:
@@ -1955,6 +1955,15 @@ pub struct BuildArgs {
|
||||
#[arg(value_parser = parse_file_path)]
|
||||
pub src: Option<PathBuf>,
|
||||
|
||||
/// Build a specific package in the workspace.
|
||||
///
|
||||
/// The workspace will be discovered from the provided source directory, or the current
|
||||
/// directory if no source directory is provided.
|
||||
///
|
||||
/// If the workspace member does not exist, uv will exit with an error.
|
||||
#[arg(long)]
|
||||
pub package: Option<PackageName>,
|
||||
|
||||
/// The output directory to which distributions should be written.
|
||||
///
|
||||
/// Defaults to the `dist` subdirectory within the source directory, or the
|
||||
|
||||
Reference in New Issue
Block a user