pythonpackaginguv

how to force the reinsall of my local package with uv?


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:

Am I missing an alternative and which one is the best to avoid unwanted side effects in my tests ?


Solution

  • 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