aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/health/provider.vim
diff options
context:
space:
mode:
authorAru Sahni <aru@arusahni.net>2021-04-14 14:48:13 -0400
committerGitHub <noreply@github.com>2021-04-14 20:48:13 +0200
commitd9c7adc64c291f1a368c1417354332f72bdb66d6 (patch)
tree8c42cceb1ab65ce08cf0a0b374b458e1b567929b /runtime/autoload/health/provider.vim
parent6ab4c8f955ad6aca85c7a5d6faa192d9b14abd71 (diff)
downloadrneovim-d9c7adc64c291f1a368c1417354332f72bdb66d6.tar.gz
rneovim-d9c7adc64c291f1a368c1417354332f72bdb66d6.tar.bz2
rneovim-d9c7adc64c291f1a368c1417354332f72bdb66d6.zip
doc: prefer "python -m pip" (#14353)
The current guidance for install Python packages is to use python -m pip install <package_name> Instead of pip install <package_name> This ensures that one is using the version of pip that is tied to the environment's interpreter (and, thusly, its packages). This has [been endorsed by a core maintainer](https://snarky.ca/why-you-should-use-python-m-pip/) as being the recommended way to invoke pip. As there currently are a few places where the old invocation was used, attempt to bring them in line. Fixes #14234
Diffstat (limited to 'runtime/autoload/health/provider.vim')
-rw-r--r--runtime/autoload/health/provider.vim10
1 files changed, 4 insertions, 6 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 112dd4354f..de540405e6 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -400,8 +400,6 @@ function! s:check_python(version) abort
endfor
endif
- let pip = 'pip' . (a:version == 2 ? '' : '3')
-
if empty(python_exe)
" No Python executable can import 'neovim'. Check if any Python executable
" can import 'pynvim'. If so, that Python failed to import 'neovim' as
@@ -413,9 +411,9 @@ function! s:check_python(version) abort
\ 'Detected pip upgrade failure: Python executable can import "pynvim" but '
\ . 'not "neovim": '. pynvim_exe,
\ "Use that Python version to reinstall \"pynvim\" and optionally \"neovim\".\n"
- \ . pip ." uninstall pynvim neovim\n"
- \ . pip ." install pynvim\n"
- \ . pip ." install neovim # only if needed by third-party software")
+ \ . pynvim_exe ." -m pip uninstall pynvim neovim\n"
+ \ . pynvim_exe ." -m pip install pynvim\n"
+ \ . pynvim_exe ." -m pip install neovim # only if needed by third-party software")
endif
else
let [pyversion, current, latest, status] = s:version_info(python_exe)
@@ -440,7 +438,7 @@ function! s:check_python(version) abort
if s:is_bad_response(current)
call health#report_error(
\ "pynvim is not installed.\nError: ".current,
- \ ['Run in shell: '. pip .' install pynvim'])
+ \ ['Run in shell: '. python_exe .' -m pip install pynvim'])
endif
if s:is_bad_response(latest)