-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
During the Python setup step, get-pip.py
is unconditionally downloaded for every build:
heroku-buildpack-python/bin/steps/python
Lines 139 to 148 in 156b07c
# Heroku uses the get-pip utility maintained by the Python community to vendor Pip. | |
# https://github.com/pypa/get-pip | |
GETPIP_URL="https://lang-python.s3.amazonaws.com/etc/get-pip.py" | |
GETPIP_PY="${TMPDIR:-/tmp}/get-pip.py" | |
if ! curl -s "${GETPIP_URL}" -o "$GETPIP_PY" &> /dev/null; then | |
mcount "failure.python.get-pip" | |
echo "Failed to pull down get-pip" | |
exit 1 | |
fi |
However it's only used if performing a fresh Python install (eg new app, manually cleared cache or Python/stack version upgrade) or if the Pip version differs:
heroku-buildpack-python/bin/steps/python
Lines 150 to 159 in 156b07c
# If a new Python has been installed or Pip isn't up to date: | |
if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then | |
puts-step "Installing pip" | |
# 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_UPDATE" &> /dev/null |
The get-pip.py
download step should be inside the later conditional, so that the download can be skipped.
Doing this would save time downloading the file and remove another potential failure mode for builds.
Metadata
Metadata
Assignees
Labels
No labels