mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Improve error reporting for Python health check
- s:version_info: return errors from the `import` - skip report_ok for latest version, in case the current version was not found. status contains the error that has been reported in that case already.
This commit is contained in:
parent
339dd4b1fb
commit
0583ca63a5
@ -155,13 +155,10 @@ function! s:version_info(python) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let nvim_path = s:trim(s:system([
|
let nvim_path = s:trim(s:system([
|
||||||
\ a:python,
|
\ a:python, '-c', 'import neovim; print(neovim.__file__)']))
|
||||||
\ '-c',
|
if s:shell_error || empty(nvim_path)
|
||||||
\ 'import neovim; print(neovim.__file__)']))
|
return [python_version, 'unable to load neovim Python module', pypi_version,
|
||||||
let nvim_path = s:shell_error ? '' : nvim_path
|
\ nvim_path]
|
||||||
|
|
||||||
if empty(nvim_path)
|
|
||||||
return [python_version, 'unable to find nvim executable', pypi_version, 'unable to get nvim executable']
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Assuming that multiple versions of a package are installed, sort them
|
" Assuming that multiple versions of a package are installed, sort them
|
||||||
@ -172,7 +169,7 @@ function! s:version_info(python) abort
|
|||||||
return a == b ? 0 : a > b ? 1 : -1
|
return a == b ? 0 : a > b ? 1 : -1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let nvim_version = 'unable to find nvim 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)
|
||||||
@ -390,7 +387,7 @@ function! s:check_python(version) abort
|
|||||||
if s:is_bad_response(status)
|
if s:is_bad_response(status)
|
||||||
call health#report_warn(printf('Latest %s-neovim is NOT installed: %s',
|
call health#report_warn(printf('Latest %s-neovim is NOT installed: %s',
|
||||||
\ python_bin_name, latest))
|
\ python_bin_name, latest))
|
||||||
elseif !s:is_bad_response(latest)
|
elseif !s:is_bad_response(latest) !s:is_bad_response(current)
|
||||||
call health#report_ok(printf('Latest %s-neovim is installed: %s',
|
call health#report_ok(printf('Latest %s-neovim is installed: %s',
|
||||||
\ python_bin_name, latest))
|
\ python_bin_name, latest))
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user