I'm starting to use uv
for my CI as it's showing outstanding performances with respect to normal pip installation. for each CI run I (in fact nox
does it on my behalf) create a virtual environment that will be used to run the tests. In this environment I run the following:
uv pip install .[test]
my folder is a simple python package as this one:
my_package/
├── __init__.py
└── logic.py
docs/
├── index.rst
└── conf.py
test/
└── test_something.py
pyproject.toml
noxfile.py
As uv
is caching everything my virtual environment is never updated and I cannot check new fonctionalities without rebuilding the venv from scratch. how could I make sure that "." get's reinstalled from source everytime I run my tests ?
I see 3 potential options:
uv pip install -e .[test]
which is not ideal for testing purposes as I don't check if the wheel build includes all the necessary files.uv pip install --reinstall .[test]
I guess I will loose the caching for all the libs and not only my packagereinstall-package = ["."]
but I don't know if it's going to mess with normal installation from users that are not running the testsAm I missing an alternative and which one is the best to avoid unwanted side effects in my tests ?
The uv team has been super fast to answer my question and since https://github.com/astral-sh/uv/issues/12038 it's part of the default mechanism:
local sources are now always reinstalled