Closed RomainBrault closed 1 month ago
tox-uv does not interact with
uv python
, only withuv venv
. Doesn't the later only uses system pythons?
using python_preference = managed
allows uv venv to use uv python toolchain if my understanding is correct.
I proposed this PR as it allows me to stop worrying about my python versions installed on my system and let tox-uv manage this through uv python.
By default no flag is passed to uv venv
preserving the old behaviour. If python_preference
is set, the flag --python-preference
is passed, controlling wjether to use system python or some uv managed python.
using
python_preference = managed
allows uv venv to use uv python toolchain if my understanding is correct.
Can you link to upstream docs of this?
using
python_preference = managed
allows uv venv to use uv python toolchain if my understanding is correct.Can you link to upstream docs of this?
https://docs.astral.sh/uv/python-versions/#adjusting-python-version-preferences
Should be in the README.md too.
The CI is broken.
Blocking now with the typing error. Optional or Union[Type, None] are not working. Investigating.
At this point the CI pass locally
Seem it is not. Note you can setup https://github.com/RomainBrault/tox-uv/actions to not need to wait for my approval.
Here we go. I had to remove some type information to make it compatible with Python <3.10.
Thank you for your patience.
I guess this is why I reported https://github.com/tox-dev/tox-uv/issues/72
I thought tox-uv didn't "do this" because it was not advertised, and some open issues suggested otherwise. This is a feature that has just turned up, because uv venv
already does it depending on configuration (that I already had).
Oh and it's a preview feature in uv so in that sense I guess it makes sense to not make any guarantees about it.
This PR enables the usage of the flag --python-preference to better control which Python interpreter is used.
See https://docs.astral.sh/uv/python-versions/#adjusting-python-version-preferences
It does so by exposing a
uv_python_preference
configuration field.Note: this can be used to download missing Python interpreter. Use for example