Commit 86e0e29a authored by cclauss's avatar cclauss

Merge remote-tracking branch 'heroku/master' into pypy-4.0.1

parents ce3bdb37 bc754f40
# Python Buildpack Changelog
## v70 (2015-10-29)
Improved compatibility with multi and node.js buildpacks.
## v69 (2015-10-12)
Revert to v66.
## v68 (2015-10-12)
Fixed .heroku/venv error with modern apps.
## v67 (2015-10-12)
Further improved cache compatibility with multi and node.js buildpacks.
## v66 (2015-10-09)
Improved compatibility with multi and node.js buildpacks.
## v65 (2015-10-08)
Reverted v64.
## v64 (2015-10-08)
Improved compatibility with multi and node.js buildpacks.
## v63 (2015-10-08)
Updated Pip and Setuptools.
- Setuptools updated to v18.3.2
- Pip updated to v7.1.2
## v62 (2015-08-07)
Updated Pip and Setuptools.
......@@ -21,4 +57,3 @@ Default Python is now latest 2.7.10. Updated Pip and Distribute.
- Default Python version is v2.7.10
- Setuptools updated to v16.0
- Pip updated to v7.0.1
......@@ -3,6 +3,8 @@
This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for Python apps, powered by [pip](http://www.pip-installer.org/).
This buildpack supports running Django and Flask apps.
Usage
-----
......@@ -17,7 +19,7 @@ Example usage:
$ git push heroku master
...
-----> Python app detected
-----> Installing runtime (python-2.7.9)
-----> Installing runtime (python-2.7.10)
-----> Installing dependencies using pip
Downloading/unpacking requests (from -r requirements.txt (line 1))
Installing collected packages: requests
......@@ -40,13 +42,13 @@ Specify a Runtime
You can also provide arbitrary releases Python with a `runtime.txt` file.
$ cat runtime.txt
python-3.4.3
python-3.5.0
Runtime options include:
- python-2.7.9
- python-3.4.3
- pypy-2.4.0 (unsupported, experimental)
- python-2.7.10
- python-3.5.0
- pypy-2.6.1 (unsupported, experimental)
- pypy3-2.4.0 (unsupported, experimental)
Other [unsupported runtimes](https://github.com/heroku/heroku-buildpack-python/tree/master/builds/runtimes) are available as well.
......@@ -19,20 +19,15 @@ BUILD_DIR=$1
CACHE_DIR=$2
ENV_DIR=$3
CACHED_DIRS=".heroku"
# Static configurations for virtualenv caches.
VIRTUALENV_LOC=".heroku/venv"
LEGACY_TRIGGER="lib/python2.7"
PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh"
WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
DEFAULT_PYTHON_VERSION="python-2.7.10"
DEFAULT_PYTHON_STACK="cedar"
PYTHON_EXE="/app/.heroku/python/bin/python"
PIP_VERSION="7.1.0"
SETUPTOOLS_VERSION="18.1"
PIP_VERSION="7.1.2"
SETUPTOOLS_VERSION="18.3.2"
# Setup bpwatch
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
......@@ -57,10 +52,6 @@ TMP_APP_DIR=$CACHE_DIR/tmp_app_dir
bpwatch start compile
# We'll need to send these statics to other scripts we `source`.
export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
# Syntax sugar.
source $BIN_DIR/utils
......@@ -83,7 +74,7 @@ if [[ ! "$DOCKER_BUILD" ]]; then
# Copy Application code in.
bpwatch start appdir_stage
deep-mv $BUILD_DIR $APP_DIR
deep-cp $BUILD_DIR $APP_DIR
bpwatch stop appdir_stage
fi
......@@ -92,6 +83,13 @@ fi
ORIG_BUILD_DIR=$BUILD_DIR
BUILD_DIR=$APP_DIR
# Set up outputs under new context
PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh"
WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
# We'll need to send these statics to other scripts we `source`.
export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
# Prepend proper path buildpack use.
export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH
export PYTHONUNBUFFERED=1
......@@ -144,9 +142,14 @@ bpwatch stop clear_old_venvs
# Restore old artifacts from the cache.
bpwatch start restore_cache
for dir in $CACHED_DIRS; do
cp -R $CACHE_DIR/$dir . &> /dev/null || true
done
mkdir -p .heroku
cp -R $CACHE_DIR/.heroku/python .heroku/ &> /dev/null || true
cp -R $CACHE_DIR/.heroku/python-stack .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/venv .heroku/ &> /dev/null || true
bpwatch stop restore_cache
set +e
......@@ -208,16 +211,27 @@ bpwatch stop post_compile
# Store new artifacts in cache.
bpwatch start dump_cache
for dir in $CACHED_DIRS; do
rm -rf $CACHE_DIR/$dir
cp -R $dir $CACHE_DIR/
done
rm -rf $CACHE_DIR/.heroku/python
rm -rf $CACHE_DIR/.heroku/python-version
rm -rf $CACHE_DIR/.heroku/python-stack
rm -rf $CACHE_DIR/.heroku/vendor
rm -rf $CACHE_DIR/.heroku/venv
mkdir -p $CACHE_DIR/.heroku
cp -R .heroku/python $CACHE_DIR/.heroku/
cp -R .heroku/python-version $CACHE_DIR/.heroku/
cp -R .heroku/python-stack $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
bpwatch stop dump_cache
# ### Fin.
if [[ ! "$DOCKER_BUILD" ]]; then
bpwatch start appdir_commit
deep-rm $ORIG_BUILD_DIR
deep-mv $BUILD_DIR $ORIG_BUILD_DIR
bpwatch stop appdir_commit
......
......@@ -18,6 +18,6 @@ if [[ $MANAGE_FILE ]]; then
cat <<EOF
addons:
heroku-postgresql:hobby-dev
heroku-postgresql
EOF
fi
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/sqlite
# NOTICE: This formula only works for the cedar-14 stack, not cedar.
OUT_PREFIX=$1
echo "Building PyPy..."
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.6.1-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy-2.6.1-linux64/* $OUT_PREFIX
ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/sqlite
# NOTICE: This formula only works for the cedar-14 stack, not cedar.
OUT_PREFIX=$1
echo "Building PyPy..."
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.0-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy-4.0.0-linux64/* $OUT_PREFIX
ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/sqlite
OUT_PREFIX=$1
echo "Building Python..."
SOURCE_TARBALL='https://python.org/ftp/python/3.5.0/Python-3.5.0.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-3.5.0 src
cd src
./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared
make
make install
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
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