Skip to content
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

Fix the invalid path of python virtualenv when using glob. #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lemonlatte
Copy link

When I create a virtualenv, the bin folder is a child folder of a virtualenv.
Therefore, with the additional asterisk, activate_this.py won't be find by python glob.

@wuub
Copy link
Owner

wuub commented Dec 10, 2013

python_virtualenv_paths is the list of directories where virtualenvs are created, not a list of virtualenvs.

For example when you use virtualenvwrapper it'll create virtualenvs in ~/.virtualenvs directory, and glob pattern is meant to match following activate_this.py scripts.

~/.virtualenvs/venv1/bin/activate_this.py
~/.virtualenvs/venv2/bin/activate_this.py
~/.virtualenvs/venv3/bin/activate_this.py

@wuub wuub closed this Dec 10, 2013
@lemonlatte
Copy link
Author

Thanks! I know what's different. I set up virtualenv per app rather than centralize them. That's why it is not work for me.

@wuub
Copy link
Owner

wuub commented Dec 10, 2013

Maybe we should add an option of setting specific virtualenv per sublime project? What do you think about that?

@wuub wuub reopened this Dec 10, 2013
@lemonlatte
Copy link
Author

It sounds great to have a project setting. But, I think it is simplify to add a list for virtualenv folders in user setting.

Take my directory for example, I usually setup virtualenv directly under an app. The tree of directory would look like the following:

Source/App1/
Source/App1/.git
Source/App1/.venv
Source/App2/
Source/App2/.git
Source/App2/.venv

Since glob won't find the hidden folder, I point the path to my apps in this way: ~/Source/*/.venv.
This works well for me after I patch the asterisk.

I prefer this kind of solution so that you don't need to configurate virtualenv paths for each projects.

@Chris-May
Copy link

Hey Wojciech!
I'm curious about this thought you proposed back in 2013 about having an option in a sublime project (or possibly sublime workspace?) to specify a virtual environment.

I've been loving SublimeREPL's support for virtual environments when set up with the virtualenv tool, but I've been messing around with python's new native pyvenv command, only to find out that I can't seem to use SublimeREPL with these environments.

I'd be happy to contribute code to help with this. Is this something you would like to see as a part of SublimeREPL?

@gacelita
Copy link
Collaborator

@Chris-May @lemonlatte I'm trying to merge everything, what should I do with this?

@Kristinita
Copy link

@JoelSanchez , when do you plan merge changes to master branch?

Thanks.

@gacelita
Copy link
Collaborator

@Kristinita On one hand, I want people to benefit from the new features, on the other hand I don't want them to suffer the consequences of very little testing.
I have experienced hangs with the merges branch, so those would have to be investigated and fixed before further proceedings.
Apart from that, @wuub is the one who has always released this project, and in fact may be the only one who can, since he has access to the "Secrets", so both of us would have to talk about that.

@Chris-May
Copy link

@JoelSanchez It's been a while since I was in the code base, but I remember opening #459 after realizing that some environments don't use an activate_this.py.

I also realize that people don't always put their virtualenvs in ~/.virtualenvs/, which I think is challenging for this plug-in as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants