update prezto
This commit is contained in:
@@ -6,7 +6,9 @@ Enables local Python and local Python package installation.
|
||||
Settings
|
||||
--------
|
||||
|
||||
This module supports virtual environments from conda and virtualenvwrapper. By default, only virtualenvwrapper is enabled. To disable virtualenvwrapper, add the following to *zpreztorc*.
|
||||
This module supports virtual environments from conda and virtualenvwrapper. By
|
||||
default, only virtualenvwrapper is enabled. To disable virtualenvwrapper, add
|
||||
the following to *zpreztorc*.
|
||||
|
||||
```sh
|
||||
zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on'
|
||||
@@ -52,8 +54,8 @@ virtualenvwrapper
|
||||
|
||||
[`virtualenvwrapper`][2] is a frontend to the popular [`virtualenv`][3] utility.
|
||||
|
||||
`virtualenv` creates isolated Python environments and `virtualenvwrapper` provides
|
||||
convenient shell functions to create, switch, and manage them.
|
||||
`virtualenv` creates isolated Python environments and `virtualenvwrapper`
|
||||
provides convenient shell functions to create, switch, and manage them.
|
||||
|
||||
### Usage
|
||||
|
||||
|
@@ -7,15 +7,18 @@
|
||||
# Patrick Bos <egpbos@gmail.com>
|
||||
#
|
||||
|
||||
# Load manually installed pyenv into the shell session.
|
||||
if [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then
|
||||
# Load manually installed pyenv into the path
|
||||
if [[ -n "$PYENV_ROOT" && -s "$PYENV_ROOT/bin/pyenv" ]]; then
|
||||
path=("$PYENV_ROOT/bin" $path)
|
||||
elif [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then
|
||||
path=("$HOME/.pyenv/bin" $path)
|
||||
export PYENV_ROOT=$(pyenv root)
|
||||
eval "$(pyenv init - --no-rehash zsh)"
|
||||
fi
|
||||
|
||||
# Load package manager installed pyenv into the shell session.
|
||||
elif (( $+commands[pyenv] )); then
|
||||
export PYENV_ROOT=$(pyenv root)
|
||||
# Load pyenv into the current python session
|
||||
if (( $+commands[pyenv] )); then
|
||||
if [[ -z "$PYENV_ROOT" ]]; then
|
||||
export PYENV_ROOT=$(pyenv root)
|
||||
fi
|
||||
eval "$(pyenv init - --no-rehash zsh)"
|
||||
|
||||
# Prepend PEP 370 per user site packages directory, which defaults to
|
||||
@@ -57,7 +60,7 @@ function _python-workon-cwd {
|
||||
local ENV_NAME=""
|
||||
if [[ -f "$PROJECT_ROOT/.venv" ]]; then
|
||||
ENV_NAME="$(cat "$PROJECT_ROOT/.venv")"
|
||||
elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then
|
||||
elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]]; then
|
||||
ENV_NAME="$PROJECT_ROOT/.venv"
|
||||
elif [[ "$PROJECT_ROOT" != "." ]]; then
|
||||
ENV_NAME="${PROJECT_ROOT:t}"
|
||||
@@ -93,8 +96,11 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \
|
||||
# Set the directory where virtual environments are stored.
|
||||
export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}"
|
||||
|
||||
# Disable the virtualenv prompt.
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
# Disable the virtualenv prompt. Note that we use the magic value used by the
|
||||
# pure prompt because there's some additional logic in that prompt which tries
|
||||
# to figure out if a user set this variable and disable the python portion of
|
||||
# that prompt based on it which is the exact opposite of what we want to do.
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=12
|
||||
|
||||
# Create a sorted array of available virtualenv related 'pyenv' commands to
|
||||
# look for plugins of interest. Scanning shell '$path' isn't enough as they
|
||||
|
Reference in New Issue
Block a user