diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2018-11-17 15:27:09 +0100 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2018-11-17 17:56:34 +0100 |
commit | 3ea14d53664ca7dba648e650d4047e01a8518231 (patch) | |
tree | 2c38064520506d6cc5f96e8acda7cfc9eed31cdc | |
parent | 25356f2802b5b98efe7f0d6661979b0a919c4d2d (diff) | |
download | rneovim-3ea14d53664ca7dba648e650d4047e01a8518231.tar.gz rneovim-3ea14d53664ca7dba648e650d4047e01a8518231.tar.bz2 rneovim-3ea14d53664ca7dba648e650d4047e01a8518231.zip |
health/python: 'neovim' module was renamed to 'pynvim'
-rw-r--r-- | runtime/autoload/health/provider.vim | 22 | ||||
-rw-r--r-- | runtime/autoload/provider/pythonx.vim | 12 |
2 files changed, 17 insertions, 17 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 9a04649bfa..a99b600aba 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -152,10 +152,10 @@ function! s:check_clipboard() abort endif endfunction -" Get the latest Neovim Python client version from PyPI. +" Get the latest Neovim Python client (pynvim) version from PyPI. function! s:latest_pypi_version() abort let pypi_version = 'unable to get pypi response' - let pypi_response = s:download('https://pypi.python.org/pypi/neovim/json') + let pypi_response = s:download('https://pypi.python.org/pypi/pynvim/json') if !empty(pypi_response) try let pypi_data = json_decode(pypi_response) @@ -192,9 +192,9 @@ function! s:version_info(python) abort let nvim_path = s:trim(s:system([ \ a:python, '-c', \ 'import sys; sys.path.remove(""); ' . - \ 'import neovim; print(neovim.__file__)'])) + \ 'import pynvim; print(pynvim.__file__)'])) if s:shell_error || empty(nvim_path) - return [python_version, 'unable to load neovim Python module', pypi_version, + return [python_version, 'unable to load pynvim Python module', pypi_version, \ nvim_path] endif @@ -206,13 +206,13 @@ function! s:version_info(python) abort return a == b ? 0 : a > b ? 1 : -1 endfunction - " Try to get neovim.VERSION (added in 0.1.11dev). + " Try to get pynvim.VERSION (added in 0.1.11dev). let nvim_version = s:system([a:python, '-c', - \ 'from neovim import VERSION as v; '. + \ 'from pynvim import VERSION as v; '. \ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'], \ '', 1, 1) if empty(nvim_version) - let nvim_version = 'unable to find neovim Python module version' + let nvim_version = 'unable to find pynvim Python module version' let base = fnamemodify(nvim_path, ':h') let metas = glob(base.'-*/METADATA', 1, 1) \ + glob(base.'-*/PKG-INFO', 1, 1) @@ -293,7 +293,7 @@ function! s:check_python(version) abort let [pyname, pythonx_errs] = provider#pythonx#Detect(a:version) if empty(pyname) - call health#report_warn('No Python interpreter was found with the neovim ' + call health#report_warn('No Python interpreter was found with the pynvim ' \ . 'module. Using the first available for diagnostics.') elseif exists('g:'.host_prog_var) let python_bin = pyname @@ -352,7 +352,7 @@ function! s:check_python(version) abort call health#report_warn('pyenv is not set up optimally.', [ \ printf('Create a virtualenv specifically ' \ . 'for Neovim using pyenv, and set `g:%s`. This will avoid ' - \ . 'the need to install the Neovim Python module in each ' + \ . 'the need to install the pynvim module in each ' \ . 'version/virtualenv.', host_prog_var) \ ]) elseif !empty(venv) @@ -366,7 +366,7 @@ function! s:check_python(version) abort call health#report_warn('Your virtualenv is not set up optimally.', [ \ printf('Create a virtualenv specifically ' \ . 'for Neovim and use `g:%s`. This will avoid ' - \ . 'the need to install Neovim''s Python module in each ' + \ . 'the need to install the pynvim module in each ' \ . 'virtualenv.', host_prog_var) \ ]) endif @@ -420,7 +420,7 @@ function! s:check_python(version) abort if s:is_bad_response(current) call health#report_error( \ "Neovim Python client is not installed.\nError: ".current, - \ ['Run in shell: pip' . a:version . ' install neovim']) + \ ['Run in shell: pip' . a:version . ' install pynvim']) endif if s:is_bad_response(latest) diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index b51c398410..189159ab9e 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -10,7 +10,7 @@ function! provider#pythonx#Require(host) abort " Python host arguments let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog()) - let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()'] + let args = [prog, '-c', 'import sys; sys.path.remove(""); import pynvim; pynvim.start_host()'] " Collect registered Python plugins into args let python_plugins = remote#host#PluginsForHost(a:host.name) @@ -62,17 +62,17 @@ function! s:check_interpreter(prog, major_ver) abort let min_version = (a:major_ver == 2) ? '2.6' : '3.3' - " Try to load neovim module, and output Python version. + " Try to load pynvim module, and output Python version. " Return codes: - " 0 Neovim module can be loaded. - " 2 Neovim module cannot be loaded. + " 0 pynvim module can be loaded. + " 2 pynvim module cannot be loaded. " Otherwise something else went wrong (e.g. 1 or 127). let prog_ver = system([ a:prog , '-c' , \ 'import sys; ' . \ 'sys.path.remove(""); ' . \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . \ 'import pkgutil; ' . - \ 'exit(2*int(pkgutil.get_loader("neovim") is None))' + \ 'exit(2*int(pkgutil.get_loader("pynvim") is None))' \ ]) if v:shell_error == 2 || v:shell_error == 0 @@ -87,7 +87,7 @@ function! s:check_interpreter(prog, major_ver) abort endif if v:shell_error == 2 - return [0, prog_path.' does not have the "neovim" module. :help provider-python'] + return [0, prog_path.' does not have the "pynvim" module. :help provider-python'] elseif v:shell_error == 127 " This can happen with pyenv's shims. return [0, prog_path . ' does not exist: ' . prog_ver] |