diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 10652961e..fe6b74fa5 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -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, - /// 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, - /// 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. diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 1b2f4258b..63060b510 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -1159,9 +1159,15 @@ uv tree [OPTIONS]
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • -
    --python-version python-version

    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

    +
    --python-version python-version

    The Python version to use when filtering the tree.

    -
    --python-platform python-platform

    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.

    +

    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.

    + +
    --python-platform python-platform

    The platform to use when filtering the tree.

    + +

    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.

    @@ -1200,9 +1206,9 @@ uv tree [OPTIONS]
  • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
  • -
    --python, -p python

    The Python interpreter to use for resolution.

    +
    --python, -p python

    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.