mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Upgrades 🔝 (#475)
* fixed the bug for pypy-5.8.0 * changelog Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * python 2.7.14 Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * pipfile > requirements.txt Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * check for python_full_version too Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * 2.7.14 Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * warn when using an older version of python Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * requirements for anaconda buildpack Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * remove hashes for conda buildpack Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * improvements to pipenv python version detection Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * oops Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * oops Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * oops Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * echo not puts Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * try this Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * learn more Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * there we go Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * cleanups Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * cleanups Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * cleanups Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * unsupported Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * consistiency Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * be more specific Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * capitalize Pipfile.lock Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * attempt to force color Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * try this Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * try this Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * interactive Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * interactive Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * diagnose Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * try without -l Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * confirmed env working Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * just -c Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * use latest, to debug Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * no more bash Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * try … Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * don't use the git version of pipenv Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * oops Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * next version Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * 2.7.14 Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * comment out force color bits Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * readme Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * more tests Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * more tests Signed-off-by: Kenneth Reitz <me@kennethreitz.org> * ellipsis Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
+4
-1
@@ -35,10 +35,13 @@ export BUILD_DIR CACHE_DIR ENV_DIR
|
||||
|
||||
# Python defaults
|
||||
DEFAULT_PYTHON_VERSION="python-3.6.2"
|
||||
LATEST_3="python-3.6.2"
|
||||
LATEST_2="python-2.7.14"
|
||||
|
||||
DEFAULT_PYTHON_STACK="cedar-14"
|
||||
PIP_UPDATE="9.0.1"
|
||||
|
||||
export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE
|
||||
export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE LATEST_2 LATEST_3
|
||||
|
||||
# Common Problem Warnings
|
||||
WARNINGS_LOG=$(mktemp)
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ source "$BIN_DIR/utils"
|
||||
|
||||
# Check that nltk was installed by pip, otherwise obviously not needed
|
||||
if sp-grep -s nltk; then
|
||||
puts-step "Downloading NLTK corpora..."
|
||||
puts-step "Downloading NLTK corpora…"
|
||||
|
||||
nltk_packages_definition="$BUILD_DIR/nltk.txt"
|
||||
|
||||
|
||||
+4
-1
@@ -1,9 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# export CLINT_FORCE_COLOR=1
|
||||
# export PIPENV_FORCE_COLOR=1
|
||||
|
||||
# Pipenv support (Generate requriements.txt with pipenv).
|
||||
if [[ -f Pipfile ]]; then
|
||||
if [[ ! -f requirements.txt ]]; then
|
||||
puts-step "Installing requirements with latest Pipenv..."
|
||||
puts-step "Installing requirements with latest Pipenv…"
|
||||
|
||||
# Install pipenv.
|
||||
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
|
||||
|
||||
@@ -6,19 +6,27 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
|
||||
|
||||
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then
|
||||
if [[ ! -f $BUILD_DIR/Pipfile.lock ]]; then
|
||||
puts-warn "No 'pipfile.lock' found! We recommend you commit this into your repository."
|
||||
puts-warn "No 'Pipfile.lock' found! We recommend you commit this into your repository."
|
||||
fi
|
||||
if [[ -f $BUILD_DIR/Pipfile.lock ]]; then
|
||||
set +e
|
||||
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock")
|
||||
PYTHON=$(jq -r '._meta.requires.python_full_version' "$BUILD_DIR/Pipfile.lock")
|
||||
if [[ "$PYTHON" != "null" ]]; then
|
||||
echo "python-$PYTHON" > "$BUILD_DIR/runtime.txt"
|
||||
fi
|
||||
set -e
|
||||
|
||||
if [ "$PYTHON" = 2.7 ]; then
|
||||
echo "python-2.7.13" > "$BUILD_DIR/runtime.txt"
|
||||
fi
|
||||
if [ "$PYTHON" = 3.6 ]; then
|
||||
echo "python-3.6.2" > "$BUILD_DIR/runtime.txt"
|
||||
if [[ "$PYTHON" == "null" ]]; then
|
||||
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock")
|
||||
if [ "$PYTHON" = 2.7 ]; then
|
||||
echo "python-2.7.14" > "$BUILD_DIR/runtime.txt"
|
||||
fi
|
||||
if [ "$PYTHON" = 3.6 ]; then
|
||||
echo "python-3.6.2" > "$BUILD_DIR/runtime.txt"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -4,6 +4,21 @@ set +e
|
||||
runtime-fixer runtime.txt
|
||||
PYTHON_VERSION=$(cat runtime.txt)
|
||||
|
||||
if [[ $PYTHON_VERSION =~ ^python-2 ]]; then
|
||||
if [[ "$PYTHON_VERSION" != "$LATEST_2" ]]; then
|
||||
puts-warn "The latest version of Python 2 is $LATEST_2 (you are using $PYTHON_VERSION, which is unsupported)."
|
||||
puts-warn "We recommend upgrading by specifying the latest version ($LATEST_2)."
|
||||
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
|
||||
fi
|
||||
else
|
||||
if [[ "$PYTHON_VERSION" != "$LATEST_3" ]]; then
|
||||
puts-warn "The latest version of Python 3 is $LATEST_3 (you are using $PYTHON_VERSION, which is unsupported)."
|
||||
puts-warn "We recommend upgrading by specifying the latest version ($LATEST_3)."
|
||||
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [[ "$STACK" != "$CACHED_PYTHON_STACK" ]]; then
|
||||
puts-step "Stack has changed from $CACHED_PYTHON_STACK to $STACK, clearing cache"
|
||||
rm -fr .heroku/python-stack .heroku/python-version .heroku/python .heroku/vendor
|
||||
|
||||
Reference in New Issue
Block a user