rcarriga/vim-ultest

Bug: Plugin needs `pynvim` installed in activated venv

dbischof90 opened this issue · 1 comments

Describe the bug
I tried to make it run and it does work now - however I had to install pynvim in the venv I am using for my projects - it is installed in my main environment but for some reason ultest does only consider my venv-interpreter. As I work with poetry, this would imply I needed to install the module in each project, which is a minor annoyance but I would like to know whether it's not possible to separate some of the calls that reference the editor functionality. I see in

from pynvim import Nvim, function, plugin
for example that you import pynvim there, I assume that happens with the $VIRTUAL_ENV interpreter, which is called if you do these calls here:
call s:Call('_ultest_run_all', a:000)

This is not a "bug" per se but I'd say it's a desirable behaviour! :)

To Reproduce
Steps to reproduce the behavior:

  • Install vim-ultest with packer
  • install pynvim in system interpreter
  • create new venv, install pytest and activate it
  • configure pytest as test launcher in config file
  • launch nvim on file containing tests

Expected behavior
vim-ultest works if the currently activated venv is not using pynvim and sources the interpreter defined in g:python3_host_prog instead to prevent the (small) issue of installing pynvim into all projects.

I take it back. I defined vim.g.python3_host_prog = '/usr/bin/python' in .config/nvim/after/ftplugin/python.lua and that gets loaded too late apparently. All good now, great plugin :)