This commit is contained in:
Pedro Avalos 2025-07-06 14:07:00 +02:00 committed by GitHub
commit e42bb096af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 14 deletions

View file

@ -591,7 +591,7 @@ pub struct VersionArgs {
pub refresh: RefreshArgs, pub refresh: RefreshArgs,
/// Update the version of a specific package in the workspace. /// Update the version of a specific package in the workspace.
#[arg(long, conflicts_with = "isolated")] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with = "isolated")]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// The Python interpreter to use for resolving and syncing. /// The Python interpreter to use for resolving and syncing.
@ -2380,7 +2380,7 @@ pub struct BuildArgs {
/// directory if no source directory is provided. /// directory if no source directory is provided.
/// ///
/// If the workspace member does not exist, uv will exit with an error. /// If the workspace member does not exist, uv will exit with an error.
#[arg(long, conflicts_with("all_packages"))] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with("all_packages"))]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// Builds all packages in the workspace. /// Builds all packages in the workspace.
@ -3104,7 +3104,7 @@ pub struct RunArgs {
/// Run the command in a specific package in the workspace. /// Run the command in a specific package in the workspace.
/// ///
/// If the workspace member does not exist, uv will exit with an error. /// If the workspace member does not exist, uv will exit with an error.
#[arg(long, conflicts_with = "all_packages")] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with = "all_packages")]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// Avoid discovering the project or workspace. /// Avoid discovering the project or workspace.
@ -3347,7 +3347,7 @@ pub struct SyncArgs {
/// declared by the specified workspace member package. /// declared by the specified workspace member package.
/// ///
/// If the workspace member does not exist, uv will exit with an error. /// If the workspace member does not exist, uv will exit with an error.
#[arg(long, conflicts_with = "all_packages")] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with = "all_packages")]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// Sync the environment for a Python script, rather than the current project. /// Sync the environment for a Python script, rather than the current project.
@ -3619,7 +3619,7 @@ pub struct AddArgs {
pub refresh: RefreshArgs, pub refresh: RefreshArgs,
/// Add the dependency to a specific package in the workspace. /// Add the dependency to a specific package in the workspace.
#[arg(long, conflicts_with = "isolated")] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with = "isolated")]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// Add the dependency to the specified Python script, rather than to a project. /// Add the dependency to the specified Python script, rather than to a project.
@ -3720,7 +3720,7 @@ pub struct RemoveArgs {
pub refresh: RefreshArgs, pub refresh: RefreshArgs,
/// Remove the dependencies from a specific package in the workspace. /// Remove the dependencies from a specific package in the workspace.
#[arg(long, conflicts_with = "isolated")] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with = "isolated")]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// Remove the dependency from the specified Python script, rather than from a project. /// Remove the dependency from the specified Python script, rather than from a project.
@ -3907,7 +3907,7 @@ pub struct ExportArgs {
/// Export the dependencies for a specific package in the workspace. /// Export the dependencies for a specific package in the workspace.
/// ///
/// If the workspace member does not exist, uv will exit with an error. /// If the workspace member does not exist, uv will exit with an error.
#[arg(long, conflicts_with = "all_packages")] #[arg(long, env = EnvVars::UV_PACKAGE, conflicts_with = "all_packages")]
pub package: Option<PackageName>, pub package: Option<PackageName>,
/// Prune the given package from the dependency tree. /// Prune the given package from the dependency tree.

View file

@ -100,6 +100,10 @@ impl EnvVars {
/// file as the constraints file. Uses space-separated list of files. /// file as the constraints file. Uses space-separated list of files.
pub const UV_CONSTRAINT: &'static str = "UV_CONSTRAINT"; pub const UV_CONSTRAINT: &'static str = "UV_CONSTRAINT";
/// Equivalent to the `--package` command-line argument. If set, uv
/// will run the command in this workspace member.
pub const UV_PACKAGE: &'static str = "UV_PACKAGE";
/// Equivalent to the `--build-constraint` command-line argument. If set, uv will use this file /// Equivalent to the `--build-constraint` command-line argument. If set, uv will use this file
/// as constraints for any source distribution builds. Uses space-separated list of files. /// as constraints for any source distribution builds. Uses space-separated list of files.
pub const UV_BUILD_CONSTRAINT: &'static str = "UV_BUILD_CONSTRAINT"; pub const UV_BUILD_CONSTRAINT: &'static str = "UV_BUILD_CONSTRAINT";

View file

@ -209,7 +209,7 @@ uv run [OPTIONS] [COMMAND]
<p>May be provided multiple times. Implies <code>--no-default-groups</code>.</p> <p>May be provided multiple times. Implies <code>--no-default-groups</code>.</p>
</dd><dt id="uv-run--package"><a href="#uv-run--package"><code>--package</code></a> <i>package</i></dt><dd><p>Run the command in a specific package in the workspace.</p> </dd><dt id="uv-run--package"><a href="#uv-run--package"><code>--package</code></a> <i>package</i></dt><dd><p>Run the command in a specific package in the workspace.</p>
<p>If the workspace member does not exist, uv will exit with an error.</p> <p>If the workspace member does not exist, uv will exit with an error.</p>
</dd><dt id="uv-run--prerelease"><a href="#uv-run--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-run--prerelease"><a href="#uv-run--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>
@ -541,7 +541,7 @@ uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>
<p>The group may then be activated when installing the project with the <code>--extra</code> flag.</p> <p>The group may then be activated when installing the project with the <code>--extra</code> flag.</p>
<p>To enable an optional extra for this requirement instead, see <code>--extra</code>.</p> <p>To enable an optional extra for this requirement instead, see <code>--extra</code>.</p>
</dd><dt id="uv-add--package"><a href="#uv-add--package"><code>--package</code></a> <i>package</i></dt><dd><p>Add the dependency to a specific package in the workspace</p> </dd><dt id="uv-add--package"><a href="#uv-add--package"><code>--package</code></a> <i>package</i></dt><dd><p>Add the dependency to a specific package in the workspace</p>
</dd><dt id="uv-add--prerelease"><a href="#uv-add--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-add--prerelease"><a href="#uv-add--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>
@ -723,7 +723,7 @@ uv remove [OPTIONS] <PACKAGES>...
<p>When disabled, uv will only use locally cached data and locally available files.</p> <p>When disabled, uv will only use locally cached data and locally available files.</p>
<p>May also be set with the <code>UV_OFFLINE</code> environment variable.</p></dd><dt id="uv-remove--optional"><a href="#uv-remove--optional"><code>--optional</code></a> <i>optional</i></dt><dd><p>Remove the packages from the project's optional dependencies for the specified extra</p> <p>May also be set with the <code>UV_OFFLINE</code> environment variable.</p></dd><dt id="uv-remove--optional"><a href="#uv-remove--optional"><code>--optional</code></a> <i>optional</i></dt><dd><p>Remove the packages from the project's optional dependencies for the specified extra</p>
</dd><dt id="uv-remove--package"><a href="#uv-remove--package"><code>--package</code></a> <i>package</i></dt><dd><p>Remove the dependencies from a specific package in the workspace</p> </dd><dt id="uv-remove--package"><a href="#uv-remove--package"><code>--package</code></a> <i>package</i></dt><dd><p>Remove the dependencies from a specific package in the workspace</p>
</dd><dt id="uv-remove--prerelease"><a href="#uv-remove--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-remove--prerelease"><a href="#uv-remove--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>
@ -897,7 +897,7 @@ uv version [OPTIONS] [VALUE]
<li><code>text</code>: Display the version as plain text</li> <li><code>text</code>: Display the version as plain text</li>
<li><code>json</code>: Display the version as JSON</li> <li><code>json</code>: Display the version as JSON</li>
</ul></dd><dt id="uv-version--package"><a href="#uv-version--package"><code>--package</code></a> <i>package</i></dt><dd><p>Update the version of a specific package in the workspace</p> </ul></dd><dt id="uv-version--package"><a href="#uv-version--package"><code>--package</code></a> <i>package</i></dt><dd><p>Update the version of a specific package in the workspace</p>
</dd><dt id="uv-version--prerelease"><a href="#uv-version--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-version--prerelease"><a href="#uv-version--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>
@ -1108,7 +1108,7 @@ uv sync [OPTIONS]
</dd><dt id="uv-sync--package"><a href="#uv-sync--package"><code>--package</code></a> <i>package</i></dt><dd><p>Sync for a specific package in the workspace.</p> </dd><dt id="uv-sync--package"><a href="#uv-sync--package"><code>--package</code></a> <i>package</i></dt><dd><p>Sync for a specific package in the workspace.</p>
<p>The workspace's environment (<code>.venv</code>) is updated to reflect the subset of dependencies declared by the specified workspace member package.</p> <p>The workspace's environment (<code>.venv</code>) is updated to reflect the subset of dependencies declared by the specified workspace member package.</p>
<p>If the workspace member does not exist, uv will exit with an error.</p> <p>If the workspace member does not exist, uv will exit with an error.</p>
</dd><dt id="uv-sync--prerelease"><a href="#uv-sync--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-sync--prerelease"><a href="#uv-sync--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>
@ -1473,7 +1473,7 @@ uv export [OPTIONS]
</dd><dt id="uv-export--output-file"><a href="#uv-export--output-file"><code>--output-file</code></a>, <code>-o</code> <i>output-file</i></dt><dd><p>Write the exported requirements to the given file</p> </dd><dt id="uv-export--output-file"><a href="#uv-export--output-file"><code>--output-file</code></a>, <code>-o</code> <i>output-file</i></dt><dd><p>Write the exported requirements to the given file</p>
</dd><dt id="uv-export--package"><a href="#uv-export--package"><code>--package</code></a> <i>package</i></dt><dd><p>Export the dependencies for a specific package in the workspace.</p> </dd><dt id="uv-export--package"><a href="#uv-export--package"><code>--package</code></a> <i>package</i></dt><dd><p>Export the dependencies for a specific package in the workspace.</p>
<p>If the workspace member does not exist, uv will exit with an error.</p> <p>If the workspace member does not exist, uv will exit with an error.</p>
</dd><dt id="uv-export--prerelease"><a href="#uv-export--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-export--prerelease"><a href="#uv-export--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>
@ -4803,7 +4803,7 @@ uv build [OPTIONS] [SRC]
</dd><dt id="uv-build--package"><a href="#uv-build--package"><code>--package</code></a> <i>package</i></dt><dd><p>Build a specific package in the workspace.</p> </dd><dt id="uv-build--package"><a href="#uv-build--package"><code>--package</code></a> <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>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> <p>If the workspace member does not exist, uv will exit with an error.</p>
</dd><dt id="uv-build--prerelease"><a href="#uv-build--prerelease"><code>--prerelease</code></a> <i>prerelease</i></dt><dd><p>The strategy to use when considering pre-release versions.</p> <p>May also be set with the <code>UV_PACKAGE</code> environment variable.</p></dd><dt id="uv-build--prerelease"><a href="#uv-build--prerelease"><code>--prerelease</code></a> <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> <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>
<p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p> <p>May also be set with the <code>UV_PRERELEASE</code> environment variable.</p><p>Possible values:</p>
<ul> <ul>

View file

@ -275,6 +275,11 @@ Equivalent to the `--offline` command-line argument. If set, uv will disable net
Equivalent to the `--override` command-line argument. If set, uv will use this file Equivalent to the `--override` command-line argument. If set, uv will use this file
as the overrides file. Uses space-separated list of files. as the overrides file. Uses space-separated list of files.
### `UV_PACKAGE`
Equivalent to the `--package` command-line argument. If set, uv
will run the command in this workspace member.
### `UV_PRERELEASE` ### `UV_PRERELEASE`
Equivalent to the `--prerelease` command-line argument. For example, if set to Equivalent to the `--prerelease` command-line argument. For example, if set to