linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
388 stars 41 forks source link

The directory where pyenv installs python is the same as the directory where pyenv-virtualenv puts venv. #52

Closed neolooong closed 10 months ago

neolooong commented 11 months ago

I think the plugin should only show venv directory.

linux-cultist commented 11 months ago

Hi,

Im not sure what this means. You mean removing the last /venv part from the listed venvs in Telescope to make it visually nicer?

neolooong commented 11 months ago

pyenv install 3.10.12 install python 3.10.12 in ~/.pyenv/versions. pyenv virtualenv 3.10.12 venv-31012 create a virtual environment in ~/.pyenv/versions.

截圖 2023-08-20 下午10 30 52

I mean, only venv-31012 is virtual environment. VenvSelector should not display 3.10.12

linux-cultist commented 11 months ago

Oh ok, I see what you mean now. Thank you. Im not too familiar with pyenv, and I didnt know it would install python itself inside the same path. I will see what i can do. :)

linux-cultist commented 10 months ago

This is fixed now in the latest commit. The plugin excludes any 3.*.* paths when searching for venv managers. Its not a perfect solution but fd doesnt understand regexp in excluding paths, so this was the best I could do without having my own filter function and do a secondary filter inside lua.

Hopefully people dont name their managed venvs in the same way as python versions, because then they wont show up.

Im closing this but feel free to reopen if they still show up for you. :)

neolooong commented 10 months ago

Maybe we can check pyvenv.cfg if exists in the venv folder.

linux-cultist commented 10 months ago

You mean to only exclude the path if there is a pyvenv.cfg in the venv folder?