sashahart / vex

Run a command in the named virtualenv.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not possible to remove a broken venv with vex -r

BartGo opened this issue · comments

If a virtual environment is broken (for example, Ctrl-C is pressed at the beginning of its creation) and not all the folders typical for environment are there (example: we have only Lib folder inside ~/.virtualenvs/env) it is not possible to remove such environment with vex.

vex -r env mycommand
Error: path 'C:\Users\bartgo.virtualenvs\env' did not look like a virtualenv

I am using vex in a bash script and I would like it to drop the environment in any case to guarantee that the environment is empty before installing there things with pip.

Would you please consider implementing a force (-f / --force) flag to be used like vex -rf env mycommand or vex -rmf env command or vex --remove --force env mycommand to force removal of a virtual environment, even if it's broken?

You can remove ~/.virtualenvs/env by hand.

I will not implement a --force. First, that will make it too easy to destroy data unintentionally and I'd hate to see how strongly that Github issue will be phrased. Second, it is very, very important to me not to unnecessarily complicate vex with a hundred new switches for incredibly rare or gratuitous use cases. Much of the whole point is to have a simple interface for common use cases.

I will note that nobody has anything like these expectations for virtualenvwrapper, which is a ton of shell with many of the unhandled errors that implies.