Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

WIP: dont fail if the version is available #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

stavxyz
Copy link
Collaborator

@stavxyz stavxyz commented Mar 7, 2016

If the python version is shown by pyenv versions, and we
can reasonably figure out the correct version to use (esp. if
it matches the name exactly), enable the version with the
PYENV_VERSION environment variable, and try again
to find the path to the executable using pyenv which.

With this change, we are resilient to errors like the one
below which is seen when running pyenv which. We
simply choose the latest version of python2.6 (for example)
that is available (according to pyenv versions),
set it (using $PYENV_VERSION), and try again. Again, by
doing this we can usually avoid the following error:

$ pyenv which python2.6
pyenv: python2.6: command not found

The `python2.6' command exists in these Python versions:
  2.6.6
  2.6.8

In this case, tox-pyenv sets PYENV_VERSION to 2.6.8
(the latest version that most closely matches) and retries the operation.
We already know the retry will succeed because we saw 2.6.8
in the output from pyenv versions.

This behavior may not be desirable for some, and probably needs a
flag to turn on/off.

Fixes #3

todo

  • add flag to toggle this behavior, default to "on"

💃

@stavxyz stavxyz force-pushed the pyenvinstall branch 2 times, most recently from e31b645 to 4fa7da2 Compare March 7, 2016 15:35
@stavxyz stavxyz changed the title dont fail if the version is available WIP: dont fail if the version is available Mar 8, 2016
@stavxyz stavxyz force-pushed the pyenvinstall branch 2 times, most recently from 94b816d to 341e068 Compare April 7, 2016 14:38
@stavxyz stavxyz force-pushed the pyenvinstall branch 13 times, most recently from 794997d to bc16152 Compare May 22, 2016 23:25
@stavxyz
Copy link
Collaborator Author

stavxyz commented Aug 16, 2016

@blueyed I put this PR together based on this discussion:

pyenv/pyenv#92 (comment)

If you have time, I would appreciate a pair of 👀

If the python version is shown by `pyenv versions`, use
$PYENV_VERSION to enable the version and retry the operation.

Fixes #3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

automatically enable the existing/installed Python versions on InvocationError
1 participant