feat: allow stack url overrides using BUILDPACK_VENDOR_URL env var (#643)

This is useful if you'd like to customize python binaries without forking the entire buildpack.

Similar functionality was implemented in https://github.com/heroku/heroku-buildpack-ruby/pull/238
This commit is contained in:
Jose Diaz-Gonzalez
2018-03-02 07:15:23 -05:00
committed by Kenneth Reitz
parent 9468ec2630
commit e15f68944a
6 changed files with 16 additions and 7 deletions
+4 -1
View File
@@ -4,6 +4,9 @@ set +e
runtime-fixer runtime.txt
PYTHON_VERSION=$(cat runtime.txt)
# The location of the pre-compiled python binary.
VENDORED_PYTHON="${VENDOR_URL}/runtimes/$PYTHON_VERSION.tar.gz"
if [[ $PYTHON_VERSION =~ ^python-2 ]]; then
if [[ "$PYTHON_VERSION" != "$LATEST_2" ]]; then
puts-warn "The latest version of Python 2 is $LATEST_2 (you are using $PYTHON_VERSION, which is unsupported)."
@@ -41,7 +44,7 @@ if [ ! "$SKIP_INSTALL" ]; then
mcount "version.python.$PYTHON_VERSION"
if ! curl "https://lang-python.s3.amazonaws.com/$STACK/runtimes/$PYTHON_VERSION.tar.gz" -s | tar zxv -C .heroku/python &> /dev/null; then
if ! curl "${VENDORED_PYTHON}" -s | tar zxv -C .heroku/python &> /dev/null; then
puts-warn "Requested runtime ($PYTHON_VERSION) is not available for this stack ($STACK)."
puts-warn "Aborting. More info: https://devcenter.heroku.com/articles/python-support"
exit 1