mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23ee27792a | |||
| de680016c9 | |||
| 646466c4dd | |||
| a2c3aaf817 | |||
| 88d6c93955 | |||
| b261158bf2 | |||
| 009d0ddbae | |||
| 17dd42113f | |||
| f767a73515 | |||
| 2608bf43dd |
@@ -1,5 +1,13 @@
|
|||||||
# Python Buildpack Changelog
|
# Python Buildpack Changelog
|
||||||
|
|
||||||
|
# 121
|
||||||
|
|
||||||
|
Update default Python to v3.6.3.
|
||||||
|
|
||||||
|
# 120
|
||||||
|
|
||||||
|
Use Pipenv --deploy.
|
||||||
|
|
||||||
# 119
|
# 119
|
||||||
|
|
||||||
Improvements to Pipenv support, warning on unsupported Python versions.
|
Improvements to Pipenv support, warning on unsupported Python versions.
|
||||||
|
|||||||
Generated
+2
-2
@@ -5,14 +5,14 @@
|
|||||||
},
|
},
|
||||||
"host-environment-markers": {
|
"host-environment-markers": {
|
||||||
"implementation_name": "cpython",
|
"implementation_name": "cpython",
|
||||||
"implementation_version": "3.6.2",
|
"implementation_version": "3.6.3",
|
||||||
"os_name": "posix",
|
"os_name": "posix",
|
||||||
"platform_machine": "x86_64",
|
"platform_machine": "x86_64",
|
||||||
"platform_python_implementation": "CPython",
|
"platform_python_implementation": "CPython",
|
||||||
"platform_release": "16.7.0",
|
"platform_release": "16.7.0",
|
||||||
"platform_system": "Darwin",
|
"platform_system": "Darwin",
|
||||||
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
|
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
|
||||||
"python_full_version": "3.6.2",
|
"python_full_version": "3.6.3",
|
||||||
"python_version": "3.6",
|
"python_version": "3.6",
|
||||||
"sys_platform": "darwin"
|
"sys_platform": "darwin"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Deploying a Python application couldn't be easier:
|
|||||||
$ git push heroku master
|
$ git push heroku master
|
||||||
…
|
…
|
||||||
-----> Python app detected
|
-----> Python app detected
|
||||||
-----> Installing python-3.6.2
|
-----> Installing python-3.6.3
|
||||||
-----> Installing pip
|
-----> Installing pip
|
||||||
-----> Installing requirements with latest pipenv…
|
-----> Installing requirements with latest pipenv…
|
||||||
...
|
...
|
||||||
@@ -58,7 +58,7 @@ Or, more specifically:
|
|||||||
|
|
||||||
Runtime options include:
|
Runtime options include:
|
||||||
|
|
||||||
- `python-3.6.2`
|
- `python-3.6.3`
|
||||||
- `python-2.7.14`
|
- `python-2.7.14`
|
||||||
- `pypy-5.7.1` (unsupported, experimental)
|
- `pypy-5.7.1` (unsupported, experimental)
|
||||||
- `pypy3-5.5.1` (unsupported, experimental)
|
- `pypy3-5.5.1` (unsupported, experimental)
|
||||||
|
|||||||
+2
-2
@@ -34,8 +34,8 @@ ENV_DIR=$3
|
|||||||
export BUILD_DIR CACHE_DIR ENV_DIR
|
export BUILD_DIR CACHE_DIR ENV_DIR
|
||||||
|
|
||||||
# Python defaults
|
# Python defaults
|
||||||
DEFAULT_PYTHON_VERSION="python-3.6.2"
|
DEFAULT_PYTHON_VERSION="python-3.6.4"
|
||||||
LATEST_3="python-3.6.2"
|
LATEST_3="python-3.6.4"
|
||||||
LATEST_2="python-2.7.14"
|
LATEST_2="python-2.7.14"
|
||||||
|
|
||||||
DEFAULT_PYTHON_STACK="cedar-14"
|
DEFAULT_PYTHON_STACK="cedar-14"
|
||||||
|
|||||||
+6
-1
@@ -40,5 +40,10 @@ if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
|
|||||||
|
|
||||||
GDAL=$(pwd)/vendor
|
GDAL=$(pwd)/vendor
|
||||||
export GDAL
|
export GDAL
|
||||||
|
# set path for post_compile hooks
|
||||||
|
export GDAL_LIBRARY_PATH="$BUILD_DIR/.heroku/vendor/lib/libgdal.so"
|
||||||
|
export GEOS_LIBRARY_PATH="$BUILD_DIR/.heroku/vendor/lib/libgeos_c.so"
|
||||||
|
# set path for runtime environmeht
|
||||||
|
set_env GDAL_LIBRARY_PATH "/app/.heroku/vendor/lib/libgdal.so"
|
||||||
|
set_env GEOS_LIBRARY_PATH "/app/.heroku/vendor/lib/libgeos_c.so"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# shellcheck source=bin/utils
|
||||||
|
source $BIN_DIR/utils
|
||||||
|
|
||||||
if [ ! "$SKIP_PIP_INSTALL" ]; then
|
if [ ! "$SKIP_PIP_INSTALL" ]; then
|
||||||
|
|
||||||
# Install dependencies with Pip.
|
# Install dependencies with Pip.
|
||||||
puts-step "Installing requirements with pip"
|
puts-step "Installing requirements with pip"
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
|
# Measure that we're using pip.
|
||||||
|
mcount "tool.pip"
|
||||||
|
|
||||||
/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
|
/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]}"
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
# export CLINT_FORCE_COLOR=1
|
# export CLINT_FORCE_COLOR=1
|
||||||
# export PIPENV_FORCE_COLOR=1
|
# export PIPENV_FORCE_COLOR=1
|
||||||
|
# shellcheck source=bin/utils
|
||||||
|
source $BIN_DIR/utils
|
||||||
|
|
||||||
# Pipenv support (Generate requriements.txt with pipenv).
|
# Pipenv support (Generate requriements.txt with pipenv).
|
||||||
if [[ -f Pipfile ]]; then
|
if [[ -f Pipfile ]]; then
|
||||||
if [[ ! -f requirements.txt ]]; then
|
if [[ ! -f requirements.txt ]]; then
|
||||||
puts-step "Installing requirements with latest Pipenv…"
|
puts-step "Installing requirements with latest Pipenv…"
|
||||||
|
|
||||||
|
# Measure that we're using Pipenv.
|
||||||
|
mcount "tool.pipenv"
|
||||||
|
|
||||||
# Install pipenv.
|
# Install pipenv.
|
||||||
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
|
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
|
|||||||
echo "python-2.7.14" > "$BUILD_DIR/runtime.txt"
|
echo "python-2.7.14" > "$BUILD_DIR/runtime.txt"
|
||||||
fi
|
fi
|
||||||
if [ "$PYTHON" = 3.6 ]; then
|
if [ "$PYTHON" = 3.6 ]; then
|
||||||
echo "python-3.6.2" > "$BUILD_DIR/runtime.txt"
|
echo "python-3.6.3" > "$BUILD_DIR/runtime.txt"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/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.6.3/Python-3.6.3.tgz'
|
||||||
|
curl -L $SOURCE_TARBALL | tar xz
|
||||||
|
mv Python-3.6.3 src
|
||||||
|
cd src
|
||||||
|
|
||||||
|
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
# Remove unneeded test directories, similar to the official Docker Python images:
|
||||||
|
# https://github.com/docker-library/python
|
||||||
|
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' +
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
|
||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/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.6.4/Python-3.6.4.tgz'
|
||||||
|
curl -L $SOURCE_TARBALL | tar xz
|
||||||
|
mv Python-3.6.4 src
|
||||||
|
cd src
|
||||||
|
|
||||||
|
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
# Remove unneeded test directories, similar to the official Docker Python images:
|
||||||
|
# https://github.com/docker-library/python
|
||||||
|
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' +
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
|
||||||
+1
-1
@@ -6,4 +6,4 @@ verify_ssl = true
|
|||||||
requests = "*"
|
requests = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_full_version = "3.6.2"
|
python_full_version = "3.6.3"
|
||||||
+9
-9
@@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "8f9e3d5a2863652d7495f17427a33383b3bd9ebd55d331be41fee3cf8631bcd3"
|
"sha256": "22a052f4d1cfe6518b2f236fe45c3208c587a9ab1323bdd390632e27278b541e"
|
||||||
},
|
},
|
||||||
"host-environment-markers": {
|
"host-environment-markers": {
|
||||||
"implementation_name": "cpython",
|
"implementation_name": "cpython",
|
||||||
"implementation_version": "3.6.2",
|
"implementation_version": "3.6.3",
|
||||||
"os_name": "posix",
|
"os_name": "posix",
|
||||||
"platform_machine": "x86_64",
|
"platform_machine": "x86_64",
|
||||||
"platform_python_implementation": "CPython",
|
"platform_python_implementation": "CPython",
|
||||||
"platform_release": "17.0.0",
|
"platform_release": "16.7.0",
|
||||||
"platform_system": "Darwin",
|
"platform_system": "Darwin",
|
||||||
"platform_version": "Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64",
|
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
|
||||||
"python_full_version": "3.6.2",
|
"python_full_version": "3.6.3",
|
||||||
"python_version": "3.6",
|
"python_version": "3.6",
|
||||||
"sys_platform": "darwin"
|
"sys_platform": "darwin"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {
|
"requires": {
|
||||||
"python_full_version": "3.6.2"
|
"python_full_version": "3.6.3"
|
||||||
},
|
},
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"certifi": {
|
"certifi": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:54a07c09c586b0e4c619f02a5e94e36619da8e2b053e20f594348c0611803704",
|
"sha256:244be0d93b71e93fc0a0a479862051414d0e00e16435707e5bf5000f92e04694",
|
||||||
"sha256:40523d2efb60523e113b44602298f0960e900388cf3bb6043f645cf57ea9e3f5"
|
"sha256:5ec74291ca1136b40f0379e1128ff80e866597e4e2c1e755739a913bbc3613c0"
|
||||||
],
|
],
|
||||||
"version": "==2017.7.27.1"
|
"version": "==2017.11.5"
|
||||||
},
|
},
|
||||||
"chardet": {
|
"chardet": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
|
|||||||
+2
-2
@@ -5,14 +5,14 @@
|
|||||||
},
|
},
|
||||||
"host-environment-markers": {
|
"host-environment-markers": {
|
||||||
"implementation_name": "cpython",
|
"implementation_name": "cpython",
|
||||||
"implementation_version": "3.6.2",
|
"implementation_version": "3.6.3",
|
||||||
"os_name": "posix",
|
"os_name": "posix",
|
||||||
"platform_machine": "x86_64",
|
"platform_machine": "x86_64",
|
||||||
"platform_python_implementation": "CPython",
|
"platform_python_implementation": "CPython",
|
||||||
"platform_release": "16.7.0",
|
"platform_release": "16.7.0",
|
||||||
"platform_system": "Darwin",
|
"platform_system": "Darwin",
|
||||||
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
|
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
|
||||||
"python_full_version": "3.6.2",
|
"python_full_version": "3.6.3",
|
||||||
"python_version": "3.6",
|
"python_version": "3.6",
|
||||||
"sys_platform": "darwin"
|
"sys_platform": "darwin"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ testPipenvLock() {
|
|||||||
|
|
||||||
testPipenvVersion() {
|
testPipenvVersion() {
|
||||||
compile "pipenv-version"
|
compile "pipenv-version"
|
||||||
assertCaptured "3.6.2"
|
assertCaptured "3.6.4"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
testPipenvFullVersion() {
|
testPipenvFullVersion() {
|
||||||
compile "pipenv-full-version"
|
compile "pipenv-full-version"
|
||||||
assertCaptured "3.6.2"
|
assertCaptured "3.6.3"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ testPython2() {
|
|||||||
|
|
||||||
testPython3() {
|
testPython3() {
|
||||||
compile "python3"
|
compile "python3"
|
||||||
assertCaptured "python-3.6.2"
|
assertCaptured "python-3.6.4"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -25,9 +25,9 @@ SHUNIT_ERROR=2
|
|||||||
# enable strict mode by default
|
# enable strict mode by default
|
||||||
SHUNIT_STRICT=${SHUNIT_STRICT:-${SHUNIT_TRUE}}
|
SHUNIT_STRICT=${SHUNIT_STRICT:-${SHUNIT_TRUE}}
|
||||||
|
|
||||||
_shunit_warn() { echo "shunit2:WARN $@" >&2; }
|
_shunit_warn() { echo "shunit2:WARN $*" >&2; }
|
||||||
_shunit_error() { echo "shunit2:ERROR $@" >&2; }
|
_shunit_error() { echo "shunit2:ERROR $*" >&2; }
|
||||||
_shunit_fatal() { echo "shunit2:FATAL $@" >&2; exit ${SHUNIT_ERROR}; }
|
_shunit_fatal() { echo "shunit2:FATAL $*" >&2; exit ${SHUNIT_ERROR}; }
|
||||||
|
|
||||||
# specific shell checks
|
# specific shell checks
|
||||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ capture()
|
|||||||
|
|
||||||
LAST_COMMAND="$@"
|
LAST_COMMAND="$@"
|
||||||
|
|
||||||
$@ >${STD_OUT} 2>${STD_ERR}
|
"$@" >${STD_OUT} 2>${STD_ERR}
|
||||||
RETURN=$?
|
RETURN=$?
|
||||||
rtrn=${RETURN} # deprecated
|
rtrn=${RETURN} # deprecated
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+3
@@ -1,2 +1,5 @@
|
|||||||
# Automatic configuration for Gunicorn's ForwardedAllowIPS setting.
|
# Automatic configuration for Gunicorn's ForwardedAllowIPS setting.
|
||||||
export FORWARDED_ALLOW_IPS='*'
|
export FORWARDED_ALLOW_IPS='*'
|
||||||
|
|
||||||
|
# Automatic configuration for Gunicorn's stdout access log setting.
|
||||||
|
export GUNICORN_CMD_ARGS=${GUNICORN_CMD_ARGS:-"--access-logfile -"}
|
||||||
|
|||||||
Vendored
+3
-3
@@ -25,9 +25,9 @@ SHUNIT_ERROR=2
|
|||||||
# enable strict mode by default
|
# enable strict mode by default
|
||||||
SHUNIT_STRICT=${SHUNIT_STRICT:-${SHUNIT_TRUE}}
|
SHUNIT_STRICT=${SHUNIT_STRICT:-${SHUNIT_TRUE}}
|
||||||
|
|
||||||
_shunit_warn() { echo "shunit2:WARN $@" >&2; }
|
_shunit_warn() { echo "shunit2:WARN $*" >&2; }
|
||||||
_shunit_error() { echo "shunit2:ERROR $@" >&2; }
|
_shunit_error() { echo "shunit2:ERROR $*" >&2; }
|
||||||
_shunit_fatal() { echo "shunit2:FATAL $@" >&2; exit ${SHUNIT_ERROR}; }
|
_shunit_fatal() { echo "shunit2:FATAL $*" >&2; exit ${SHUNIT_ERROR}; }
|
||||||
|
|
||||||
# specific shell checks
|
# specific shell checks
|
||||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
|
|||||||
Vendored
+1
-1
@@ -36,7 +36,7 @@ capture()
|
|||||||
|
|
||||||
LAST_COMMAND="$@"
|
LAST_COMMAND="$@"
|
||||||
|
|
||||||
$@ >${STD_OUT} 2>${STD_ERR}
|
"$@" >${STD_OUT} 2>${STD_ERR}
|
||||||
RETURN=$?
|
RETURN=$?
|
||||||
rtrn=${RETURN} # deprecated
|
rtrn=${RETURN} # deprecated
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user