aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/provider/pythonx.vim
Commit message (Collapse)AuthorAge
* fix(provider/pythonx): import the correct module (#25342)zeertzjq2023-09-24
|
* fix(provider): cannot detect python3.12 #25316Jongwook Choi2023-09-23
| | | | | | | | | | | | | | | | | | | PROBLEM: The builtin python3 provider cannot auto-detect python3.12 when g:python3_host_prog is not set. As a result, when python3 on $PATH is currently python 3.12, neovim will fail to load python3 provider and result in `has("python3") == 0`, e.g., "Failed to load python3 host. You can try to see what happened by ..." ROOT CAUSE: the `system()` call from `provider#pythonx#DetectByModule` does not ignore python warnings, and `pkgutil.get_loader` will print a warning message in the very first line: ``` <string>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec() instead ``` SOLUTION: - Use `importlib.util.find_spec` instead (python >= 3.4) - Use `-W ignore` option to prevent any potential warning messages
* refactor(provider): use list comprehension #19027Zaz Brown2022-06-20
| | | | - list(filter(lambda x: x != "", sys.path)) + [p for p in sys.path if p != ""]
* fix(checkhealth): make provider checkhealth output more consistent (#17722)dundargoc2022-03-16
| | | | | Change missing provider plugins from errors to warnings for python and perl. Also give proper advice under the ADVICE section instead of just the errors.
* feat(provider)!: remove support for python2 and python3.[3-5]Björn Linse2022-01-29
| | | | | | These versions of python has reached End-of-life. getting rid of python2 support removes a lot of logic to support two incompatible python versions in the same version.
* fix(provider): compare versions as number, not string #15937Tejasvi S. Tomar2021-10-07
| | | | "3.10" < "3.3" but v3.10 > v3.3 Fixes #14586
* checkhealth: ignore 'wildignore' when seeking executables (#14495)Marco Hinz2021-05-07
| | | | | | Certain values of 'wildignore', .e.g `*/node_modules/**`, would make the provider checks not find the right executables. Fixes https://github.com/neovim/neovim/issues/14388
* provider: update supported Python versions (#13070)Marco Hinz2020-10-08
| | | | | | | | Python 3.9 was released, so we need to add support for the upcoming Python 3.10. Python 3.5 and earlier reached their end-of-life. PEP 478: Python 3.5 Release Schedule: https://www.python.org/dev/peps/pep-0478 PEP 596: Python 3.9 Release Schedule: https://www.python.org/dev/peps/pep-0596 PEP 619: Python 3.10 Release Schedule: https://www.python.org/dev/peps/pep-0619
* Add overlapped option to jobstarterw72020-06-10
| | | | | | | When UV_OVERLAPPED_PIPE was used for the pipe passed to the child process, a problem occurred with the standard input of the .Net Framework application (#11809). Therefore, add the overlapped option to jobstart() and change it so that it is set only when necessary
* provider: Add python3.9 to autoload/provider/pythonx.vim (#12344)Faris A Chugthai2020-05-20
| | | | 3.9's scheduled for beta release today. https://www.python.org/dev/peps/pep-0596/
* provider/python: add python3.8 executable (#11402)Marco Hinz2019-11-17
| | | | | Python 3.8 was released 2019-10-14: https://www.python.org/dev/peps/pep-0569
* provider/pythonx: don't assume CWD (empty string) is in path #11304supermomonga2019-10-27
| | | | | | | | | sys.path.remove("") raises ValueError if the item is missing. https://docs.python.org/3/library/functions.html#filter: > filter(function, iterable) is equivalent to the generator expression (item > for item in iterable if function(item)) fixes #11293
* provider#pythonx: resolve/expand exe from host var (#11047)Daniel Hahler2019-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts part of ade88fe4c [1]. This is required for `let g:python3_host_prog = 'python'` etc, where it should get picked up from PATH. Without this it would show: ``` - INFO: pyenv: Path: /home/user/.pyenv/libexec/pyenv - INFO: pyenv: Root: /home/user/.pyenv - INFO: Using: g:python3_host_prog = "python" - ERROR: "python" was not found. - INFO: Executable: Not found - ERROR: Detected pip upgrade failure: Python executable can import "pynvim" but not "neovim": python - ADVICE: - Use that Python version to reinstall "pynvim" and optionally "neovim". pip3 uninstall pynvim neovim pip3 install pynvim pip3 install neovim # only if needed by third-party software ``` Note that it additionally causes a weird error ("Detected pip upgrade failure"), due to `s:check_bin` emptying `python_exe` (because the non-absolute file not being readable), and `provider#pythonx#DetectByModule('pynvim', a:version)` from 75593e6fce then just getting the value from the host var again (without actual checks). This is implicitly fixed via this patch now (because it is skipped), but could need some improvement in this regard probably. With this patch it resolves it (for a virtualenv where pynvim is not made available intentionally): ``` - INFO: pyenv: Path: /home/daniel/.pyenv/libexec/pyenv - INFO: pyenv: Root: /home/daniel/.pyenv - INFO: Using: g:python3_host_prog = "python" - WARNING: $VIRTUAL_ENV exists but appears to be inactive. This could lead to unexpected results. - ADVICE: - If you are using Zsh, see: http://vi.stackexchange.com/a/7654 - INFO: Executable: /home/daniel/.pyenv/shims/tmp-system-deoplete.nvim-f205aF/python - ERROR: Command error (job=11, exit code 1): `'/home/daniel/.pyenv/shims/tmp-system-deoplete.nvim-f205aF/python' -c 'import sys; sys.path.remove(""); import neovim; print(neovim.__file__)'` (in '/home/daniel/.dotfiles/vim/plugged/deoplete.nvim') Output: Traceback (most recent call last): File "<string>", line 1, in <module>ModuleNotFoundError: No module named 'neovim' Stderr: Traceback (most recent call last): File "<string>", line 1, in <module>ModuleNotFoundError: No module named 'neovim' - INFO: Python version: 3.7.4 - INFO: pynvim version: unable to load neovim Python module - ERROR: pynvim is not installed. Error: unable to load neovim Python module - ADVICE: - Run in shell: pip3 install pynvim ``` Note: this appears to display the error twice via "Output:" and "Stderr:". 1: https://github.com/neovim/neovim/pull/8784
* health/pythonx: handle "pip upgrade failure"Marco Hinz2019-01-07
| | | | Reference: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
* health/pythonx: refactor #Detect()Marco Hinz2019-01-07
|
* python#CheckForModule: Use the given module string instead of hard-coding pynvimJames McCoy2019-01-01
|
* {health,provider}/python: Import the neovim, rather than pynvim, moduleJames McCoy2019-01-01
| | | | | | | | 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
* provider/lang: expand() g:foo_host_prog (#9312)Justin M. Keyes2018-12-05
| | | | | | | | | | Before this commit, if user does this: let g:node_host_prog = '~/.nvm/versions/node/v11.3.0/bin/neovim-node-host' the "~/" is not expanded to user's home directory. `:help g:ruby_host_prog` suggests a path with "~/" so technically we already claimed to support this. closes https://github.com/neovim/node-client/issues/102
* health/python: warn if pynvim upgrade failedMarco Hinz2018-11-20
| | | | Reference: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
* provider/python: refactoringMarco Hinz2018-11-20
|
* health/python: 'neovim' module was renamed to 'pynvim'Marco Hinz2018-11-17
|
* Add provider#Poll() to handle starting and polling the providerJames McCoy2018-02-16
|
* provider: Safely access job.stderr in #RequireJames McCoy2018-02-16
| | | | | | | | | | | | If `jobstart()` fails, then the subsequent `rpcrequest()` will throw due to an invalid channel id. This causes `job.stderr` not to exist, so we throw another exception when trying to dump the job's stderr. Error detected while processing function remote#define#AutocmdBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require: line 22: E716: Key not present in Dictionary: stderr This obfuscates the actual problem.
* provider: delete vimL stderr collector, now that it exists builtinBjörn Linse2017-12-23
|
* Revert "provider: delete vimL stderr collector, now that it exists builtin"Björn Linse2017-11-27
| | | | | | | This change exposed a memory issue with buffered channels, possibly involving GC. Revert until it has been fixed. This reverts commit 0de019b6a65c6dd5141b7e002343df3689065ce7.
* provider: delete vimL stderr collector, now that it exists builtinBjörn Linse2017-11-26
|
* provider: Extra pythonx's stderr handling to common functionsJames McCoy2017-07-24
|
* health.vim: Set 'iskeyword' to that of ft=help.Justin M. Keyes2017-04-19
|
* provider: add Python 3.6 (#5886)Marco Hinz2017-01-05
|
* Remove g:python{,3}_host_skip_check (#5738)Marco Hinz2016-12-09
| | | | | | | | | | | | | | | This option simplifies the configuration options: 1) `g:python{,3}_host_prog` is not set. Neovim tries its best to find a suitable interpreter. This means calling exepath(), potentially multiple times, and a system('python -c ...') with the first found interpreter, to get the Python version. 2) `g:python{,3}_host_prog` is set. Avoids everything of the above. No safety checks, no training wheels. Fast host startup time!
* job control: reuse common job code for rpc jobsBjörn Linse2016-08-20
| | | | This makes stderr and exit callbacks work for rpc jobs
* doc/python: cleanupJustin M. Keyes2016-06-15
| | | | | | - Move info to providers.txt - Remove "nvim-" prefix. - Brevity, clarity, ...
* Merge pull request #4830 from blueyed/proider-pythonx-handle-127Justin M. Keyes2016-05-28
|\ | | | | provider/pythonx: handle exit code 127 from pyenv
| * provider/pythonx: handle exit code 127 from pyenvDaniel Hahler2016-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | This also checks the major/min version only for expected return codes. With pyenv, you might get the following (return code 127): pyenv: python3.4: command not found The `python3.4' command exists in these Python versions: 3.4.3 3.4.3/envs/tmp-3.4.3-eElS6Y tmp-3.4.3-eElS6Y
* | provider/pythonx: use robust comparison (via vint)Daniel Hahler2016-05-28
|/
* Ruby remote plugin supportAlex Genco2016-03-10
|
* rplugin: Initialize remote plugins lazily. #4384Shougo Matsushita2016-03-10
|
* provider/pythonx: Improve detection code and error messages.Florian Walch2015-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | "python -c" returns 1 in case of an error. Use a return code of 2 if the Neovim module is not found to distinguish these cases. Verify the interpreter version before checking for an installed Neovim module. Show a new error message if the Python interpreter version is below the minimum required version. Always use "pkgutil" to determine if the Neovim module is installed. In contrast to "importlib", which was used for Python 3, "pkgutil.find_loader" is available for all Python versions [1,2]. "pkgutil.find_loader" internally uses "importlib" for Python >= 3.3 [2]. Also, the previously used "importlib.find_loader" is only available since Python 3.3 (so checking the major Python version was not enough) and deprecated since Python 3.4 [3]. Finally, conditioning on the major version in Vimscript was incorrect, as checking the Neovim module for a certain Python major version does not mean that the tested interpreters are actually of that version. For example, we test the "python" executable, which is Python 2 on Ubuntu and Python 3 on Arch Linux. [1] https://docs.python.org/2/library/pkgutil.html#pkgutil.find_loader [2] https://docs.python.org/3/library/pkgutil.html#pkgutil.find_loader [3] https://docs.python.org/3/library/importlib.html#importlib.find_loader
* python: remove current working directory from pathJakob Schnitzer2015-09-14
| | | | | | | | | | Before, running Nvim in a directory containing a Python module `neovim`, or one that is imported by it or a plugin, will load that module and not the system one. So Nvim might be tricked into running arbitrary scripts from the current working directory. Fixes #1665 Fixes #2530
* provider/pythonx.vim: Use shell-agnostic construction. #3190sanmiguel2015-08-21
|
* provider/pythonx: Show absolute path to executable in error message.Florian Walch2015-06-09
|
* provider/pythonx: Merge s:check_version() and s:check_interpreter().Florian Walch2015-06-09
|
* provider/pythonx: Don't use Python 3 interpreter for +python.Florian Walch2015-06-09
| | | | | | | | | The executable 'python' can refer to either Python 2 or Python 3. Add a check to only accept Python 2 interpreters as providers for +python. Also improve the error messages. Resolves #2734.
* provider/pythonx: return error from DetectDaniel Hahler2015-06-09
| | | | Ref: https://github.com/blueyed/neovim/commit/9b653ce0#commitcomment-11195449
* provider/pythonx: Detect: only return valid versionsDaniel Hahler2015-06-09
| | | | | The `check` return value of `s:check_version` was not being used, and it was returned always.
* provider/pythonx: test python3/2 first, do not test python3.2Daniel Hahler2015-06-09
| | | | | python3/python2 will typically point at the default / most recent interpreter.
* provider/pythonx: add reference to ":help nvim-python" for errorDaniel Hahler2015-06-09
|
* provider/pythonx: fix grammar with errorDaniel Hahler2015-06-09
|
* provider/pythonx: only call system("python") onceDaniel Hahler2015-06-09
| | | | | `s:check_interpreter` will query/return the version also, so that `s:check_version` can just use that, without calling "python" again.
* Add if_python3 supportShougo Matsushita2015-04-21
Reviewed-by: Michael Reed <m.reed@mykolab.com>, Daniel Hahler <github@thequod.de> Helped-by: Daniel Hahler <github@thequod.de>