sansyrox / vim-python-virtualenv

A vim plugin which automatically manages the python virtual envs for you
MIT License
17 stars 2 forks source link

asdf support? #3

Open boldandbusted opened 2 years ago

boldandbusted commented 2 years ago

Howdy. Thanks for this Vim plugin. I use asdf-python and would love to use this vim plugin with a Python installed by asdf. It seems that I'd have to explicitly set the path to the Python binary, though, which makes integration a bit more onerous. Any chance of support for 'discovering' which Python is in the PATH rather than having to tell the plugin where it is? Cheers!

sansyrox commented 2 years ago

@boldandbusted , I will be happy to have a look.

But can you tell me the output of which python or a shell command that I can use to get the path of python being used by asdf-python?

boldandbusted commented 2 years ago

@boldandbusted , I will be happy to have a look.

But can you tell me the output of which python or a shell command that I can use to get the path of python being used by asdf-python?

Sure! This is polluted by yet another indirection layer from Poetry:

$ ls -la `which -a python`
lrwxrwxrwx 1 jesse jesse  10 Sep 13 11:30 /home/jesse/.asdf/installs/python/3.10.7/bin/python -> python3.10
-rwxr-xr-x 1 jesse jesse 129 Sep 13 11:30 /home/jesse/.asdf/shims/python
lrwxrwxrwx 1 jesse jesse  52 Sep 13 14:16 /home/jesse/.cache/pypoetry/virtualenvs/example-python-repo-d_Oju2Az-py3.10/bin/python -> /home/jesse/.asdf/installs/python/3.10.7/bin/python3

The first two are created by asdf. But, my hope is that this plugin won't care about that - it just uses the environment's PATH, no matter how silly. :D

Thanks!