1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-01 02:19:25 +00:00

python: make a reasonable guess about virtualenvwrapper python location

Fixes #1416
This commit is contained in:
Kaleb Elwert
2017-12-11 11:01:40 -08:00
parent aa0395244d
commit e021adeb4a
3 changed files with 30 additions and 4 deletions

View File

@ -114,6 +114,20 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \
else
# Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if available
# in '$path' or in an alternative location on a Debian based system.
#
# If the python-path was manually specified, use that. Otherwise, fall back
# to python3 then python2 in that order. This is needed to fix an issue with
# virtualenvwrapper when used with homebrew, as it no longer shadows the
# system python.
zstyle -s ':prezto:module:python:virtualenvwrapper' python-path '_venv_python'
if [[ -n "$_venv_python" ]]; then
export VIRTUALENVWRAPPER_PYTHON=$_venv_python
elif (( $+commands[python3] )); then
export VIRTUALENVWRAPPER_PYTHON=$commands[python3]
elif (( $+commands[python2] )); then
export VIRTUALENVWRAPPER_PYTHON=$commands[python2]
fi
virtenv_sources=(
${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]}
/usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN)