From cba3201ac2fc4686a0a3b892ebddff740d1ff834 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 11 Aug 2020 19:31:53 +0100 Subject: [PATCH] Rename confusing PYPY_* variables (#1044) Since these variables refer to the latest version of PyPy, compared to the similarly named `PYPY27` and `PYPY36` variables (ie same name except without the underscore) which refer to the major/minor version only. The similar names caused me to use the wrong one locally whilst working on another PR, which was caught by tests but demonstrates why we should rename them. Closes @W-7935256@. [skip changelog] --- bin/default_pythons | 4 ++-- bin/steps/python | 8 ++++---- test/run-versions | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/default_pythons b/bin/default_pythons index 2fe4e10..96d1303 100755 --- a/bin/default_pythons +++ b/bin/default_pythons @@ -12,5 +12,5 @@ LATEST_36="python-3.6.11" LATEST_35="python-3.5.9" LATEST_34="python-3.4.10" LATEST_27="python-2.7.18" -PYPY_36="pypy3.6-7.3.1" -PYPY_27="pypy2.7-7.3.1" +LATEST_PYPY_36="pypy3.6-7.3.1" +LATEST_PYPY_27="pypy2.7-7.3.1" diff --git a/bin/steps/python b/bin/steps/python index 748bf75..7f53b74 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -64,15 +64,15 @@ if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then fi if [[ "$PYTHON_VERSION" == $PYPY27* ]]; then # security update note - if [ "$PYTHON_VERSION" != "$PYPY_27" ]; then - puts-warn "$SECURITY_UPDATE_PYPY" "$PYPY_27" + if [ "$PYTHON_VERSION" != "$LATEST_PYPY_27" ]; then + puts-warn "$SECURITY_UPDATE_PYPY" "$LATEST_PYPY_27" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" fi fi if [[ "$PYTHON_VERSION" == $PYPY36* ]]; then # security update note - if [ "$PYTHON_VERSION" != "$PYPY_36" ]; then - puts-warn "$SECURITY_UPDATE_PYPY" "$PYPY_36" + if [ "$PYTHON_VERSION" != "$LATEST_PYPY_36" ]; then + puts-warn "$SECURITY_UPDATE_PYPY" "$LATEST_PYPY_36" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" fi fi diff --git a/test/run-versions b/test/run-versions index 0f76a87..32cfe52 100755 --- a/test/run-versions +++ b/test/run-versions @@ -199,7 +199,7 @@ testPypy3_6() { compile "pypy3_6" assertCaptured "Installing pypy" assertNotCaptured "security update" - assertCaptured "$PYPY_36" + assertCaptured "$LATEST_PYPY_36" assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2" assertCapturedSuccess } @@ -211,7 +211,7 @@ testPypy3_6_warn() { else assertCaptured "Installing pypy" assertCaptured "security update!" - assertCaptured "$PYPY_36" + assertCaptured "$LATEST_PYPY_36" assertCapturedSuccess fi } @@ -220,7 +220,7 @@ testPypy2_7() { compile "pypy2_7" assertCaptured "Installing pypy" assertNotCaptured "security update" - assertCaptured "$PYPY_27" + assertCaptured "$LATEST_PYPY_27" assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2" assertCapturedSuccess } @@ -232,7 +232,7 @@ testPypy2_7_warn() { else assertCaptured "Installing pypy" assertCaptured "security update!" - assertCaptured "$PYPY_27" + assertCaptured "$LATEST_PYPY_27" assertCapturedSuccess fi }