tox-uv
tox-uv is a plugin that integrates uv, the fast Python package installer and resolver, with tox, the standard virtual environment management and test automation tool. It provides a drop-in replacement for tox's default virtual environment creation and dependency management, leveraging uv for significantly faster operations. The current version is 1.34.0, and it follows an active release cadence with frequent updates.
Warnings
- breaking Starting with tox-uv 1.32.0, the project adopted a monorepo structure, differentiating between a `bare` and `meta` package. While `tox-uv` (the meta-package) remains the primary installation, be aware of this refactoring if you're dealing with advanced plugin development or specific `uv` integration scenarios.
- gotcha tox-uv explicitly requires Python 3.10 or newer. Attempting to use it with older Python versions will result in installation failures or runtime errors.
- gotcha To ensure tox uses uv for dependency resolution and installation, `tox-uv` must be specified in the `requires` section of your tox configuration. If omitted, tox will fallback to its default package installer (typically pip).
- gotcha Certain behaviors of `uv` within tox can be controlled via `uv_resolution` settings (e.g., `uv_resolution = eager` or `uv_resolution = resolve_and_install`). Misconfiguration here can lead to unexpected dependency outcomes.
Install
-
pip install tox-uv
Imports
- tox-uv activation
tox-uv is a tox plugin; it's activated by adding `requires = tox-uv` to your `tox.ini` or `pyproject.toml` configuration under the `[tox]` section. There are no direct Python `import` statements for `tox-uv` in user code.
Quickstart
# pyproject.toml [tool.tox] min_version = "4.0" requires = ["tox-uv"] env_list = ["py311", "py312"] [testenv] package = "skip" deps = ["pytest"] commands = ["pytest"] # Or for a simple tox.ini: # [tox] # min_version = 4.0 # requires = tox-uv # env_list = py # [testenv:py] # deps = pytest # commands = pytest