diff --git a/CHANGELOG.md b/CHANGELOG.md index 6407f99b1..a0a02e9d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Fixed the "Python security update is available" warning being shown when the requested version is newer than the latest version known to the buildpack. ([#1569](https://github.com/heroku/heroku-buildpack-python/pull/1569)) - Fixed glibc warnings seen when downgrading the stack version. ([#1568](https://github.com/heroku/heroku-buildpack-python/pull/1568)) - Adjusted compiler options used to build Python for improved parity with the Docker Hub Python images. ([#1566](https://github.com/heroku/heroku-buildpack-python/pull/1566)) - Excluded `LD_LIBRARY_PATH` and `PYTHONHOME` app config vars when invoking subprocesses during the build. ([#1565](https://github.com/heroku/heroku-buildpack-python/pull/1565)) diff --git a/bin/steps/python b/bin/steps/python index c7e42f58d..8388602ee 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -32,9 +32,12 @@ function eol_python_version_error() { } function warn_if_patch_update_available() { - local current_version="${1}" + local requested_version="${1}" local latest_patch_version="${2}" - if [[ "${current_version}" != "${latest_patch_version}" ]]; then + # Extract the patch version component of the version strings (ie: the '5' in '3.10.5'). + local requested_patch_number="${requested_version##*.}" + local latest_patch_number="${latest_patch_version##*.}" + if (( requested_patch_number < latest_patch_number )); then puts-warn puts-warn "A Python security update is available! Upgrade as soon as possible to: ${latest_patch_version}" puts-warn "See: https://devcenter.heroku.com/articles/python-runtimes"