Replace pythonz with pyenv

Depending on Python to manage Python is silly.
This commit is contained in:
Sorin Ionescu 2013-08-20 08:21:17 -04:00
parent 773ca7ee50
commit 459238b2bb
2 changed files with 24 additions and 39 deletions

View file

@ -6,15 +6,15 @@ Enables local Python and local Python package installation.
Local Python Installation Local Python Installation
------------------------- -------------------------
[pythonz][4] builds and installs multiple Python versions locally in the home [pyenv][4] builds and installs multiple Python versions locally in the home
directory. directory.
This module prepends the pythonz directory to the path variable to enable the This module prepends the pyenv directory to the path variable to enable the
execution of `pythonz`. execution of `pyenv`.
### Usage ### Usage
Install Python versions with `pythonz install` into *~/.pythonz/pythons*. Install Python versions with `pyenv install` into *~/.pyenv/versions*.
Local Package Installation Local Package Installation
-------------------------- --------------------------
@ -66,16 +66,6 @@ Aliases
- `py` is short for `python`. - `py` is short for `python`.
### Pythonz
- `pyz` is short for `pythonz`.
- `pyzc` removes stale source folders and archives.
- `pyzi` installs Python versions.
- `pyzl` lists installed Python versions.
- `pyzL` lists available Python versions.
- `pyzu` updates itself to the latest version.
- `pyzx` uninstalls Python versions.
Functions Functions
--------- ---------
@ -105,6 +95,6 @@ Authors
[1]: http://www.python.org/dev/peps/pep-0370/ [1]: http://www.python.org/dev/peps/pep-0370/
[2]: http://www.doughellmann.com/projects/virtualenvwrapper/ [2]: http://www.doughellmann.com/projects/virtualenvwrapper/
[3]: http://pypi.python.org/pypi/virtualenv [3]: http://pypi.python.org/pypi/virtualenv
[4]: http://saghul.github.com/pythonz/ [4]: https://github.com/yyuu/pyenv
[5]: https://github.com/sorin-ionescu/prezto/issues [5]: https://github.com/sorin-ionescu/prezto/issues

View file

@ -6,29 +6,35 @@
# Sebastian Wiesner <lunaryorn@googlemail.com> # Sebastian Wiesner <lunaryorn@googlemail.com>
# #
# Load pythonz into the shell session. # Load manually installed pyenv into the shell session.
if [[ -s $HOME/.pythonz/bin/pythonz ]]; then if [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then
path=($HOME/.pythonz/bin $path) path=("$HOME/.pyenv/bin" $path)
fi eval "$(pyenv init -)"
# Return if requirements are not found. # Load package manager installed pyenv into the shell session.
if (( ! $+commands[python] && ! $+commands[pythonz] )); then elif (( $+commands[pyenv] )); then
return 1 eval "$(pyenv init -)"
fi
# Prepend PEP 370 per user site packages directory, which defaults to # Prepend PEP 370 per user site packages directory, which defaults to
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. # ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH.
else
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
path=($HOME/Library/Python/*/bin(N) $path) path=($HOME/Library/Python/*/bin(N) $path)
else else
# This is subject to change. # This is subject to change.
path=($HOME/.local/bin $path) path=($HOME/.local/bin $path)
fi fi
fi
# Return if requirements are not found.
if (( ! $+commands[python] && ! $+commands[pyenv] )); then
return 1
fi
# Load virtualenvwrapper into the shell session. # Load virtualenvwrapper into the shell session.
if (( $+commands[virtualenvwrapper_lazy.sh] )); then if (( $+commands[virtualenvwrapper_lazy.sh] )); then
# Set the directory where virtual environments are stored. # Set the directory where virtual environments are stored.
export WORKON_HOME=$HOME/.virtualenvs export WORKON_HOME="$HOME/.virtualenvs"
# Disable the virtualenv prompt. # Disable the virtualenv prompt.
VIRTUAL_ENV_DISABLE_PROMPT=1 VIRTUAL_ENV_DISABLE_PROMPT=1
@ -42,14 +48,3 @@ fi
alias py='python' alias py='python'
# 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