AckslD / swenv.nvim

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.
206 stars 29 forks source link

Pyenv Support #16

Closed NeedleCats closed 9 months ago

NeedleCats commented 1 year ago

Thanks for your work.

I was trying to use the plugin to manage the virtualenvs of pyenv. Since the original version lacks pyenv support, I added it.

AckslD commented 6 months ago

@NeedleCats, I was just looking back at some of this code now, the base get_venvs currently looks like:

M.get_venvs = function(venvs_path)
  local venvs = {}
  vim.list_extend(venvs, get_venvs_for(venvs_path, 'venv'))
  vim.list_extend(venvs, get_venvs_for(get_conda_base_path(), 'conda'))
  vim.list_extend(venvs, get_venvs_for(get_micromamba_base_path(), 'micromamba'))
  vim.list_extend(venvs, get_venvs_for(get_pyenv_base_path(), 'pyenv'))
  vim.list_extend(venvs, get_venvs_for(get_pyenv_base_path(), 'pyenv', { only_dirs = false }))
  return venvs
end

do you remember if both lines for pyenv are needed? :see_no_evil: I can't remember it this had a purpose or I just made a mistake when cleaning up the structure?

Looking at it, it seems like only the later line is needed?