You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When automating uv, having to parse the command output (which is intended for human readability) is not ideal. It would be useful to have an option to produce machine readable (probably JSON) output from the various uv commands.
For uv pip install something along the lines of the pip installation report would probably be a reasonable format.
For uv pip list, the pip list --format=json command is probably a good model.
uv pip show and uv pip freeze are machine readable, although having a --format=json equivalent for consistency might be worthwhile.
uv pip check probably doesn't need an output option, assuming the exit code is success or failure as appropriate.
uv pip compile and uv pip sync can probably have an installation report similar to uv pip install. I've not used these myself, though, so I don't know how useful they would be in practice.
uv venv could produce JSON output showing details of the created environment - path to the environment, Python executable path, scripts and site-package directories. Basically, the values that the stdlib venv module captures in the "context" object documented here.
To make automation easier, it's probably worth having some additional command line capabilities:
An isolated mode, to prevent user config affecting results (uv doesn't have as many possibilities for problems here as pip does, but that may change, I guess...)
A "guaranteed quiet" mode that ensures that just the JSON data will be printed to stdout, with any user messages either going to stderr or being suppressed. (Writing the data to a file is another possibility, but IMO it tends to be clumsy to manage).
I assume uv always writes its output as UTF-8, but if it doesn't (for example it follows the system defined encoding) then a "guaranteed UTF-8 output" mode would be important to avoid encoding problems.
The text was updated successfully, but these errors were encountered:
When automating
uv
, having to parse the command output (which is intended for human readability) is not ideal. It would be useful to have an option to produce machine readable (probably JSON) output from the variousuv
commands.uv pip install
something along the lines of the pip installation report would probably be a reasonable format.uv pip list
, thepip list --format=json
command is probably a good model.uv pip show
anduv pip freeze
are machine readable, although having a--format=json
equivalent for consistency might be worthwhile.uv pip check
probably doesn't need an output option, assuming the exit code is success or failure as appropriate.uv pip compile
anduv pip sync
can probably have an installation report similar touv pip install
. I've not used these myself, though, so I don't know how useful they would be in practice.uv venv
could produce JSON output showing details of the created environment - path to the environment, Python executable path, scripts and site-package directories. Basically, the values that the stdlibvenv
module captures in the "context" object documented here.To make automation easier, it's probably worth having some additional command line capabilities:
uv
doesn't have as many possibilities for problems here as pip does, but that may change, I guess...)uv
always writes its output as UTF-8, but if it doesn't (for example it follows the system defined encoding) then a "guaranteed UTF-8 output" mode would be important to avoid encoding problems.The text was updated successfully, but these errors were encountered: