Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Install setuptools from PyPI rather than a vendored copy (heroku#1007)
Browse files Browse the repository at this point in the history
Since:
* we'll be updating setuptools soon, and newer setuptools has dropped
  support for Python versions this buildpack needs to support. As such
  if we continued to vendor setuptools, we would need to vendor at
  least three different versions.
* we want to try and update setuptools more frequently than we have
  in the past, which will mean more repo bloat from binary churn.
* we're still pinning to a specific version, meaning vendoring doesn't
  have determinism benefits.
* setuptools is only fetched from PyPI for new installs (or where
  versions have changed), so this doesn't increase build time, load on
  PyPI, or reliance on PyPI in the common case.
* setuptools is already being inadvertently installed from PyPI prior to
  being installed from the vendored copy (see heroku#1001), so we're in effect
  already using/depending on PyPI here.
* switching to storing setuptools on S3 wouldn't help reliability as
  much as it would appear at first glance, since the later `pip install`
  of customer dependencies will fail if PyPI is down anyway.
  • Loading branch information
edmorley authored and dryan committed Nov 19, 2020
1 parent ca2a6b3 commit 8f0b557
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Master

- Output the installed version of pip and setuptools 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)

# 173 (2020-07-21)
Expand Down
2 changes: 1 addition & 1 deletion bin/steps/python
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *${PIP_VERSION}* ]]; then
rm -fr /app/.heroku/python/lib/python*/site-packages/setuptools-*

/app/.heroku/python/bin/python "$GETPIP_PY" pip=="${PIP_VERSION}" &> /dev/null
/app/.heroku/python/bin/pip install "$ROOT_DIR/vendor/setuptools-${SETUPTOOLS_VERSION}-py2.py3-none-any.whl" &> /dev/null
/app/.heroku/python/bin/pip install "setuptools==${SETUPTOOLS_VERSION}" &> /dev/null
fi

set -e
Expand Down
Binary file removed vendor/setuptools-39.0.1-py2.py3-none-any.whl
Binary file not shown.

0 comments on commit 8f0b557

Please sign in to comment.