asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
655 stars 56 forks source link

Executing shims of different python versions #27

Closed alejandrodnm closed 6 years ago

alejandrodnm commented 6 years ago

Hi, my problem is the following, I'm using tox with the following python versions 2.7, 3.5 and 3.6.

I have currently set python 3.5 as local in my project, when I launch the tox command it tries to create a virtualenv for each version, it successfully creates the one for 2.7 and 3.5, but when it tries to create the one for 3.6 it fails.

ERROR: py36: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError("Failed to get version_info for python3.6: b''",)

If I try executing pyvenv-3.6 or python3.6 while my current python is 3.5 I get

No such command in 3.5.3 of python

My solution was executing tox twice, once per each python3 version, so that each execution creates the required virtualenv. This works because the virtualenvs tox creates are not modified unless you modify the tox.ini file, but It's more of a dirty fix than anything else.

Am I doing something wrong? or is this the intended behavior?

danhper commented 6 years ago

What does asdf current python gives you? You can have multiple versions of python set, so if you need 3.6, 3.5 and 2.7, something like this should work

asdf local python 3.6.2 3.5.1 2.7.11

Could you give it a try and let me know how it goes?

alejandrodnm commented 6 years ago

It worked :) thanks @tuvistavie sorry I didn't you could specify multiple versions.

danhper commented 6 years ago

I added this feature to asdf specially for this use case 😃