-
-
Notifications
You must be signed in to change notification settings - Fork 940
Support pyenv in pyls #1393
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
Support pyenv in pyls #1393
Conversation
Different environment is supported for pyls in palantir/python-language-server#680. Try to get the environment specified by pyenv and pass it in.
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.
Thank you for the PR!
Here it is my review which mainly contains stylistic comments. I have no expertise in python and I will let @mpanarin comment/decide if your approach is ok. I think that it will be useful if we have a wiki/tutorial describing how this works. I am fine if you want to link your blog, etc.
- For Custom settings PROPS, adds doc for lambda function support and strips a prop if it is not boolean and is [evaluated to be] nil. - Add an option `lsp-pyls-plugins-jedi-environment` to set pyls environment. - Move `lsp-pyls-plugins-jedi-use-pyenv-environment` check into the lambda function so it will be evaluated per workspace. - Style fixes.
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.
Thank you for addressing the comments!
One more nit after the restructuring: you may now merge both lsp-register-custom settings since after moving (when lsp-pyls-plugins-jedi-use-pyenv-environment inside the lambda it makes more sense to merge them.
I am approving the PR and we will be waiting for @mpanarin's review.
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.
Thanks for the great PR!
A few things though
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.
Okay, I'm fine with this. Although, imo, lsp-mode should be decoupled from python versioning (at least later on).
Please, make a wiki post on how to use this feature
We should look for good pyenv module for emacs that will handle that, instead of trying to support pyenv inside lsp-mode. Because if we support pyenv, then we should also think about asdf or other tools, which is obviously a road to nowhere.
@yyoncho please have a quick look on changes to lsp-register-custom-settings. Otherwise it is ready to be merged
Different environment is supported for pyls in
palantir/python-language-server#680. Try to get the
environment specified by pyenv and pass it in.