I just created a Python plugin.
https://github.com/tuvistavie/asdf-python
It only handles cpython, not other flavors.
The handling of the python executable is a little hacky, any idea if there is a better way to do this?
https://github.com/tuvistavie/asdf-python/blob/master/shims/python
The issue here is that Python3 does not have a python executable and so python gives no such command, which I do not think is desirable.
Also, for Python it is a little bit of an issue not to be allowed to set multiple versions of a language.
For example, pyenv allows to set
3.5.1
2.7.11
if the command exists in 3.5.11, it will use it, otherwise fallback to 2.7.11.
There are a lot of scripts in Python which uses #!/usr/bin/env python2 or #!/usr/bin/env python3, and these would break if the currently set version does not match.
@HashNuke Do you think we could modify asdf to be able to write something such as
python 3.5.1 2.7.11
in .tool-versions, to use the second version as a fallback for the command?
@tuvistavie Ah. That's a pretty huge edge case. If that's what it takes to support python, yes - whatever changes required.
@HashNuke Yeah, Python is really problematic for these things. I'm going to give it a try, I want to stop using pyenv :smile:
@tuvistavie anything I can do?
@HashNuke It should simply be a matter of changing asdf-exec a little, so it should not take too long, thank you :smiley:
Python plugin should work fine, closing :smile: