Skip to content
Snippets Groups Projects
Commit 179e6287 authored by Ian Stapleton Cordasco's avatar Ian Stapleton Cordasco
Browse files

Prevent Python 3.7 from being unsupported

Python 3.7.0 is supported but not preferred given how new it is. As a
result, we don't want it to be the default, but we also don't want users
to be confused when upgrading to it.

Closes gh-728
parent 18945ff1
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,8 @@ export VENDOR_URL ...@@ -50,7 +50,8 @@ export VENDOR_URL
# as well as prompt the user to upgrade if they are using an un–supported version. # as well as prompt the user to upgrade if they are using an un–supported version.
# Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37. # Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37.
DEFAULT_PYTHON_VERSION="python-3.6.6" DEFAULT_PYTHON_VERSION="python-3.6.6"
LATEST_3="python-3.6.6" LATEST_36="python-3.6.6"
LATEST_37="python-3.7.0"
LATEST_2="python-2.7.15" LATEST_2="python-2.7.15"
# Which stack is used (for binary downloading), if none is provided (e.g. outside of Heroku)? # Which stack is used (for binary downloading), if none is provided (e.g. outside of Heroku)?
...@@ -58,7 +59,7 @@ DEFAULT_PYTHON_STACK="cedar-14" ...@@ -58,7 +59,7 @@ DEFAULT_PYTHON_STACK="cedar-14"
# If pip doesn't match this version (the version we install), run the installer. # If pip doesn't match this version (the version we install), run the installer.
PIP_UPDATE="9.0.2" PIP_UPDATE="9.0.2"
export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE LATEST_2 LATEST_3 export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE LATEST_2 LATEST_36 LATEST_37
# Common Problem Warnings: # Common Problem Warnings:
# This section creates a temporary file in which to stick the output of `pip install`. # This section creates a temporary file in which to stick the output of `pip install`.
......
...@@ -22,7 +22,10 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then ...@@ -22,7 +22,10 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
echo "$LATEST_2" > "$BUILD_DIR/runtime.txt" echo "$LATEST_2" > "$BUILD_DIR/runtime.txt"
fi fi
if [ "$PYTHON" = 3.6 ]; then if [ "$PYTHON" = 3.6 ]; then
echo "$LATEST_3" > "$BUILD_DIR/runtime.txt" echo "$LATEST_36" > "$BUILD_DIR/runtime.txt"
fi
if [ "$PYTHON" = 3.7 ]; then
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt"
fi fi
fi fi
......
...@@ -14,12 +14,17 @@ if [[ $PYTHON_VERSION =~ ^python-2 ]]; then ...@@ -14,12 +14,17 @@ if [[ $PYTHON_VERSION =~ ^python-2 ]]; then
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi fi
else else
if [[ "$PYTHON_VERSION" != "$LATEST_3" ]]; then if [[ $PYTHON_VERSION =~ ^python-3.7 ]] && [[ "$PYTHON_VERSION" != "$LATEST_37" ]]; then
puts-warn "The latest version of Python 3 is $LATEST_3 (you are using $PYTHON_VERSION, which is unsupported)." puts-warn "The latest version of Python 3 is $LATEST_37 (you are using $PYTHON_VERSION, which is unsupported)."
puts-warn "We recommend upgrading by specifying the latest version ($LATEST_3)." puts-warn "We recommend upgrading by specifying the latest version ($LATEST_37)."
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
else
if [[ "$PYTHON_VERSION" != "$LATEST_36" ]]; then
puts-warn "The latest version of Python 3 is $LATEST_36 (you are using $PYTHON_VERSION, which is unsupported)."
puts-warn "We recommend upgrading by specifying the latest version ($LATEST_36)."
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi
fi fi
fi fi
if [[ "$STACK" != "$CACHED_PYTHON_STACK" ]]; then if [[ "$STACK" != "$CACHED_PYTHON_STACK" ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment