tox-dev / tox-uv

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

Pass sys.executable to `uv venv` if it is the same version #40

Closed ppentchev closed 6 months ago

ppentchev commented 6 months ago

Hi,

Thanks a lot for writing and maintaining tox-uv, as well as for all your work in the Python ecosystem!

Now, I have a somewhat unusual setup: a vendor-specific Python interpreter that is not in the normal search path. Since I'd like to use tox-uv to test that my modules will also be compatible with that version, I have a virtual environment with tox and tox-uv (and, actually, also test-stages for the tox-stages utility); however, a stock installation of tox-uv within such a virtual environment passes "-p 3.8" to uv, and since python3.8 is not in the search path, that fails.

What do you think about this change that uses sys.executable if the major and minor Python version are the same as the currently running interpreter?

Thanks in advance, and keep up the great work!

G'luck, Peter

PS. Yes, Python 3.8 is too old; still, it is what it is :)

gaborbernat commented 6 months ago

You'll need to get the CI to pass 👍

ppentchev commented 6 months ago

I'm sorry... I know you may find this hard to believe, but I did actually run both the "fix" and "type" environments successfully - for an earlier version of the patch. Then I changed things around, and I only ran "fix" partially through my editor, and it hid the error from me because of the weird way I invoked it... and I forgot to run them for real.

gaborbernat commented 6 months ago

No worries it's all good 😊