From 20104d99a9c2b04618bff1055708a1fce0f535c4 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Tue, 10 Jul 2012 11:16:28 +0200 Subject: [PATCH] Add support for pythonz pythonz is a tool to build Python locally in $HOME, forked from pythonbrew. Unlike pythonbrew it only builds and installs, but doesn't try to manage the default Python version, nor wrap virtualenv and buildout. http://saghul.github.com/pythonz/ --- modules/python/README.md | 20 ++++++++++++++++++-- modules/python/init.zsh | 8 ++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/modules/python/README.md b/modules/python/README.md index 6a6bd0e3..2736f981 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -1,7 +1,23 @@ Python ====== -Enables local Python package installation. +Enables local Python builds and package installation. + +Local Python builds +------------------- + +[pythonz][6] builds and installs multiple Python versions locally in the home +directory. It supports CPython, Stackless Python, Jython and PyPy. + +This module prepends the pythonz directory to the path variable to make +`pythonz` available. + +### Usage + +Install Python versions with `pythonz install` into into `~/.pythonz/pythons`. +To make these Python versions generally available, add symbolic links to +`~/.pythonz/bin`. + Local Package Installation -------------------------- @@ -44,4 +60,4 @@ Authors [3]: http://pypi.python.org/pypi/virtualenv [4]: http://www.doughellmann.com/docs/virtualenvwrapper/#introduction [5]: https://github.com/sorin-ionescu/oh-my-zsh/issues - +[6]: http://saghul.github.com/pythonz/ diff --git a/modules/python/init.zsh b/modules/python/init.zsh index e9a74d47..a1fa5e1f 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -22,3 +22,11 @@ if [[ -n "$WORKON_HOME" ]] && (( $+commands[virtualenvwrapper.sh] )); then source "$commands[virtualenvwrapper.sh]" fi +# Load pythonz into the shell session, if available +if [[ -s $HOME/.pythonz/bin/pythonz ]]; then + path=($HOME/.pythonz/bin $path) + + function pythonz { + command pythonz "$@" && builtin hash -r + } +fi