From 2097eab028b4b074d53a5f67e06efc58be7c50a7 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Wed, 29 Jul 2020 00:11:04 +0100 Subject: [PATCH] Install an explicit version of wheel rather than latest (#1007) Before: - if `wheel` was not already installed, then `get-pip.py` would automatically install the latest version on PyPI, which is `0.34.2` (or `0.33.6` for Python 3.4). - if `wheel` was already installed, then it was left unchanged regardless of the version installed. Now: - if `wheel` is not already installed, then the same versions will be installed as before, except these versions are pinned and will now not change unexpectedly after future `wheel` releases. - if `wheel` is already installed, then it's upgraded/downgraded to the target version as needed. Partly addresses #1000, though this change only helps builds where the pip/setuptools/wheel install flow is triggered (currently only new apps or ones where Python was purged or pip was not the correct version). Since the wheel version is now known, it's output to the build log to ease debugging and for parity with pip/setuptools. The rest of #1000 will be fixed in later commits. --- CHANGELOG.md | 3 ++- bin/steps/python | 8 +++++--- test/run-features | 2 +- test/run-versions | 18 +++++++++--------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a359d8f..ec41c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ # Master -- Output the installed version of pip and setuptools in the build log (#1007). +- Install an explicit version of wheel rather than the latest release at the time (#1007). +- Output the installed version of pip, setuptools and wheel in the build log (#1007). - Install setuptools from PyPI rather than a vendored copy (#1007). - Reduce the number of environment variables exposed to `bin/{pre,post}_compile` and other subprocesses (#1011) diff --git a/bin/steps/python b/bin/steps/python index d297b37..4fca67b 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -138,10 +138,12 @@ fi PIP_VERSION='20.0.2' SETUPTOOLS_VERSION='39.0.1' +WHEEL_VERSION='0.34.2' if [[ "${PYTHON_VERSION}" == ${PY34}* ]]; then - # Python 3.4 support was dropped in pip 19.2+. + # Python 3.4 support was dropped in pip 19.2+ and wheel 0.34.0+. PIP_VERSION='19.1.1' + WHEEL_VERSION='0.33.6' fi if [[ -f "$BUILD_DIR/Pipfile" ]]; then @@ -163,13 +165,13 @@ fi # If a new Python has been installed or Pip isn't up to date: if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *${PIP_VERSION}* ]]; then - puts-step "Installing pip ${PIP_VERSION} and setuptools ${SETUPTOOLS_VERSION}" + puts-step "Installing pip ${PIP_VERSION}, setuptools ${SETUPTOOLS_VERSION} and wheel ${WHEEL_VERSION}" # Remove old installations. rm -fr /app/.heroku/python/lib/python*/site-packages/pip-* rm -fr /app/.heroku/python/lib/python*/site-packages/setuptools-* - /app/.heroku/python/bin/python "$GETPIP_PY" pip=="${PIP_VERSION}" "setuptools==${SETUPTOOLS_VERSION}" &> /dev/null + /app/.heroku/python/bin/python "$GETPIP_PY" pip=="${PIP_VERSION}" "setuptools==${SETUPTOOLS_VERSION}" "wheel==${WHEEL_VERSION}" &> /dev/null fi set -e diff --git a/test/run-features b/test/run-features index 1c059c8..478ada1 100755 --- a/test/run-features +++ b/test/run-features @@ -44,7 +44,7 @@ testStandardRequirements() { testPipenv() { compile "pipenv" - assertCaptured "Installing pip 9.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 9.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCapturedSuccess } diff --git a/test/run-versions b/test/run-versions index 49775d8..09587d8 100755 --- a/test/run-versions +++ b/test/run-versions @@ -9,7 +9,7 @@ testPythonDefault() { compile "pythonDefault" assertCaptured $DEFAULT_PYTHON_VERSION assertNotCaptured "security update" - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCaptured "Installing SQLite3" assertCapturedSuccess } @@ -25,7 +25,7 @@ testPython2() { assertNotCaptured "python-2-7-eol-faq"; fi assertNotCaptured "security update" - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCaptured "Installing SQLite3" assertCapturedSuccess } @@ -53,7 +53,7 @@ testPython3_4() { compile "python3_4" assertCaptured $LATEST_34 assertNotCaptured "security update" - assertCaptured "Installing pip 19.1.1 and setuptools 39.0.1" + assertCaptured "Installing pip 19.1.1, setuptools 39.0.1 and wheel 0.33.6" # if cedar 14 and legacy binaries, fail. if cedar 14 and staging, succeed. if [[ ! -n $USE_STAGING_BINARIES ]] && [[ $STACK == "cedar-14" ]]; then assertCapturedError @@ -89,7 +89,7 @@ testPython3_5() { compile "python3_5" assertCaptured $LATEST_35 assertNotCaptured "security update" - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCaptured "Installing SQLite3" assertCapturedSuccess } @@ -112,7 +112,7 @@ testPython3_6() { compile "python3_6" assertCaptured $LATEST_36 assertNotCaptured "security update" - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCaptured "Installing SQLite3" assertCapturedSuccess } @@ -139,7 +139,7 @@ testPython3_7() { else assertNotCaptured "security update" assertCaptured $LATEST_37 - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCaptured "Installing SQLite3" assertCapturedSuccess fi @@ -183,7 +183,7 @@ testPython3_8() { else assertNotCaptured "security update" assertCaptured $LATEST_38 - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCaptured "Installing SQLite3" assertCapturedSuccess fi @@ -202,7 +202,7 @@ testPypy3_6() { else assertCaptured "Installing pypy" assertCaptured "$PYPY_36" - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCapturedSuccess fi } @@ -214,7 +214,7 @@ testPypy2_7() { else assertCaptured "Installing pypy" assertCaptured "$PYPY_27" - assertCaptured "Installing pip 20.0.2 and setuptools 39.0.1" + assertCaptured "Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2" assertCapturedSuccess fi }