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:
Charlie Marsh 2024-09-04 11:52:21 -04:00 committed by GitHub
parent 05ed4bc11d
commit 7aed94bed2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 321 additions and 21 deletions

View file

@ -6374,6 +6374,12 @@ uv build [OPTIONS] [SRC]
<p>Defaults to the <code>dist</code> subdirectory within the source directory, or the directory containing the source distribution archive.</p>
</dd><dt><code>--package</code> <i>package</i></dt><dd><p>Build a specific package in the workspace.</p>
<p>The workspace will be discovered from the provided source directory, or the current directory if no source directory is provided.</p>
<p>If the workspace member does not exist, uv will exit with an error.</p>
</dd><dt><code>--prerelease</code> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p>
<p>By default, uv will accept pre-releases for packages that <em>only</em> publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (<code>if-necessary-or-explicit</code>).</p>