Detect if project directory was moved for venv reconstruction #10895
Labels
enhancement
New feature or improvement to existing functionality
help wanted
Contribution especially encouraged
Summary
I just had an issue with pytest á la #7260. Turned out that because I had moved the project directory, the shebang in the "pytest" script in the venv was wrong, and apparently this meant that the command would fallthrough to the system-installed pytest which couldn't find my project or any of its dependencies, of course.
uv sync
would not detect this, but deleting.venv
did the trick.So I thought, since the location of the venv is hardcoded in the entrypoint scripts, it would be appropriate for uv to keep track of whether the venv location has changed. For example, it could go into the
pyvenv.cfg
file under auv-venv-path
variable or such. Then, if the actual path of the venv does not match this value, it would indicate to uv that the venv (or at least the entrypoints) should be reconstructed.Example
No response
The text was updated successfully, but these errors were encountered: