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

WIP: dont fail if the version is available#4

Open
stavxyz wants to merge 2 commits into
masterfrom
pyenvinstall
Open

WIP: dont fail if the version is available#4
stavxyz wants to merge 2 commits into
masterfrom
pyenvinstall

Conversation

@stavxyz

@stavxyz stavxyz commented Mar 7, 2016

Copy link
Copy Markdown
Collaborator

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

stavxyz commented Aug 16, 2016

Copy link
Copy Markdown
Collaborator Author

@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