mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99dae0f671 | |||
| f54dfff8a9 | |||
| c9760ae0ee | |||
| 98ff1670b3 | |||
| bdd466f838 | |||
| 324ebc9223 | |||
| 42ec6d8701 | |||
| 19513067bb | |||
| 753c912ecc | |||
| 4e8c469ec7 | |||
| 852723f867 | |||
| 94514a8179 | |||
| 7d57744c0a | |||
| a41ddf6bd1 | |||
| 197b7bae3f | |||
| f468739cfb | |||
| 555d5bd2be | |||
| 0a4d32c8a5 | |||
| 1a1cedfc21 | |||
| d35ee2c14c | |||
| 554a8bbae6 | |||
| 6572ad3d44 | |||
| 35cabaeebc | |||
| 300285a92d | |||
| 7a6f1eb010 | |||
| 66d754978e | |||
| 9c222a9350 | |||
| 7f4273f47f | |||
| dd707c21e3 | |||
| 7833743f96 | |||
| 5a9155e311 | |||
| 857c47ad66 | |||
| 87cf6073dc | |||
| 36dd089808 | |||
| c58f52e06e |
@@ -1,5 +1,21 @@
|
|||||||
# Python Buildpack Changelog
|
# Python Buildpack Changelog
|
||||||
|
|
||||||
|
## v92
|
||||||
|
|
||||||
|
Improved cache functionality and fix egg-links regression.
|
||||||
|
|
||||||
|
## v91
|
||||||
|
|
||||||
|
Bugfix, rolled back to v88.
|
||||||
|
|
||||||
|
## v90
|
||||||
|
|
||||||
|
Bugfix.
|
||||||
|
|
||||||
|
## v89
|
||||||
|
|
||||||
|
Improved cache functionality and fix egg-links regression.
|
||||||
|
|
||||||
## v88
|
## v88
|
||||||
|
|
||||||
Fixed bug with editable pip installations.
|
Fixed bug with editable pip installations.
|
||||||
|
|||||||
+11
-5
@@ -148,12 +148,13 @@ bpwatch start restore_cache
|
|||||||
cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true
|
cp -R $CACHE_DIR/.heroku/python-version .heroku/ &> /dev/null || true
|
||||||
cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true
|
cp -R $CACHE_DIR/.heroku/vendor .heroku/ &> /dev/null || true
|
||||||
cp -R $CACHE_DIR/.heroku/venv .heroku/ &> /dev/null || true
|
cp -R $CACHE_DIR/.heroku/venv .heroku/ &> /dev/null || true
|
||||||
|
if [[ -d $CACHE_DIR/.heroku/src ]]; then
|
||||||
|
cp -R $CACHE_DIR/.heroku/src .heroku/ &> /dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
bpwatch stop restore_cache
|
bpwatch stop restore_cache
|
||||||
|
|
||||||
mkdir -p $(dirname $PROFILE_PATH)
|
mkdir -p $(dirname $PROFILE_PATH)
|
||||||
|
|
||||||
# Make the directory for -e pip installations.
|
|
||||||
mkdir -p /app/.heroku/src
|
mkdir -p /app/.heroku/src
|
||||||
|
|
||||||
if [[ $BUILD_DIR != '/app' ]]; then
|
if [[ $BUILD_DIR != '/app' ]]; then
|
||||||
@@ -162,6 +163,7 @@ if [[ $BUILD_DIR != '/app' ]]; then
|
|||||||
ln -s $BUILD_DIR/.heroku/python /app/.heroku/python
|
ln -s $BUILD_DIR/.heroku/python /app/.heroku/python
|
||||||
ln -s $BUILD_DIR/.heroku/vendor /app/.heroku/vendor
|
ln -s $BUILD_DIR/.heroku/vendor /app/.heroku/vendor
|
||||||
ln -s $BUILD_DIR/.heroku/venv /app/.heroku/venv
|
ln -s $BUILD_DIR/.heroku/venv /app/.heroku/venv
|
||||||
|
# Note: .heroku/src is copied in later.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install Python.
|
# Install Python.
|
||||||
@@ -188,13 +190,12 @@ sub-env $BIN_DIR/steps/geo-libs
|
|||||||
# GDAL support.
|
# GDAL support.
|
||||||
source $BIN_DIR/steps/gdal
|
source $BIN_DIR/steps/gdal
|
||||||
|
|
||||||
# Install dependencies with Pip.
|
# Install dependencies with Pip (where the magic happens).
|
||||||
source $BIN_DIR/steps/pip-install
|
source $BIN_DIR/steps/pip-install
|
||||||
|
|
||||||
# Django collectstatic support.
|
# Django collectstatic support.
|
||||||
sub-env $BIN_DIR/steps/collectstatic
|
sub-env $BIN_DIR/steps/collectstatic
|
||||||
|
|
||||||
|
|
||||||
# Create .profile script for application runtime environment variables.
|
# Create .profile script for application runtime environment variables.
|
||||||
set-env PATH '$HOME/.heroku/python/bin:$PATH'
|
set-env PATH '$HOME/.heroku/python/bin:$PATH'
|
||||||
set-env PYTHONUNBUFFERED true
|
set-env PYTHONUNBUFFERED true
|
||||||
@@ -208,7 +209,8 @@ set-default-env PYTHONPATH /app/
|
|||||||
# Install sane-default script for $WEB_CONCURRENCY and $FORWARDED_ALLOW_IPS.
|
# Install sane-default script for $WEB_CONCURRENCY and $FORWARDED_ALLOW_IPS.
|
||||||
cp $ROOT_DIR/vendor/python.gunicorn.sh $GUNICORN_PROFILE_PATH
|
cp $ROOT_DIR/vendor/python.gunicorn.sh $GUNICORN_PROFILE_PATH
|
||||||
|
|
||||||
# Deep copy the directory for -e pip installations
|
# Support for pip install -e.
|
||||||
|
rm -fr $BUILD_DIR/.heroku/src
|
||||||
deep-cp /app/.heroku/src $BUILD_DIR/.heroku/src
|
deep-cp /app/.heroku/src $BUILD_DIR/.heroku/src
|
||||||
|
|
||||||
# Experimental post_compile hook.
|
# Experimental post_compile hook.
|
||||||
@@ -224,6 +226,7 @@ bpwatch start dump_cache
|
|||||||
rm -rf $CACHE_DIR/.heroku/python-stack
|
rm -rf $CACHE_DIR/.heroku/python-stack
|
||||||
rm -rf $CACHE_DIR/.heroku/vendor
|
rm -rf $CACHE_DIR/.heroku/vendor
|
||||||
rm -rf $CACHE_DIR/.heroku/venv
|
rm -rf $CACHE_DIR/.heroku/venv
|
||||||
|
rm -rf $CACHE_DIR/.heroku/src
|
||||||
|
|
||||||
mkdir -p $CACHE_DIR/.heroku
|
mkdir -p $CACHE_DIR/.heroku
|
||||||
cp -R .heroku/python $CACHE_DIR/.heroku/
|
cp -R .heroku/python $CACHE_DIR/.heroku/
|
||||||
@@ -231,6 +234,9 @@ bpwatch start dump_cache
|
|||||||
cp -R .heroku/python-stack $CACHE_DIR/.heroku/ &> /dev/null || true
|
cp -R .heroku/python-stack $CACHE_DIR/.heroku/ &> /dev/null || true
|
||||||
cp -R .heroku/vendor $CACHE_DIR/.heroku/ &> /dev/null || true
|
cp -R .heroku/vendor $CACHE_DIR/.heroku/ &> /dev/null || true
|
||||||
cp -R .heroku/venv $CACHE_DIR/.heroku/ &> /dev/null || true
|
cp -R .heroku/venv $CACHE_DIR/.heroku/ &> /dev/null || true
|
||||||
|
if [[ -d .heroku/src ]]; then
|
||||||
|
cp -R .heroku/src $CACHE_DIR/.heroku/ &> /dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
bpwatch stop dump_cache
|
bpwatch stop dump_cache
|
||||||
|
|
||||||
|
|||||||
+10
-3
@@ -1,13 +1,15 @@
|
|||||||
# Install dependencies with Pip.
|
# Install dependencies with Pip.
|
||||||
puts-cmd "pip install -r requirements.txt"
|
puts-cmd "pip install -r requirements.txt"
|
||||||
|
|
||||||
|
# rewrite any existing egg links to point to the build dir so pip does not fail with a mismatch error
|
||||||
|
find .heroku/python/lib/python*/site-packages/ -name "*.egg-link" -print0 | xargs -r -0 -n 1 sed -i -e "s#/app/#$(pwd)/#"
|
||||||
|
find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#"
|
||||||
|
|
||||||
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
|
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
|
||||||
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
|
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
/app/.heroku/python/bin/pip install -r requirements.txt --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee $WARNINGS_LOG | cleanup | indent
|
/app/.heroku/python/bin/pip install -r $BUILD_DIR/requirements.txt --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee $WARNINGS_LOG | cleanup | indent
|
||||||
PIP_STATUS="${PIPESTATUS[0]}"
|
PIP_STATUS="${PIPESTATUS[0]}"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -25,4 +27,9 @@ cp requirements.txt .heroku/python/requirements-declared.txt
|
|||||||
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
|
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
|
||||||
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
|
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
|
||||||
|
|
||||||
|
# rewrite build dir in egg links to /app so things are found at runtime
|
||||||
|
find .heroku/python/lib/python*/site-packages/ -name "*.egg-link" -print0 | xargs -r -0 -n 1 sed -i -e "s#$(pwd)/#/app/#"
|
||||||
|
find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 | xargs -r -0 -n 1 sed -i -e "s#$(pwd)/#/app/#"
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user