From f9621add422da9ba541fe233cc60d9ff1a9842f0 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Fri, 17 Aug 2018 08:52:13 -0500 Subject: [PATCH 1/4] Update indentation levels and messaging Fix indentation levels more helpful messages about supported versions --- bin/steps/python | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/bin/steps/python b/bin/steps/python index e66a05d..4770b68 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -12,17 +12,29 @@ if [[ $PYTHON_VERSION =~ ^python-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" + else + echo " Using supported version of Python 2 ($PYTHON_VERSION)" fi else - if [[ $PYTHON_VERSION =~ ^python-3.7 ]] && [[ "$PYTHON_VERSION" != "$LATEST_37" ]]; then - puts-warn "The latest version of Python 3.7 is $LATEST_37 (you are using $PYTHON_VERSION, which is unsupported)." - puts-warn "We recommend upgrading by specifying the latest version ($LATEST_37)." - 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.6 is $LATEST_36 (you are using $PYTHON_VERSION, which is unsupported)." - puts-warn "We recommend upgrading by specifying the latest version ($LATEST_36)." + if [[ $PYTHON_VERSION =~ ^python-3 ]]; then + if [[ $PYTHON_VERSION =~ ^python-3.7 ]]; then + if [[ "$PYTHON_VERSION" != "$LATEST_37" ]]; then + puts-warn "The latest version of Python 3.7 is $LATEST_37 (you are using $PYTHON_VERSION, which is unsupported)." + puts-warn "We recommend upgrading by specifying the latest version ($LATEST_37)." echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" + else + echo " Using supported version of Python 3.7 ($PYTHON_VERSION)" + fi + else + if [[ $PYTHON_VERSION =~ ^python-3.6 ]]; then + if [[ "$PYTHON_VERSION" != "$LATEST_36" ]]; then + puts-warn "The latest version of Python 3.6 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" + else + echo " Using supported version of Python 3.6 ($PYTHON_VERSION)" + fi + fi fi fi fi @@ -49,6 +61,7 @@ if [ -f .heroku/python-version ]; then fi fi + if [ ! "$SKIP_INSTALL" ]; then puts-step "Installing $PYTHON_VERSION" @@ -71,6 +84,7 @@ if [ ! "$SKIP_INSTALL" ]; then hash -r fi + # If Pip isn't up to date: if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then From 5e4667686aa66bfbe23405e065a30976207b4732 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Fri, 17 Aug 2018 14:32:12 -0500 Subject: [PATCH 2/4] add case for older python 3 install attempts --- bin/steps/python | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/steps/python b/bin/steps/python index 4770b68..b636619 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -34,6 +34,10 @@ else else echo " Using supported version of Python 3.6 ($PYTHON_VERSION)" fi + else + puts-warn "Heroku supports the latest version of Python 2 $LATEST_37, Python 3.6 $LATEST_36 and Python 3.7 $LATEST_2." + puts-warn "You are using $PYTHON_VERSION, which is unsupported." + puts-warn "We recommend upgrading by specifying the default supported version ($LATEST_36)." fi fi fi From 285ca2b73dc3db10a0d2ba5a29dff10d72c16d82 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Fri, 17 Aug 2018 14:36:35 -0500 Subject: [PATCH 3/4] reword warning, add doc link --- bin/steps/python | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/steps/python b/bin/steps/python index b636619..ea623b1 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -35,9 +35,10 @@ else echo " Using supported version of Python 3.6 ($PYTHON_VERSION)" fi else - puts-warn "Heroku supports the latest version of Python 2 $LATEST_37, Python 3.6 $LATEST_36 and Python 3.7 $LATEST_2." + puts-warn "Heroku supports runtime versions $LATEST_37, $LATEST_36 and $LATEST_2." puts-warn "You are using $PYTHON_VERSION, which is unsupported." puts-warn "We recommend upgrading by specifying the default supported version ($LATEST_36)." + echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" fi fi fi From e5d9ed259b952654321fde2546c07f6d9c8f205c Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Fri, 17 Aug 2018 14:43:06 -0500 Subject: [PATCH 4/4] changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69bc570..61476ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Python Buildpack Changelog +# 139 + +Improvements to Python install messaging + # 138 (2018-08-01) Use stack image SQLite3 instead of vendoring