SpielerNogard / tox-uv

Use https://github.com/astral-sh/uv with tox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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-venv-runner is the ID for the tox environments runner.
  • uv-venv-pep-517 is the ID for the PEP-517 packaging environment.
  • uv-venv-cmd-builder is the ID for the external cmd builder.

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:

  • highest - (default) selects the highest version of a package that satisfies the constraints
  • lowest - install the lowest compatible versions for all dependencies, both direct and transitive
  • lowest-direct - opt for the lowest compatible versions for all direct dependencies, while using the latest compatible versions for all transitive dependencies

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.

KEEP_PIP

This flag if set on environment level, will keep pip beside uv. This is useful if your CI/CD pipeline relies on pip for some operations or not all your developers have tox-uv installed.

  • yes this will install the newest compatible pip version
  • ==24.1 this will install the specified pip version also >= or <= should be supported

About

Use https://github.com/astral-sh/uv with tox

License:MIT License


Languages

Language:Python 100.0%