tox-dev / tox-uv

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

tox-uv

PyPI version PyPI Supported Python Versions check Downloads

tox-uv is a tox plugin which replaces virtualenv and pip with uv in your tox environments. Note that you will get both the benefits (performance) or downsides (bugs) of uv.

How to use

Install tox-uv into the environment of your tox and it will replace virtualenv and pip for all runs:

python -m pip install tox-uv
python -m tox r -e py312 # will use uv

Configuration

uv_seed

This flag, set on a tox environment level, controls if the created virtual environment injects pip/setuptools/wheel into the created virtual environment or not. By default, is off. You will need to set this if you have a project that uses the old legacy editable mode, or your project does not support the pyproject.toml powered isolated build model.

uv_resolution

This flag, set on a tox environment level, informs uv of the desired resolution strategy:

This is a uv specific feature that may be used as an alternative to frozen constraints for test environments, if the intention is to validate the lower bounds of your dependencies during test executions.

uv_python_preference

This flag, set on a tox environment level, controls how uv select the Python interpreter.

By default, uv will attempt to use Python versions found on the system and only download managed interpreters when necessary. However, It's possible to adjust uv's Python version selection preference with the python-preference option.