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

Virtualenv support #44

Open
kura opened this issue Jun 13, 2017 · 4 comments
Open

Virtualenv support #44

kura opened this issue Jun 13, 2017 · 4 comments
Assignees
Labels

Comments

@kura
Copy link

kura commented Jun 13, 2017

Could you add in support for virtualenv? It's basically a bad idea to ever develop Python without using separate virtual environments, especially when working with multiple projects, each with different requirements.

I bypassed the problem by installing pylama in to it's very own virtual env and specifying that bin location within the config of this linter, but it bugs me and I've had different results based on whether I'm using 2 or 3. Right now I'm having to modify the path when working on a Python 2 project and when I go back to 3.

Projects like https://github.com/autocomplete-python/autocomplete-python allow you to configure a bin path with replacement variable, so for instance you could use the following path to specify project specific python binaries (amazing when switching between 2 and 3.) /home/kura/.virtualenvs/$PROJECT_NAME/bin/python

Another option I use to automatically inject the python path is https://atom.io/packages/atomenv. With this I can inject $PATH in the same format it is injected using virtualenvwrapper. Sadly this doesn't work with this linter as far as I can tell.

Either of these options would be insanely useful to those of us working on insanely large codebases and dozens of projects with various testing/linting requirements and versions of Python.

@pchomik pchomik self-assigned this Jun 18, 2017
@pchomik
Copy link
Owner

pchomik commented Jun 18, 2017

Thank you for idea and report.
I have to double check your proposition.
In meantime you can look into pyenv:

With this tool you are setting /home/user/.pyenv/shims/python path and pyenv will handle rest for you.
From what I found "shims" directory is something dynamic in pyenv. Content based on current directory.

Nevertheless I will check your proposition.

@kura
Copy link
Author

kura commented Jun 18, 2017

I don't actually really like pyenv and so don't use it. I use virtualenv, virtualenvwrapper, pipsi and tox depending on what I'm doing. If I activate a virtualenv by hand and call atom-beta . or atom . then atom will launch and the linter will work, but if for instance I have an editor instance open and I open another project, the editor will not have the right context. Because I haven't explicitly activate a virtualenv and then opened atom through the CLI again then the linter fails because there isn't an executable for it to use.

Hence why I asked if you could inject the path, that way it's all done automatically without having to explicitly activate any environments.

Hope the updated info helps.

@pchomik
Copy link
Owner

pchomik commented Jun 19, 2017

Helps a lot. This atomenv plugin looks promising to introduce new functionality and support your request.

@kura
Copy link
Author

kura commented Jun 19, 2017

Sweet! Yeah, that package is super useful, for me anyway. Can dump a ton of information in to the editor, although it'd be all but useless without https://atom.io/packages/auto-run.

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

No branches or pull requests

2 participants