-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add clean option for Makefile #9
Conversation
Recently had a problem when forgotting to clean venv on windows leading to Permission Error. Looks like it's treating the venv created on my previous session as not belonging to me. Weird, but cleaning it and remaking the venv solves the issue.
Makefile
Outdated
|
||
clean: | ||
@echo "I'm cleaning OwO" | ||
rm -rf venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to not pull the supporting directory out from underneath an activated virtualenv
.
Please add a guard to detect if the virtualenv
is active and deactivate it if so.
Something like:
declare -F deactivate && deactivate
rm -rf venv
deactivate
is a shell function that is inserted into the environment when source venv/bin/activate
is run and removed when deactivate
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, apparently Makefile cannot find the deactivate or the activate command to call. Based on this, it seems like every make command is executed in a new shell, which leads to our problem. One solution I found is we can use virtualenvwrapper as an extension, but we should decide together to use it or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've heard good things about virtualenvwrapper
. Initially stuck with virtualenv
since it's commonly used.
Other ones to look at before finalizing on that are the pyenv
plugins for virtualenv
s:
https://github.com/pyenv/pyenv-virtualenv
https://github.com/pyenv/pyenv-virtualenvwrapper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I've cleared the clean-env and will work on the virtualenvwrapper on my own free time. Should be ready to get merged now so you can merge your coverage PR.
Recently had a problem when forgotting to clean venv on my Windows machine leading to Permission Error. Looks like it's treating the venv created on my previous session as not belonging to me. Weird, but cleaning it and remaking the venv solves the issue, so I'm just creating an option for cleaning for convenience if anyone needs it.