Skip to content

Commit 150f347

Browse files
committed
Always check/adjust the installed versions of setuptools/wheel (#1007)
Previously the pip/setuptools/wheel install step was skipped so long as Python hadn't just been clean installed (ie so long as not a new app, emptied cache, Python upgrade, stack change) and pip was the expected version. This meant that setuptool/wheel could be the wrong version (or even just not installed at all), and this would not be corrected. Now, we now use pip itself to determine whether the installed packages are up to date, since parsing pip's output is fragile (eg #1003) and would be tedious given there would be three packages to check. Unfortunately `get-pip.py` uses `--force-reinstall` which means performing this step every time is not the no-op it would otherwise be, but this will be resolved by switching away from `get-pip.py` in the next commit. Fixes #1000. Fixes #1003. Closes #999.
1 parent bcc32e6 commit 150f347

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Master
44

5+
- For repeat builds, also manage the installed versions of setuptools/wheel, rather than just that of pip (#1007).
56
- Install an explicit version of wheel rather than the latest release at the time (#1007).
67
- Output the installed version of pip, setuptools and wheel in the build log (#1007).
78
- Install setuptools from PyPI rather than a vendored copy (#1007).

bin/steps/python

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ if [ ! "$SKIP_INSTALL" ]; then
131131
# Record for future reference.
132132
echo "$PYTHON_VERSION" > .heroku/python-version
133133
echo "$STACK" > .heroku/python-stack
134-
FRESH_PYTHON=true
135134

136135
hash -r
137136
fi
@@ -162,13 +161,9 @@ if ! curl -s "${GETPIP_URL}" -o "$GETPIP_PY" &> /dev/null; then
162161
exit 1
163162
fi
164163

165-
# If a new Python has been installed or Pip isn't up to date:
166-
if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *${PIP_VERSION}* ]]; then
164+
puts-step "Installing pip ${PIP_VERSION}, setuptools ${SETUPTOOLS_VERSION} and wheel ${WHEEL_VERSION}"
167165

168-
puts-step "Installing pip ${PIP_VERSION}, setuptools ${SETUPTOOLS_VERSION} and wheel ${WHEEL_VERSION}"
169-
170-
/app/.heroku/python/bin/python "$GETPIP_PY" pip=="${PIP_VERSION}" "setuptools==${SETUPTOOLS_VERSION}" "wheel==${WHEEL_VERSION}" &> /dev/null
171-
fi
166+
/app/.heroku/python/bin/python "$GETPIP_PY" pip=="${PIP_VERSION}" "setuptools==${SETUPTOOLS_VERSION}" "wheel==${WHEEL_VERSION}" &> /dev/null
172167

173168
set -e
174169
hash -r

0 commit comments

Comments
 (0)