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(provider): leave provider specifications to user #887

Merged
merged 3 commits into from
Jul 26, 2023

Conversation

misumisumi
Copy link
Collaborator

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Jul 22, 2023

the pr should done it's job (i just eyeballed it, not really applying the pr), but i wonder if their's a better approach to it.

@Jint-lzxy
Copy link
Collaborator

but i wonder if their's a better approach to it

The workaround that crossed my mind is to allow users to define their custom Python provider(s) (which may include command-line options). But I'm not sure if this is feasible cause I rarely use Python-related stuffs

@misumisumi
Copy link
Collaborator Author

At least in NxOS, it is difficult to know the exact configuration of the latest neovim from outside of nix, since the product is managed as a hash.

@fecet
Copy link
Contributor

fecet commented Jul 23, 2023

I use python everyday but I use conda to manage envs so just respect which python works fine for me.

Another approach is to respect the settings in poetry (or similar thing) like https://github.com/vsedov/nvim/blob/master/lua/modules/lsp/lsp/providers/python/pylance.lua

@misumisumi
Copy link
Collaborator Author

misumisumi commented Jul 24, 2023

The focus of the issue I was thinking about was about NixOS.
I did not consider other python environments such as poetry.
Therefore, I would like to raise the PullReqesut again, not on the issue of changing python_host_prog, but on the issue of NixOS support.
The title of the issue will be changed.
Concerns, etc. #886

@misumisumi misumisumi mentioned this pull request Jul 24, 2023
2 tasks
@Jint-lzxy
Copy link
Collaborator

So to summarize, is it feasible to directly use the exec python provided by vim.fn.exepath?

@misumisumi
Copy link
Collaborator Author

So to summarize, is it feasible to directly use the exec python provided by vim.fn.exepath?

It can be used if it contains the necessary libraries for python such as global or conda or venv.
If not, NixOS requires python(3)_host_prog to be set correctly.
Because the python provided by vim.fn.exepath is user-wide python and does not contain the libraries neovim uses.
The environment containing the necessary libraries for neovim is provided by the command nvim-python3.

@Jint-lzxy
Copy link
Collaborator

IMO in this case we can just leave it alone, cause if this option is nil Neovim would use the fallback (i.e., the one on $PATH) if it exists.

@Jint-lzxy Jint-lzxy changed the title add(settings): dont_set_python_host_prog option fix(provider): leave provider specifications to user Jul 26, 2023
@Jint-lzxy
Copy link
Collaborator

fb17e95

@Jint-lzxy Jint-lzxy requested review from CharlesChiuGit and ayamir and removed request for CharlesChiuGit July 26, 2023 07:02
Copy link
Collaborator

@CharlesChiuGit CharlesChiuGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayamir ayamir merged commit acfc2f4 into ayamir:main Jul 26, 2023
2 checks passed
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this pull request Jul 26, 2023
* add(settings): dont_set_python_host_prog option

* fix(provider): leave provider specifications to user

* remove unused code

---------

Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
@misumisumi misumisumi deleted the dont_set_python_host_prog branch August 28, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants