Skip to content

Commit

Permalink
Merge pull request pypa#1000 from techalchemy/bugfix/998-pyenv-prerel…
Browse files Browse the repository at this point in the history
…ease

Ignore prerelease python installs from pyenv
  • Loading branch information
nateprewitt committed Oct 31, 2017
2 parents 2cd7b35 + 544dd61 commit 1bf6f51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pipenv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,20 @@ def activate_pyenv():
"""Adds all pyenv installations to the PATH."""
if PYENV_INSTALLED:
if PYENV_ROOT:
pyenv_paths = {}
for found in glob(
'{0}{1}versions{1}*{1}bin'.format(
'{0}{1}versions{1}*'.format(
PYENV_ROOT,
os.sep
)
):
add_to_path(found)
pyenv_paths[os.path.split(found)[1]] = '{0}{1}bin'.format(found, os.sep)

for version_str, pyenv_path in pyenv_paths.items():
version = pip._vendor.packaging.version.parse(version_str)
if version.is_prerelease and pyenv_paths.get(version.base_version):
continue
add_to_path(pyenv_path)
else:
click.echo(
'{0}: PYENV_ROOT is not set. New python paths will '
Expand Down

0 comments on commit 1bf6f51

Please sign in to comment.