linux-cultist / venv-selector.nvim

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

can't find local venv - bad fdfind arguments #38

Closed cdar closed 1 year ago

cdar commented 1 year ago

Hi! Thank you for this project :) Plugin can't find my local venv

VenvSelect: 
{
  anaconda_path = "$CONDA_PREFIX/envs",
  auto_refresh = false,
  cache_dir = "/home/user/.cache/venv-selector/",
  cache_file = "/home/user/.cache/venv-selector/venvs.json",
  changed_venv_hooks = { <function 1>, <function 2> },
  dap_enabled = false,
  enable_debug_output = true,
  hatch_path = "~/.local/share/hatch/env/virtual",
  name = { "env", "venv", ".venv" },
  notify_user_on_activate = true,
  parents = 2,
  pipenv_path = "~/.local/share/virtualenvs",
  poetry_path = "~/.cache/pypoetry/virtualenvs",
  pyenv_path = "~/.pyenv/versions",
  search = true,
  search_venv_managers = true,
  search_workspace = true,
  venvwrapper_path = "$HOME/.virtualenvs"
}
VenvSelect: Setting fd_binary_name to 'fdfind' since it was found on system instead of fd.
VenvSelect: Telescope path: /home/user/projects/project1/project2/src/apps/web
VenvSelect: Refresh telescope since there are no previous results.
VenvSelect: Removed telescope results.
VenvSelect: Finding parent venvs in: /home/user/projects/project1/project2/src
VenvSelect: Found workspace folder: /home/user/projects/project1/project2
VenvSelect: Running search for workspace venvs with: fdfind -HItd --absolute-path --color never '(^env$|^venv$|^.venv$)' --full-path /home/user/projects/project1/project2 
VenvSelect: Running search for venv manager venvs with: fdfind . -HItd -tl --absolute-path --max-depth 1 --color never --full-path /home/user/.cache/pypoetry/virtualenvs --full-path /home/user/.pyenv/versions 
VenvSelect: Found venv in VenvManager search: /home/user/.cache/pypoetry/virtualenvs/ddtrt-dqZtyGoo-py3.10
VenvSelect: Found venv in VenvManager search: /home/user/.pyenv/versions/3.11.0
VenvSelect: There are 2 results to show:
VenvSelect: 
{ {
    icon = "",
    path = "/home/user/.cache/pypoetry/virtualenvs/dsj2102-dqZtyGoo-py3.10"
  }, {
    icon = "",
    path = "/home/user/.pyenv/versions/3.11.0"
  } }

The problem I think lies in

fdfind -HItd --absolute-path --color never '(^env$|^venv$|^.venv$)' --full-path /home/user/projects/project1/project2

This returns nothing. But this does:

fdfind -HItd --absolute-path --color never '(^env$|^venv$|^.venv$)' /home/user/projects/project1/project2

Removed --full-path.

Best regards.

linux-cultist commented 1 year ago

Thanks for creating an issue. I see that your manages venvs seems to show up but not the manually created venvs then?

I will see if I can reproduce it somehow. What version of fdfind do you have?

linux-cultist commented 1 year ago

I was able to reproduce the bug here as well. Was it searching for workspace venvs (venv folders located in your project folder) that was not working?

The example line you showed was from the workspace search so I assume thats what you meant. And I could also see on my system that it was not being picked up.

Let me know if the latest commit has fixed the issue for you. Thanks!

linux-cultist commented 1 year ago

Closing this and hope it's been fixed. If not, just comment on the issue. Thanks!

cdar commented 1 year ago

Yes! It's fixed. Thank you very much :)

linux-cultist commented 1 year ago

Awesome!