-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uv venv
still overwrites existing venv in various cases
#4276
Comments
Hi! We've actually never changed this. We'll always overwrite a typical existing environment (without opt-in) unless it has some extraneous files we do not recognize in which case we require the |
Yeah this is still intentional -- can we merge with #1472? |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry I guess |
This comment was marked as resolved.
This comment was marked as resolved.
Ah ok, sorry, I missed that particular PR. And I also misinterpreted
to mean that any existing .venv directory and its contents would be preserved. The next paragraph makes it clear, but I didn't read that far.
Fair enough, sorry for misunderstanding! The merge is obviously fine by me |
@T-256 I think
is pretty explicit that it won't be cleared. Why would you expect this to remove packages? @matterhorn103 are there other documentation changes you'd find helpful here? |
(Closing as I think this is working as intended modulo the decisions to be made in those open issues.) |
I found many related threads (#2548, #1777, #1472) so it's not even really a new issue, but from what I can gather it was meant to no longer be the case that existing venvs get overwritten, while for me they still do.
e.g.
The result is the same if just
uv venv
is executed with no name, and the result is also the same ifuv venv foo
is executed within foo without deactivating.uv venv foo --allow-existing
correctly keeps any packages installed in the venv. However, if a different Python interpreter is used (not necessarily deliberately), the effect is still that of overwriting:It seems #2548 added the
--force
flag to overwrite an existing venv. But I don't seem to have the--force
flag listed foruv venv -h
oruv run -h
. I'm aware the UI is still very much in flux, so this isn't in any way a complaint, I just want to make sure you are aware that this is how things are working at the moment.This is uv version 0.2.11 on Linux.
The text was updated successfully, but these errors were encountered: