-
Notifications
You must be signed in to change notification settings - Fork 12
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
Look for the activation script on the venv folder #1
base: master
Are you sure you want to change the base?
Conversation
Hey, sorry it took so long to get back to you, I completely missed this pull request! (GitHub buried it at the bottom of my list!) What version of Python are you running? On all my machines (Python 3.5.3 on one, 3.7.4 on the rest) there is no
|
Ah, that's the difference. You're putting your venv in
This is on python 3.7 but afaik it's always been like that. |
It's probably worth thinking about finding a folder containing |
Right, as an example case I would do I agree that looking for pyvenv.cfg would be a good way to do it. Perhaps we could add an option to look in each sub-directory of the current directory for it? (Basically only look one level deep, aka non-recursive sub-directory searching.) Another option would be to add a command called So, if you’re in ../project_dir and your venv is in ../project_dir/venv, you could use |
I've never seen this case where you create a virtual env and then put the project inside the virtualenv. Then it makes it very cumbersome to delete the virtualenv. You'd have to delete bin, include, lib, lib64, man, pyenv.cfg. This PR doesn't quite solve it for me though, as I put my virtualenv in .venv (because virtual envs should be hidden, amirite?) |
I've provided a more robust solution in PR #2 Basically implemented what @timothybrown suggested:
It should work for all 3 of our cases @luispabon @timothybrown I use |
Superseded by #2 |
@timothybrown sorry one more thing, and then I'll stop. I looked at Home Assitant and that use case is different. In that case, they are creating a virtualenv and installing a pip package (homeassistant). I don't see them actually putting any source inside the virtualenv as well. BUT, if the user was to put some files in there for some purpose, their advice is bad advice. For example, their instructions to do this:
could instead be:
now you can potentially put some other "homeassistant" related stuff in the homeassistant folder, and later blow away the .venv folder at any time. In some other instructions they do this:
but that could easily just be:
There's not much difference.. but in the case where we create the env in a .venv folder, it makes it easy to a) put some other files in the homeassistant directory if necessary and b) blow away the .venv folder any time without disrupting the homeassistant folder. Some potential upside and no downside. |
I'm not sure if venv used to be in the bin folder, but the current convention is to place it in
projectdir/venv
. This updates the script to look for the activation script to source in there.