2012-02-01 04:37:51 +00:00
|
|
|
#
|
|
|
|
# Enables local Python package installation.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
2012-04-12 11:06:37 +00:00
|
|
|
# Sebastian Wiesner <lunaryorn@googlemail.com>
|
2012-02-01 04:37:51 +00:00
|
|
|
#
|
|
|
|
|
2012-09-25 16:57:57 +00:00
|
|
|
# Load pythonz into the shell session.
|
|
|
|
if [[ -s $HOME/.pythonz/bin/pythonz ]]; then
|
|
|
|
path=($HOME/.pythonz/bin $path)
|
|
|
|
fi
|
|
|
|
|
2012-07-23 19:00:44 +00:00
|
|
|
# Return if requirements are not found.
|
2012-09-25 16:57:57 +00:00
|
|
|
if (( ! $+commands[python] && ! $+commands[pythonz] )); then
|
2012-07-23 19:00:44 +00:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2011-08-27 23:09:06 +00:00
|
|
|
# Prepend PEP 370 per user site packages directory, which defaults to
|
2013-01-28 22:08:56 +00:00
|
|
|
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH.
|
2011-08-27 23:09:06 +00:00
|
|
|
if [[ "$OSTYPE" == darwin* ]]; then
|
|
|
|
path=($HOME/Library/Python/*/bin(N) $path)
|
|
|
|
else
|
|
|
|
# This is subject to change.
|
|
|
|
path=($HOME/.local/bin $path)
|
|
|
|
fi
|
|
|
|
|
2012-04-12 11:06:37 +00:00
|
|
|
# Load virtualenvwrapper into the shell session.
|
2012-09-03 14:53:19 +00:00
|
|
|
if (( $+commands[virtualenvwrapper_lazy.sh] )); then
|
|
|
|
# Set the directory where virtual environments are stored.
|
|
|
|
export WORKON_HOME=$HOME/.virtualenvs
|
|
|
|
|
2012-09-03 14:34:41 +00:00
|
|
|
# Disable the virtualenv prompt.
|
|
|
|
VIRTUAL_ENV_DISABLE_PROMPT=1
|
2012-09-03 14:53:19 +00:00
|
|
|
|
2012-09-03 14:37:56 +00:00
|
|
|
source "$commands[virtualenvwrapper_lazy.sh]"
|
2012-04-12 11:06:37 +00:00
|
|
|
fi
|
|
|
|
|
2012-08-15 12:00:08 +00:00
|
|
|
#
|
|
|
|
# Aliases
|
|
|
|
#
|
|
|
|
|
|
|
|
alias py='python'
|
2012-09-03 01:14:32 +00:00
|
|
|
|
|
|
|
# pythonz
|
|
|
|
if (( $+commands[pythonz] )); then
|
|
|
|
alias pyz='pythonz'
|
|
|
|
alias pyzc='pythonz cleanup'
|
|
|
|
alias pyzi='pythonz install'
|
|
|
|
alias pyzl='pythonz list'
|
|
|
|
alias pyzL='pythonz list -a'
|
|
|
|
alias pyzu='pythonz update'
|
|
|
|
alias pyzx='pythonz uninstall'
|
|
|
|
fi
|
|
|
|
|