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

[feat]: Request for more output in stdout/stderr for non-interactive process #11121

Open
robinjhuang opened this issue Jan 30, 2025 · 10 comments
Labels
enhancement New feature or improvement to existing functionality

Comments

@robinjhuang
Copy link

Summary

Hi!

We are using uv to install python venvs and pytorch in our desktop application. I previously posted our issue of not getting interactive output in a regular subprocess #9129.

Would it be possible to include more detailed output? Doesn't have to be interactive. The issue is that right now when we install a requirements.txt file, we don't see any output until everything is finished.

If I launch uv pip instal torch torchvision torchaudio, nothing is written to stdout or stderr until it's finished. Since torch with cuda is large, this can take a while.

[stderr] Resolved 14 packages in 7ms
[stderr] Installed 14 packages in 327ms
[stderr]  + filelock==3.17.0
 + fsspec==2024.12.0
 + jinja2==3.1.5
 + markupsafe==3.0.2
 + mpmath==1.3.0
 + networkx==3.4.2
 + numpy==2.2.2
 + pillow==11.1.0
 + setuptools==75.8.0
 + sympy==1.13.1
 + torch==2.6.0
 + torchaudio==2.6.0
 + torchvision==0.21.0
 + typing-extensions==4.12.2

What would be ideal is:

Resolved 14 packages in 7ms
Installing fsspec...
Finished installing fsspec.
Installing jinja2...


Example

No response

@robinjhuang robinjhuang added the enhancement New feature or improvement to existing functionality label Jan 30, 2025
@webfiltered
Copy link

Definitely an update of package installed would be good at a minimum. Adding some kind of rudimentary fixed-length percent update, e.g. output 100 full stops for each package, would be a significant improvement in monitoring the uv process' progress without an interactive terminal.

Unless there is some other way for the calling process to see current download updates (even active polling)?

@konstin
Copy link
Member

konstin commented Jan 31, 2025

We have an interactive progress bar for downloads, i assume that's not showing for you?

Screencast.from.2025-01-31.11-16-49.webm

Can you share which platform and terminal you're using; Are you applying any redirects of stdout/stderr?

@webfiltered
Copy link

Hey, thanks for the quick response! The indicatif progress is great whenever we're observing via terminal on any platform.

The issue we're facing is when stdout/stderr are not connected to a terminal, there is simply no output at all. We're using spawn in node.js, but the same holds true for python subprocess.

@webfiltered
Copy link

Apologies, forgot to answer everything. Tested on Windows 11 & Ubuntu 24. If we spawn uv via node-pty, we get output and can log / observe monitor. But this comes with its own limitations and introduces several more issues.

If there is a proper / better way to interpret current state / progress from a calling process, we'd be happy to use that.

@zanieb
Copy link
Member

zanieb commented Jan 31, 2025

Hm it's weird that we wouldn't write output when using subprocess. I'd consider that a bug, if we can reproduce.

@Gankra is considering allowing interaction with current state from a parent process using a json-lines output, but that's a bit separate.

@robinjhuang
Copy link
Author

To be clear, there is some amount of output right now using subprocess (posted above). But we don't get the progress bars of any sort. Using uv 0.5.25. Would be great to get the progress in stdout or stderr as well using subprocess, even if it's not well-formatted.

@zanieb
Copy link
Member

zanieb commented Jan 31, 2025

Oh.. yeah the progress bars don't work in a non-interactive mode (and I wouldn't expect them to). They require repeated drawing in the terminal.

I don't think we'll implement simple visibility into progress in this context — the json-lines output format is the way to go here.

@webfiltered
Copy link

webfiltered commented Jan 31, 2025

Ah sorry, by nothing, I meant nothing from the point where uv starts downloading until it exits (even if it's 20 packages).

@robinjhuang
Copy link
Author

JSON output would be great! What sort of output would it look like?

{ name: "pyyaml", progress: "0.25" , state: "downloading" }

Something like that?

@zanieb
Copy link
Member

zanieb commented Jan 31, 2025

Still TBD, @Gankra would have more details but we're still designing this. See also #411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants