{health,provider}/python: Import the neovim, rather than pynvim, module

The neovim module is available for backwards compatibility.  We should
not yet force the use of the pynvim module, since there's no other major
reason to bump the minimum supported Python client module.

Closes #9426
parent 57e0a578
...@@ -192,9 +192,9 @@ function! s:version_info(python) abort ...@@ -192,9 +192,9 @@ function! s:version_info(python) abort
let nvim_path = s:trim(s:system([ let nvim_path = s:trim(s:system([
\ a:python, '-c', \ a:python, '-c',
\ 'import sys; sys.path.remove(""); ' . \ 'import sys; sys.path.remove(""); ' .
\ 'import pynvim; print(pynvim.__file__)'])) \ 'import neovim; print(neovim.__file__)']))
if s:shell_error || empty(nvim_path) if s:shell_error || empty(nvim_path)
return [python_version, 'unable to load pynvim Python module', pypi_version, return [python_version, 'unable to load neovim Python module', pypi_version,
\ nvim_path] \ nvim_path]
endif endif
...@@ -206,13 +206,13 @@ function! s:version_info(python) abort ...@@ -206,13 +206,13 @@ function! s:version_info(python) abort
return a == b ? 0 : a > b ? 1 : -1 return a == b ? 0 : a > b ? 1 : -1
endfunction endfunction
" Try to get pynvim.VERSION (added in 0.1.11dev). " Try to get neovim.VERSION (added in 0.1.11dev).
let nvim_version = s:system([a:python, '-c', let nvim_version = s:system([a:python, '-c',
\ 'from pynvim import VERSION as v; '. \ 'from neovim import VERSION as v; '.
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'], \ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
\ '', 1, 1) \ '', 1, 1)
if empty(nvim_version) if empty(nvim_version)
let nvim_version = 'unable to find pynvim Python module version' let nvim_version = 'unable to find neovim Python module version'
let base = fnamemodify(nvim_path, ':h') let base = fnamemodify(nvim_path, ':h')
let metas = glob(base.'-*/METADATA', 1, 1) let metas = glob(base.'-*/METADATA', 1, 1)
\ + glob(base.'-*/PKG-INFO', 1, 1) \ + glob(base.'-*/PKG-INFO', 1, 1)
......
...@@ -10,7 +10,7 @@ function! provider#pythonx#Require(host) abort ...@@ -10,7 +10,7 @@ function! provider#pythonx#Require(host) abort
" Python host arguments " Python host arguments
let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog()) let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
let args = [prog, '-c', 'import sys; sys.path.remove(""); import pynvim; pynvim.start_host()'] let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
" Collect registered Python plugins into args " Collect registered Python plugins into args
let python_plugins = remote#host#PluginsForHost(a:host.name) let python_plugins = remote#host#PluginsForHost(a:host.name)
...@@ -40,7 +40,7 @@ function! provider#pythonx#Detect(major_ver) abort ...@@ -40,7 +40,7 @@ function! provider#pythonx#Detect(major_ver) abort
let errors = [] let errors = []
for prog in progs for prog in progs
let [result, err] = provider#pythonx#CheckForModule(prog, 'pynvim', a:major_ver) let [result, err] = provider#pythonx#CheckForModule(prog, 'neovim', a:major_ver)
if result if result
return [prog, err] return [prog, err]
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment