-
Notifications
You must be signed in to change notification settings - Fork 765
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
overwrites existing virtual environment on subsequent run
#1472
Comments
Thanks for the report, related #1274 |
uv venv
overwrites existing virtual environment on subsequent run
I don't think we should delete them by default cc @charliermarsh |
For reference, the upstream |
So, what do you think on the UX of this command? For me it also seems unintuitive when I am using |
@flyaroundme that would definitely be a much less surprising behavior. Good suggestion! |
I'd imagine a better UX would be to fail hard and loud. |
+1 on "fail hard and loud" to avoid ambiguity - but then I believe # run `source ./project.sh` to get the project and environment for it up and running
export SOMETHING=something
python -m venv
source ./venv/bin/activate
python -m pip install -e .[dev] , keeping the project and its deps in sync - but not wiping any additional tools if I have put there for some experiments. Yet I can easily imagine that one would like to wipe the existing venv instead. |
Lots of ux discussion in #2548 |
Perhaps the question is whether the sense of the default should be inverted i.e. update existing by default, only replace if |
I find it very unusual for a cli tool to overwrite and existing directory by default, without warning or prompting. Now I have learned this is the intended behavior, but the number of people reporting being confused by this suggests that some UI change would be helpful. |
I don't love the existing behavior, but, for what it's worth, this issue has about three upvotes and we see an order of magnitude more than that on issues that many people encounter. |
+100 on "fail hard and loud". Just lost a bunch of files because of this. I mean: what's the win in the current behaviour? Spare one rm -rf *? uv is no doubt a brilliant tool and I love it. But PLEASE change this. |
+10000 on fail hard and loud. Because of this I accidentally grenaded my entire home assistant installation. Now my smart home is borderline useless. No heat, no lights, nothing; I have my whole house in there. Yes I have backups, but I have to retrieve them and restoring them isn't an immediate process - meanwhile my baby is crying, my wife's pissed, the list goes on. I've been a Linux engineer for close to a decade, in some high caliber environments - and I think I can count on one hand the times where I used a tool, with only one or two arguments, copied and pasted from the --help usage message, that automatically assumed that I wanted to completely blow away everything in the current directory, and was so confident in it, that it didn't even give me a simple "You sure? [y/N]" . Maybe I just wanted to share my story, or just vent.. but damn man this one hurt. |
@kmalinich -- Hey -- regardless of what decision we make here, just wanted to say that I can feel your frustration coming through and I'm really sorry that you ran into this in such a critical path. A lot for us to consider in your message. |
@charliermarsh -- I want you to know that your words meant a lot to me. Thank you. I'm all back up and running here, and I've calmed down a fair bit. Sorry about that, that was some pretty explosive messaging on my part.
Anyways, thanks again for the kind words. It's nice to .. just be heard, sometimes. |
I'm down to change this in 0.5.0 — but we'll need to discuss this as a team and figure out if there's consensus on a new ux. |
Current behaviour: subsequent runs of
uv venv
overwrite the existing virtual environment.Suggested behaviour: How about adding a prompt like "the virtual env is already created, confirm to recreate from scratch".
The text was updated successfully, but these errors were encountered: