Improve CLI documentation for uv tree (#5870)

This commit is contained in:
Zanie Blue 2024-08-07 11:59:27 -05:00 committed by GitHub
parent 2df2092084
commit fe2849af6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 15 deletions

View file

@ -2414,25 +2414,32 @@ pub struct TreeArgs {
#[command(flatten)]
pub resolver: ResolverArgs,
/// The Python version to use when filtering the tree (via `--filter`). For example, pass
/// `--python-version 3.10` to display the dependencies that would be included when installing
/// on Python 3.10.
/// The Python version to use when filtering the tree.
///
/// For example, pass `--python-version 3.10` to display the dependencies
/// that would be included when installing on Python 3.10.
///
/// Defaults to the version of the discovered Python interpreter.
#[arg(long, conflicts_with = "universal")]
pub python_version: Option<PythonVersion>,
/// The platform to use when filtering the tree (via `--filter`). For example, pass `--platform
/// windows` to display the dependencies that would be included when installing on Windows.
/// The platform to use when filtering the tree.
///
/// Represented as a "target triple", a string that describes the target platform in terms of
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aaarch64-apple-darwin`.
/// For example, pass `--platform windows` to display the dependencies that
/// would be included when installing on Windows.
///
/// Represented as a "target triple", a string that describes the target
/// platform in terms of its CPU, vendor, and operating system name, like
/// `x86_64-unknown-linux-gnu` or `aaarch64-apple-darwin`.
#[arg(long, conflicts_with = "universal")]
pub python_platform: Option<TargetTriple>,
/// The Python interpreter to use for resolution.
/// The Python interpreter to use for locking and filtering.
///
/// A Python interpreter is required to perform the lock before displaying
/// the tree.
/// By default, the tree is filtered to match the platform as reported by
/// the Python interpreter. Use `--universal` to display the tree for all
/// platforms, or use `--python-version` or `--python-platform` to override
/// a subset of markers.
///
/// See `uv help python` for details on Python discovery and supported
/// request formats.

View file

@ -1159,9 +1159,15 @@ uv tree [OPTIONS]
<li><code>symlink</code>: Symbolically link packages from the wheel into the <code>site-packages</code> directory</li>
</ul>
</dd><dt><code>--python-version</code> <i>python-version</i></dt><dd><p>The Python version to use when filtering the tree (via <code>--filter</code>). For example, pass <code>--python-version 3.10</code> to display the dependencies that would be included when installing on Python 3.10</p>
</dd><dt><code>--python-version</code> <i>python-version</i></dt><dd><p>The Python version to use when filtering the tree.</p>
</dd><dt><code>--python-platform</code> <i>python-platform</i></dt><dd><p>The platform to use when filtering the tree (via <code>--filter</code>). For example, pass <code>--platform windows</code> to display the dependencies that would be included when installing on Windows.</p>
<p>For example, pass <code>--python-version 3.10</code> to display the dependencies that would be included when installing on Python 3.10.</p>
<p>Defaults to the version of the discovered Python interpreter.</p>
</dd><dt><code>--python-platform</code> <i>python-platform</i></dt><dd><p>The platform to use when filtering the tree.</p>
<p>For example, pass <code>--platform windows</code> to display the dependencies that would be included when installing on Windows.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aaarch64-apple-darwin</code>.</p>
@ -1200,9 +1206,9 @@ uv tree [OPTIONS]
<li><code>aarch64-manylinux_2_31</code>: An ARM64 target for the <code>manylinux_2_31</code> platform</li>
</ul>
</dd><dt><code>--python</code>, <code>-p</code> <i>python</i></dt><dd><p>The Python interpreter to use for resolution.</p>
</dd><dt><code>--python</code>, <code>-p</code> <i>python</i></dt><dd><p>The Python interpreter to use for locking and filtering.</p>
<p>A Python interpreter is required to perform the lock before displaying the tree.</p>
<p>By default, the tree is filtered to match the platform as reported by the Python interpreter. Use <code>--universal</code> to display the tree for all platforms, or use <code>--python-version</code> or <code>--python-platform</code> to override a subset of markers.</p>
<p>See <code>uv help python</code> for details on Python discovery and supported request formats.</p>