diff --git a/CHANGELOG.md b/CHANGELOG.md index 69bc570f1bb7a5f530448273e7dc0ee45e36b24a..61476ff8954df3db5c96c2f821eec8829f4b5b7f 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 diff --git a/bin/steps/python b/bin/steps/python index e66a05dd7b48524ba0a6f6e7258cf0bb73aabfb9..ea623b1bfdf72daef78dcb7c12bfa766f44e352a 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -12,17 +12,34 @@ 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 + else + 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 fi @@ -49,6 +66,7 @@ if [ -f .heroku/python-version ]; then fi fi + if [ ! "$SKIP_INSTALL" ]; then puts-step "Installing $PYTHON_VERSION" @@ -71,6 +89,7 @@ if [ ! "$SKIP_INSTALL" ]; then hash -r fi + # If Pip isn't up to date: if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then