uv/crates
Charlie Marsh cb62440aea
Show build and install summaries in uv run and uv tool run (#5899)
## Summary

Initially, we showed _all_ resolver and installer output in `uv run` and
`uv tool run`, since it was way too much for workhorse commands. Then,
we moved to showing _no_ output by default, which was way too little --
you had no idea why anything was happening, and commands appeared to
hang.

This PR adds a more nuanced middle-ground. With `--verbose`, we continue
to show everything. But by default, in `uv run` and `uv tool run`...

- During resolution, we show any "Building" and "Build" messages, if you
need to build a source distribution. But we don't show any other output.
(This _could_ be too little for expensive resolutions; we may want to
show a spinner.)
- If there are no changes to be made after resolving, we don't show any
other output.
- If we have to install, we show the progress bars for downloads (which
disappear on completion) followed by a single summary line stating the
number of packages installed.

This feels pretty good, in my limited testing. When everything is built
/ cached, you don't get _any_ additional output. When there's work to
do, you have a sense for what's happening, and we leave you with a
single summary line ("Installed X packages") at the end.

Closes https://github.com/astral-sh/uv/issues/5758.

## Test Plan

Notice that the first `tool run` ends with an install line; the second
shows no additional output:

![Screenshot 2024-08-07 at 8 33
21 PM](https://github.com/user-attachments/assets/6b0c7824-f14f-4d0b-86d0-a334ba486ce4)

If you run `uv run` in a package for the first time, we _do_ tell you
that we're building / built it:

![Screenshot 2024-08-07 at 8 34
02 PM](https://github.com/user-attachments/assets/6a4c7b05-3aa5-410e-af5d-916eb6e745b0)

But on the second run, there's no output:

![Screenshot 2024-08-07 at 8 34
10 PM](https://github.com/user-attachments/assets/2b32f83e-0370-45fa-9e8f-407d9b93d468)

If you add a `--with`, we'll show you all the installer progress bars
(which disappear once they're done), and then a single summary line:

![Screenshot 2024-08-07 at 8 34
39 PM](https://github.com/user-attachments/assets/e975d75c-01d2-4eb6-b3ff-e4d25d5ea9e2)
2024-08-08 11:26:41 -04:00
..
bench Add --no-sources to avoid reading from tool.uv.sources (#5801) 2024-08-06 14:14:19 +00:00
cache-key Use hasher to compute resolution hash (#5495) 2024-07-26 23:24:09 +00:00
distribution-filename Match wheel tags against Requires-Python major-minor (#5289) 2024-07-22 14:33:53 +00:00
distribution-types Strip URL fragments from lockfile (#5805) 2024-08-06 10:00:38 -04:00
install-wheel-rs feat: more rust in trampoline (#5750) 2024-08-07 08:19:38 +00:00
once-map Use lockfile to prefill resolver index (#4495) 2024-07-12 18:49:28 -04:00
pep440-rs Use prettier to format the documentation (#5708) 2024-08-02 08:58:31 -05:00
pep508-rs Use prettier to format the documentation (#5708) 2024-08-02 08:58:31 -05:00
platform-tags Process completed Python installs and uninstalls as a stream (#5203) 2024-07-19 12:50:38 +00:00
pypi-types Assume git+ prefix when URLs end in .git (#5868) 2024-08-07 15:50:36 +00:00
requirements-txt Rename Error::IO to Error::Io (#5174) 2024-07-18 04:13:45 +00:00
uv Show build and install summaries in uv run and uv tool run (#5899) 2024-08-08 11:26:41 -04:00
uv-auth Upgrade to Rust 1.80.0 (#5472) 2024-07-27 01:49:47 +00:00
uv-build Support no-build-isolation-package (#5894) 2024-08-08 01:35:56 +00:00
uv-cache Grouping GlobalArgs to dedicated heading (#5665) 2024-08-01 10:01:22 -05:00
uv-cli Support no-build-isolation-package (#5894) 2024-08-08 01:35:56 +00:00
uv-client uv-client: switch heuristic freshness lifetime to hard-coded value 2024-07-31 08:12:11 -07:00
uv-configuration Add --no-sources to avoid reading from tool.uv.sources (#5801) 2024-08-06 14:14:19 +00:00
uv-dev Replace uv help python references in CLI documentation with links (#5871) 2024-08-07 12:21:09 -05:00
uv-dispatch Allow downloading wheels for metadata with --no-binary (#5707) 2024-08-06 18:14:12 +00:00
uv-distribution Combine fetch and resolve steps in Git resolver (#5886) 2024-08-07 22:35:05 +00:00
uv-extract Avoid monomorphization of untar (#5743) 2024-08-03 23:29:17 +00:00
uv-fs Capture portable path serialization in a struct (#5652) 2024-07-31 16:00:37 +00:00
uv-git Fix reuse of Git commits in lockfile (#5908) 2024-08-08 13:01:59 +00:00
uv-installer Avoid panic when re-locking with precise commit (#5863) 2024-08-07 10:56:15 -04:00
uv-macros Autogenerate possible values for enums in reference documentation (#5137) 2024-07-17 12:37:33 -04:00
uv-normalize Support dev dependencies in virtual workspace roots (#5709) 2024-08-01 21:04:30 +00:00
uv-options-metadata Autogenerate possible values for enums in reference documentation (#5137) 2024-07-17 12:37:33 -04:00
uv-python Enable mirror for python-build-standalone downloads (#5719) 2024-08-07 21:34:19 -04:00
uv-requirements Rename distribution to packages in lockfile (#5861) 2024-08-08 11:25:06 -04:00
uv-resolver Rename distribution to packages in lockfile (#5861) 2024-08-08 11:25:06 -04:00
uv-scripts Support empty dependencies in PEP 723 scripts (#5864) 2024-08-07 10:56:05 -04:00
uv-settings Support no-build-isolation-package (#5894) 2024-08-08 01:35:56 +00:00
uv-shell fix(venv): make relocatable activation scripts support ksh (#5640) 2024-07-31 12:18:11 -04:00
uv-state Cache tool environments in uv tool run (#4784) 2024-07-03 19:25:39 -04:00
uv-tool Respect malformed .dist-info directories in tool installs (#5756) 2024-08-03 19:43:03 -04:00
uv-trampoline feat: more rust in trampoline (#5750) 2024-08-07 08:19:38 +00:00
uv-types Support no-build-isolation-package (#5894) 2024-08-08 01:35:56 +00:00
uv-version Bump version to v0.2.34 (#5889) 2024-08-07 16:33:53 -04:00
uv-virtualenv fix(venv): make relocatable activation scripts support ksh (#5640) 2024-07-31 12:18:11 -04:00
uv-warnings Upgrade to Rust 1.80.0 (#5472) 2024-07-27 01:49:47 +00:00
uv-workspace Avoid requires-python warning in virtual-only workspace (#5895) 2024-08-07 20:43:19 -04:00
README.md Use prettier to format the documentation (#5708) 2024-08-02 08:58:31 -05:00

Crates

bench

Functionality for benchmarking uv.

cache-key

Generic functionality for caching paths, URLs, and other resources across platforms.

distribution-filename

Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.

distribution-types

Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.

install-wheel-rs

Install built distributions (wheels) into a virtual environment.]

once-map

A waitmap-like concurrent hash map for executing tasks exactly once.

pep440-rs

Utilities for interacting with Python version numbers and specifiers.

pep508-rs

Utilities for interacting with PEP 508 dependency specifiers.

platform-host

Functionality for detecting the current platform (operating system, architecture, etc.).

platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

uv

Command-line interface for the uv package manager.

uv-build

A PEP 517-compatible build frontend for uv.

uv-cache

Functionality for caching Python packages and associated metadata.

uv-client

Client for interacting with PyPI-compatible HTTP APIs.

uv-dev

Development utilities for uv.

uv-dispatch

A centralized struct for resolving and building source distributions in isolated environments. Implements the traits defined in uv-types.

uv-distribution

Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.

uv-extract

Utilities for extracting files from archives.

uv-fs

Utilities for interacting with the filesystem.

uv-git

Functionality for interacting with Git repositories.

uv-installer

Functionality for installing Python packages into a virtual environment.

uv-python

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

uv-package

Types and functionality for working with Python packages, e.g., parsing wheel files.

uv-requirements

Utilities for reading package requirements from pyproject.toml and requirements.txt files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-shell

Utilities for detecting and manipulating shell environments.

uv-types

Shared traits for uv, to avoid circular dependencies.

pypi-types

General-purpose type definitions for types used in PyPI-compatible APIs.

uv-virtualenv

A venv replacement to create virtual environments in Rust.

uv-warnings

User-facing warnings for uv.

uv-workspace

Workspace abstractions for uv.

requirements-txt

Functionality for parsing requirements.txt files.