I use uv to test Python projects across dependency versions and Python interpreters, including isolated runs that install the project’s test extra. These workflows complement my broader notes on testing and tdd and Python interpreter changes in python versions and releases.
I have been upgrading all of my projects to use pyproject.toml and dependency groups for cleaner compatibility with uv.
git clone http''s://github.com/simonw/llm
cd llm
uv run pytest
I had wanted a way to test library compatibility in CI for a while, and I said the option means it lets you easily test library compatibility in CI.
uv pip install --resolution=lowest
This command installs the lowest supported version of every dependency.
uv run --python 3.12 --with '.[test]' pytest
I figured out how to run pytest with a different Python version against my pyproject.toml/setup.py projects using uv run.
uv run --python 3.14 --isolated --with-editable '.[test]' pytest
I figured out this uv recipe for running tests for any project with pyproject.toml or setuppy using any Python version.
uv-test -p 3.11
I wrapped the testing recipe in a uv-test script.
I said that uv makes testing different projects against upgraded dependencies so much easier, and that it handles virtual environments almost invisibly.
I wrote more about my uv testing tricks in a TIL: https://t.co/0MFiKWDQJe
Related: uv workflows and development, installing python cli tools, python versions and releases