Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show build and install summaries in uv run and uv tool run #5899

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Aug 8, 2024

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 #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

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

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

Screenshot 2024-08-07 at 8 34 10 PM

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

@charliermarsh charliermarsh marked this pull request as ready for review August 8, 2024 00:42
@zanieb zanieb added tracing Verbose output and debugging cli Related to the command line interface preview Experimental behavior labels Aug 8, 2024
Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@charliermarsh charliermarsh merged commit cb62440 into main Aug 8, 2024
57 checks passed
@charliermarsh charliermarsh deleted the charlie/show-more branch August 8, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface preview Experimental behavior tracing Verbose output and debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show ephemeral progress bar in uv run and uv tool run
3 participants