diff options
author | David Lukes <dafydd.lukes@gmail.com> | 2020-01-27 09:38:44 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2020-02-02 16:21:55 -0800 |
commit | bf85cc09098fcbe1209d0951262ef78ef08b9ac2 (patch) | |
tree | 448354ae587c7f7de664669dfc0d36a0ef25abe2 /src | |
parent | 3051342f96fd49820490237013ce1ba21171f72b (diff) | |
download | rneovim-bf85cc09098fcbe1209d0951262ef78ef08b9ac2.tar.gz rneovim-bf85cc09098fcbe1209d0951262ef78ef08b9ac2.tar.bz2 rneovim-bf85cc09098fcbe1209d0951262ef78ef08b9ac2.zip |
checkhealth: better $VIRTUAL_ENV validation #11781
fix #11753
close #11781
The virtualenv troubleshooting in the Python provider health checks is
supposed to help the user determine whether running Python from Neovim
(as in `system('python')` or `system(exepath('python'))`) will use the
correct executable when a virtualenv is active. Currently however, it
issues spurious warnings in legitimate setups, and conversely, fails to
warn about potentially problematic ones.
See https://github.com/neovim/neovim/issues/11753#issuecomment-578715584
for a more detailed analysis, but at a high level, this is due to two
things:
- the virtualenv check is part of the Python provider check defined in
`s:check_python`, which uses a roundabout and sometimes erroneous way of
determining the Python executable
- more generally, it shouldn't be part of the provider check at all,
because it's not really related to the Python *provider*, i.e. the
Python executable which can communicate with Neovim via `pynvim`, but to
the Python the user is editing source files for, which typically
shouldn't even have `pynvim` installed
This patch reimplements the virtualenv check and factors it out into its
own separate function, which is however still kept in
`health/provider.vim` alongside the rest of the Python troubleshooting,
since troubleshooting all Python-related stuff in one place is probably
a good idea in order to alleviate any potential confusion (e.g. users
who run only provider checks might be left wondering whether their
virtualenv Python was properly detected if the report only shows their
global Python as the provider used by Neovim).
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions