mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Fix the security update version check message for PyPy (#1040)
Previously if an app was using an older version of PyPy, the buildpack would show a confusing "Could not find that version" message (even though the version was found), when it really meant to warn about there being a newer release available. It looks like the version check messages were perhaps copied and pasted from something else, but the message wording not updated at the time. I've also added tests since there were none for this feature. Fixes #1004. Closes @W-7918745@.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Fix the security update version check message for apps using PyPy (#1040).
|
||||
|
||||
## v175 (2020-08-05)
|
||||
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ PYTHON_VERSION=$(cat runtime.txt)
|
||||
VENDORED_PYTHON="${VENDOR_URL}/runtimes/$PYTHON_VERSION.tar.gz"
|
||||
|
||||
SECURITY_UPDATE="Python has released a security update! Please consider upgrading to"
|
||||
SECURITY_UPDATE_PYPY="The PyPy project has released a security update! Please consider upgrading to"
|
||||
|
||||
ONLY_SUPPORTED_2_VERSION="Only the latest version of Python 2 is supported on the platform. Please consider upgrading to"
|
||||
|
||||
@@ -64,14 +65,14 @@ if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then
|
||||
if [[ "$PYTHON_VERSION" == $PYPY27* ]]; then
|
||||
# security update note
|
||||
if [ "$PYTHON_VERSION" != "$PYPY_27" ]; then
|
||||
puts-warn "Could not find that Pypy version. Did you mean" "${PYPY_27}?"
|
||||
puts-warn "$SECURITY_UPDATE_PYPY" "$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 "Could not find that Pypy version. Did you mean" "${PYPY_36}?"
|
||||
puts-warn "$SECURITY_UPDATE_PYPY" "$PYPY_36"
|
||||
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
|
||||
fi
|
||||
fi
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
pypy2.7-7.2.0
|
||||
pypy2.7-7.3.1
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
pypy2.7-7.2.0
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
pypy3.6-7.2.0
|
||||
pypy3.6-7.3.1
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
pypy3.6-7.2.0
|
||||
+20
-2
@@ -197,24 +197,42 @@ testPython3_8_fail() {
|
||||
|
||||
testPypy3_6() {
|
||||
compile "pypy3_6"
|
||||
assertCaptured "Installing pypy"
|
||||
assertNotCaptured "security update"
|
||||
assertCaptured "$PYPY_36"
|
||||
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
||||
assertCapturedSuccess
|
||||
}
|
||||
|
||||
testPypy3_6_warn() {
|
||||
compile "pypy3_6_warn"
|
||||
if [[ $STACK = "cedar-14" ]]; then
|
||||
assertCapturedError
|
||||
else
|
||||
assertCaptured "Installing pypy"
|
||||
assertCaptured "security update!"
|
||||
assertCaptured "$PYPY_36"
|
||||
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
|
||||
assertCapturedSuccess
|
||||
fi
|
||||
}
|
||||
|
||||
testPypy2_7() {
|
||||
compile "pypy2_7"
|
||||
assertCaptured "Installing pypy"
|
||||
assertNotCaptured "security update"
|
||||
assertCaptured "$PYPY_27"
|
||||
assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
|
||||
assertCapturedSuccess
|
||||
}
|
||||
|
||||
testPypy2_7_warn() {
|
||||
compile "pypy2_7_warn"
|
||||
if [[ $STACK = "cedar-14" ]]; then
|
||||
assertCapturedError
|
||||
else
|
||||
assertCaptured "Installing pypy"
|
||||
assertCaptured "security update!"
|
||||
assertCaptured "$PYPY_27"
|
||||
assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
|
||||
assertCapturedSuccess
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user