Commit 27a22e8c authored by Kenneth Reitz's avatar Kenneth Reitz

.profile.d/python

parent 0378bbb4
...@@ -53,6 +53,7 @@ LEGACY_VIRTUALENV_LOC="." ...@@ -53,6 +53,7 @@ LEGACY_VIRTUALENV_LOC="."
MODERN_VIRTUALENV_LOC=".heroku/venv" MODERN_VIRTUALENV_LOC=".heroku/venv"
LEGACY_VIRTUALENV_DIRS="bin include lib" LEGACY_VIRTUALENV_DIRS="bin include lib"
LEGACY_VIRTUALENV_TRIGGER="lib/python2.7" LEGACY_VIRTUALENV_TRIGGER="lib/python2.7"
PROFILE_PATH=".profile.d/python"
# Python version. This will be used in the future to specify custom Pythons. # Python version. This will be used in the future to specify custom Pythons.
...@@ -60,12 +61,10 @@ PYTHON_VERSION="2.7.2" ...@@ -60,12 +61,10 @@ PYTHON_VERSION="2.7.2"
PYTHON_EXE="python2.7" PYTHON_EXE="python2.7"
# Sanitizing environment variables. # Sanitizing environment variables.
unset GIT_DIR unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
unset PYTHONHOME
unset PYTHONPATH
# We'll need to send these statics to other scripts we `source`. # We'll need to send these statics to other scripts we `source`.
export PIP_DOWNLOAD_CACHE BUILD_DIR CACHE_DIR BIN_DIR export PIP_DOWNLOAD_CACHE BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
# Syntax sugar. # Syntax sugar.
indent() { indent() {
...@@ -73,18 +72,26 @@ indent() { ...@@ -73,18 +72,26 @@ indent() {
[ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE" [ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE"
} }
# Virtualenv wrapper.
function virtualenv (){ function virtualenv (){
python "$ROOT_DIR/vendor/virtualenv-1.7/virtualenv.py" "$@" python "$ROOT_DIR/vendor/virtualenv-1.7/virtualenv.py" "$@"
} }
# Buildpack Steps.
function puts-step (){ function puts-step (){
echo "-----> $@" echo "-----> $@"
} }
# Buildpack Warnings.
function puts-warn (){ function puts-warn (){
echo " ! $@" echo " ! $@"
} }
# Usage: $ set-env key value
function set-env (){
echo "export $1=$2" >> $PROFILE_PATH
}
# ## Build Time # ## Build Time
# #
...@@ -146,8 +153,10 @@ HEROKU_DIR_STATUS=$? ...@@ -146,8 +153,10 @@ HEROKU_DIR_STATUS=$?
# } # }
set -e set -e
# Buildpack profile init script
mkdir -p .profile.d mkdir -p .profile.d
# echo "export $2=$3" >> $PROFILE_PATH
# ### Virtualenv Setup # ### Virtualenv Setup
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment