tox-dev / tox-uv

Use https://github.com/astral-sh/uv with tox
MIT License
66 stars 14 forks source link

Wishlist: support running `tox config` without creating the virtual environments? #56

Closed ppentchev closed 3 months ago

ppentchev commented 3 months ago

Hi,

First of all, thanks a lot for writing and maintaining tox-uv! It's become pretty much essential in my workflow.

What's the problem this feature will solve?

I maintain the test-stages Python module that adds a tox-stages command-line tool allowing the Tox test environments to be run in stages: very quick syntax checkers first, then some more linters, then maybe even slower linters, and only then the unit and functional test suites. For its operation, it tries to parse the Tox configuration to figure out which Tox environments have the new "tags" list of attributes defined, so it runs tox config -e ALL. If this is run without additionally specifying the -q option to Tox, the tox-uv plugin will cause extraneous output, since it tries to create the virtual environments, so it invokes the Tox command executor which in turn logs the executed commands interspersed with the actual tox config output.

Describe the solution you'd like

I have looked at the code a bit, and I realize that it might not really be trivial, but would you at least consider the possibility of somehow figuring out what configuration settings should be reported without actually creating the virtual environments - or rather, without executing any external commands that would cause Tox to produce additional output?

Alternative Solutions

I am currently in the process of updating my test-stages module so that tox-stages passes the -q option to tox config; that will resolve the immediate problem of tox-stages failing to parse the Tox configuration. I would actually agree with a "yep, please use this as a workaround, closing this issue" answer :) However, there might be other cases when it might be a good idea to not create virtual environments when only asking for the Tox configuration, e.g. real-time LSP-style tox.ini linters and stuff.

gaborbernat commented 3 months ago

This is not possible without UV exposing this information which it doesn't do today.