From 83085e523142357167b854eb6b0c8c6acdbe506e Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Thu, 14 Dec 2017 17:23:40 -0800 Subject: [PATCH] python: remove zstyle setting in favor of third party environment variable Refs #1519, #1520 --- modules/python/README.md | 8 -------- modules/python/init.zsh | 14 +++++--------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/modules/python/README.md b/modules/python/README.md index 0cd676bd..e7b72c48 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -114,14 +114,6 @@ zstyle ':prezto:module:python:virtualenv' auto-switch 'yes' zstyle ':prezto:module:python:virtualenv' initialize 'no' ``` -On some systems, the `python` binary doesn't exist so in order to get -virtualenvwrapper to work, the path needs to specified. We do our best to detect -this, but sometimes it needs manual intervention. - -```sh -zstyle ':prezto:module:python:virtualenvwrapper' python-path /opt/python3/bin/python3 -``` - Aliases ------- diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 5e4b79b0..94eeab79 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -115,15 +115,11 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \ # 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, if - # homebrew is installed and it wasn't overridden via environment variable - # we fall back to python3 then python2 in that order. This is needed to - # fix an issue with virtualenvwrapper as homebrew 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 [[ -z "$VIRTUALENVWRAPPER_PYTHON" ]] && (( $+commands[brew] )); then + # If homebrew is installed and the python location wasn't overridden via + # environment variable we fall back to python3 then python2 in that order. + # This is needed to fix an issue with virtualenvwrapper as homebrew no + # longer shadows the system python. + if [[ -z "$VIRTUALENVWRAPPER_PYTHON" ]] && (( $+commands[brew] )); then if (( $+commands[python3] )); then export VIRTUALENVWRAPPER_PYTHON=$commands[python3] elif (( $+commands[python2] )); then