mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69bdca063f | |||
| 63cea99415 | |||
| 5ecd27e3b8 | |||
| 206a2dbc04 | |||
| 2a083791b6 | |||
| d5b2b0b464 | |||
| 2eab1ad845 | |||
| 2b16420d41 | |||
| 9fa0889499 | |||
| 99b17fabeb | |||
| 933d3014d7 | |||
| 018e0f31de | |||
| cf1647e937 | |||
| b9f154bf38 | |||
| 4cc18ce0af | |||
| f5ea1c24a3 | |||
| 952b0bb735 | |||
| 8b7edad8a2 | |||
| 02787ac910 | |||
| bcc3ba09ca |
@@ -45,10 +45,10 @@ Specify a Runtime
|
||||
You can also provide arbitrary releases Python with a `runtime.txt` file.
|
||||
|
||||
$ cat runtime.txt
|
||||
python-3.3.0
|
||||
python-3.3.2
|
||||
|
||||
Runtime options include:
|
||||
|
||||
- python-2.7.4
|
||||
- python-3.3.1
|
||||
- python-3.3.2
|
||||
- pypy-1.9 (experimental)
|
||||
|
||||
+14
-10
@@ -2,8 +2,7 @@
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# $ bin/compile <build-dir> <cache-dir>
|
||||
|
||||
# $ bin/compile <build-dir> <cache-dir> <env-path>
|
||||
|
||||
# Fail fast and fail hard.
|
||||
set -eo pipefail
|
||||
@@ -16,6 +15,8 @@ BIN_DIR=$(cd $(dirname $0); pwd) # absolute path
|
||||
ROOT_DIR=$(dirname $BIN_DIR)
|
||||
BUILD_DIR=$1
|
||||
CACHE_DIR=$2
|
||||
ENV_FILE=$3
|
||||
|
||||
|
||||
CACHED_DIRS=".heroku"
|
||||
|
||||
@@ -34,7 +35,7 @@ DISTRIBUTE_VERSION="0.6.36"
|
||||
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
||||
LOGPLEX_KEY="t.b396af7f-ad75-4643-8b9e-ebb288acc624"
|
||||
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
|
||||
BUILDPACK_VERSION=v25
|
||||
BUILDPACK_VERSION=v28
|
||||
|
||||
# Support Anvil Build_IDs
|
||||
[ ! "$REQUEST_ID" ] && REQUEST_ID=$SLUG_ID
|
||||
@@ -79,11 +80,14 @@ ORIG_BUILD_DIR=$BUILD_DIR
|
||||
BUILD_DIR=$APP_DIR
|
||||
|
||||
# Prepend proper path buildpack use.
|
||||
export PATH=$BUILD_DIR/.heroku/python/bin:$PATH
|
||||
export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH
|
||||
export PYTHONUNBUFFERED=1
|
||||
export LANG=en_US.UTF-8
|
||||
export LIBRARY_PATH=/app/.heroku/vendor/lib
|
||||
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib
|
||||
export C_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include
|
||||
export CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include
|
||||
export LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib
|
||||
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib
|
||||
export PKG_CONFIG_PATH=/app/.heroku/vendor/lib/pkg-config:$BUILD_DIR/.heroku/vendor/lib/pkg-config
|
||||
|
||||
# Switch to the repo's context.
|
||||
cd $BUILD_DIR
|
||||
@@ -201,7 +205,7 @@ bpwatch stop pylibmc_install
|
||||
# Install Mercurial if it appears to be required.
|
||||
if (grep -Fiq "hg+" requirements.txt) then
|
||||
bpwatch start mercurial_install
|
||||
/app/.heroku/python/bin/pip install --use-mirrors mercurial | cleanup | indent
|
||||
/app/.heroku/python/bin/pip install mercurial | cleanup | indent
|
||||
bpwatch stop mercurial_install
|
||||
fi
|
||||
|
||||
@@ -212,14 +216,14 @@ puts-step "Installing dependencies using Pip ($PIP_VERSION)"
|
||||
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
|
||||
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
|
||||
|
||||
/app/.heroku/python/bin/pip install --use-mirrors -r requirements.txt --exists-action=w --src=./.heroku/src | cleanup | indent
|
||||
/app/.heroku/python/bin/pip install -r requirements.txt --exists-action=w --src=./.heroku/src | cleanup | indent
|
||||
|
||||
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
|
||||
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
|
||||
|
||||
# Django collectstatic support.
|
||||
bpwatch start collectstatic
|
||||
source $BIN_DIR/steps/collectstatic
|
||||
sub-env $BIN_DIR/steps/collectstatic
|
||||
bpwatch stop collectstatic
|
||||
|
||||
# ### Finalize
|
||||
@@ -258,6 +262,6 @@ bpwatch start anvil_appdir_commit
|
||||
if [ "$SLUG_ID" ]; then
|
||||
deep-mv $TMP_APP_DIR $APP_DIR
|
||||
fi
|
||||
bpwatch stop anvil_appdir_commit
|
||||
|
||||
bpwatch stop anvil_appdir_commit
|
||||
bpwatch stop compile
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@ if [[ $MANAGE_FILE ]]; then
|
||||
cat <<EOF
|
||||
|
||||
addons:
|
||||
heroku-postgresql:dev
|
||||
heroku-postgresql:hobby-dev
|
||||
EOF
|
||||
fi
|
||||
|
||||
Regular → Executable
Regular → Executable
+1
-1
@@ -3,5 +3,5 @@
|
||||
if [ -f bin/post_compile ]; then
|
||||
echo "-----> Running post-compile hook"
|
||||
chmod +x bin/post_compile
|
||||
bin/post_compile
|
||||
sub-env bin/post_compile
|
||||
fi
|
||||
Regular → Executable
+1
-1
@@ -3,5 +3,5 @@
|
||||
if [ -f bin/pre_compile ]; then
|
||||
echo "-----> Running pre-compile hook"
|
||||
chmod +x bin/pre_compile
|
||||
bin/pre_compile
|
||||
sub-env bin/pre_compile
|
||||
fi
|
||||
@@ -59,4 +59,10 @@ function deep-rm (){
|
||||
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
|
||||
}
|
||||
|
||||
|
||||
function sub-env (){
|
||||
if [[ -f $ENV_FILE ]]; then
|
||||
(export $(egrep -v '^(GIT_DIR|PYTHONHOME|PYTHONPATH|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)' -f $ENV_FILE); $1)
|
||||
else
|
||||
$1
|
||||
fi
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -1,14 +1,14 @@
|
||||
#!/usr/local/bin/python
|
||||
#!/usr/bin/env python2
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
DEFUALT_PATH = '{}.zip'.format(os.path.abspath(__file__))
|
||||
BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFUALT_PATH)
|
||||
DEFAULT_PATH = '{0}.zip'.format(os.path.abspath(__file__))
|
||||
BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFAULT_PATH)
|
||||
|
||||
sys.path.insert(0, BPWATCH_DISTRO_PATH)
|
||||
|
||||
import bp_cli
|
||||
bp_cli.main()
|
||||
bp_cli.main()
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user