Skip to content

Commit fcf696b

Browse files
authored
Add support for Heroku-20 (#968)
This adds support for the upcoming Heroku-20 stack. The Heroku-20 Dockerfile is identical to that for Heroku-18, other than the base image, and stack-related env var changes. The initial Python versions made available will be those in: https://devcenter.heroku.com/articles/python-support#supported-runtimes https://devcenter.heroku.com/articles/python-support#supported-pypy-runtimes ...minus CPython 2.7, since it's EOL. Which are: * `python-3.6.12` * `python-3.7.9` * `python-3.8.6` * `python-3.9.0` * `pypy2.7-7.3.2` * `pypy3.6-7.3.2` Note: Unlike CPython 2.7, the PyPy 2.7 branch is still supported: https://doc.pypy.org/en/latest/faq.html#how-long-will-pypy-support-python2 In addition, I've generated binaries for each patch release immediately prior to the latest versions (with the exception of 3.9.0, since there isn't one), otherwise it's not possible to run the "out of date Python" warning tests. The binaries were generated using the process here: https://github.com/heroku/heroku-buildpack-python/blob/main/builds/README.md Specifically: ``` make deploy-runtimes STACKS='heroku-20' \ RUNTIMES='python-3.6.11 python-3.6.12 python-3.7.8 python-3.7.9 python-3.8.5 python-3.8.6 python-3.9.0 pypy2.7-7.3.1 pypy2.7-7.3.2 pypy3.6-7.3.1 pypy3.6-7.3.2' \ ENV_FILE=... ``` Binaries for the GDAL/GEOS/PROJ feature have not been generated, since it's deprecated and due for removal shortly: https://help.heroku.com/D5INLB1A/python-s-build_with_geo_libraries-legacy-feature-is-now-deprecated Note: Like the Python 3.9.0 release, this uses the new S3 bucket, so apps will need to be using a recent version of the buildpack in order to build on Heroku-20: https://devcenter.heroku.com/articles/python-support#checking-the-python-buildpack-version Closes @W-7485877@.
1 parent a98ef91 commit fcf696b

File tree

13 files changed

+92
-40
lines changed

13 files changed

+92
-40
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ env:
3434
- STACK=heroku-18 TEST_CMD=test/run-deps
3535
- STACK=heroku-18 TEST_CMD=test/run-versions
3636
- STACK=heroku-18 TEST_CMD=test/run-features
37+
38+
- STACK=heroku-20 TEST_CMD=test/run-deps
39+
- STACK=heroku-20 TEST_CMD=test/run-versions
40+
- STACK=heroku-20 TEST_CMD=test/run-features
3741
global:
3842
- HATCHET_RETRIES=3
3943
- IS_RUNNING_ON_CI=true

CHANGELOG.md

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

33
## Unreleased
44

5+
- Add support for Heroku-20 (#968).
56

67
## v182 (2020-10-06)
78

bin/steps/gdal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ source "$BIN_DIR/utils"
2121
# If GDAL exists within requirements, use vendored gdal.
2222
if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
2323

24-
if [ ! -f ".heroku/vendor/bin/gdalserver" ]; then
24+
if [[ ! -f ".heroku/vendor/bin/gdalserver" && "${STACK}" == 'heroku-20' ]]; then
25+
puts-warn "The buildpack's built-in GDAL functonality is not supported on Heroku-20."
26+
puts-warn "Please use this buildpack instead: https://github.com/heroku/heroku-geo-buildpack"
2527

28+
elif [[ ! -f ".heroku/vendor/bin/gdalserver" ]]; then
2629
puts-warn "The vendored GDAL package in the Heroku Python Buildpack now deprecated."
2730
puts-warn "To enable GDAL use an alternative buildpack is available here - https://github.com/heroku/heroku-geo-buildpack"
2831

bin/steps/geo-libs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
2020
# shellcheck source=bin/utils
2121
source "$BIN_DIR/utils"
2222

23-
# If GDAL exists within requirements, use vendored gdal.
24-
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
23+
if [[ "$BUILD_WITH_GEO_LIBRARIES" && "${STACK}" == 'heroku-20' ]]; then
24+
puts-warn "The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality is not supported on Heroku-20."
25+
puts-warn "Please use this buildpack for GDAL, GEOS and PROJ: https://github.com/heroku/heroku-geo-buildpack"
26+
puts-warn "To hide this message, unset the BUILD_WITH_GEO_LIBRARIES variable using: heroku config:unset BUILD_WITH_GEO_LIBRARIES"
27+
elif [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
2528
mcount "buildvar.BUILD_WITH_GEO_LIBRARIES"
2629

2730
puts-warn "The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated."

builds/heroku-20.Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM heroku/heroku:20-build
2+
3+
ENV WORKSPACE_DIR="/app/builds" \
4+
S3_BUCKET="heroku-buildpack-python" \
5+
S3_PREFIX="heroku-20/" \
6+
STACK="heroku-20"
7+
8+
RUN apt-get update \
9+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
10+
libsqlite3-dev \
11+
python3-pip \
12+
python3-setuptools \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
WORKDIR /app
16+
17+
COPY requirements.txt /app/
18+
RUN pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
19+
20+
COPY . /app

test/fixtures/pipenv-full-version/Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ verify_ssl = true
66
requests = "*"
77

88
[requires]
9-
python_full_version = "3.6.3"
9+
python_full_version = "3.7.8"

test/fixtures/pipenv-full-version/Pipfile.lock

Lines changed: 2 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.6.7
1+
python-3.6.11
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.7.1
1+
python-3.7.8
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.8.0
1+
python-3.8.5

0 commit comments

Comments
 (0)