Skip to content

Commit

Permalink
Merge pull request mozilla#2527 from lissyx/pyenv-virtualenv-cache
Browse files Browse the repository at this point in the history
Don't fail on existing pyenv virtualenv symlink
  • Loading branch information
lissyx authored Nov 13, 2019
2 parents f18643b + 024f8e4 commit dab5183
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion taskcluster/tc-tests-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,18 @@ setup_pyenv_virtualenv()
mkdir ${PYENV_ROOT}/versions/${version}/envs
PATH=${PYENV_ROOT}/versions/${version}/tools:${PYENV_ROOT}/versions/${version}/tools/Scripts:$PATH virtualenv ${PYENV_ROOT}/versions/${version}/envs/${name}
else
pyenv virtualenv ${version} ${name}
ls -hal "${PYENV_ROOT}/versions/"

# There could be a symlink when re-using cacche on macOS
# We don't care, let's just remove it
if [ -L "${PYENV_ROOT}/versions/${name}" ]; then
rm "${PYENV_ROOT}/versions/${name}"
fi

# Don't force-reinstall existing version
if [ ! -f "${PYENV_ROOT}/versions/${version}/envs/${name}/bin/activate" ]; then
pyenv virtualenv ${version} ${name}
fi
fi
}

Expand Down

0 comments on commit dab5183

Please sign in to comment.