Compare commits

...

4 Commits

Author SHA1 Message Date
Ed Morley ac8fd555b8 Release v183 (#1097) 2020-10-12 12:31:44 +01:00
dependabot[bot] f825896c4e Bump heroku_hatchet from 7.3.0 to 7.3.1 (#1095)
Bumps [heroku_hatchet](https://github.com/heroku/hatchet) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/heroku/hatchet/releases)
- [Changelog](https://github.com/heroku/hatchet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heroku/hatchet/compare/v7.3.0...v7.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 10:01:20 +01:00
Ed Morley fcf696b835 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@.
2020-10-07 19:44:33 +01:00
Ed Morley a98ef91566 Tests: Clean up the Python version unit tests (#1092)
* Fixes the "Installing <version>" assertions so that they don't false
  positive against the "please upgrade to <version>" output.
* Removes modification of test fixtures during tests, since it can lead
  to failures depending on test order, and confusion when debugging.
* Updates the PyPy version warning tests to use a slightly newer (but
  still not latest) PyPy version, which means that the test now passes
  on Cedar-14 and can be unskipped.
* Switches to using an empty requirements file for version tests that
  duplicate the main test, to save spending time installing dependencies
  unnecessarily.
* Switches the NLTK test to using the default buildpack Python version,
  rather than an ancient Python 3.6.
* Skips the Python 3.7/3.8 tests on Cedar-14 rather than asserting
  failure, since we know they'll never pass due to Cedar-14's libssl being
  older than required.
* Removes redundant `testSqliteInstall` test since it duplicates the
  Python version install tests.

Longer term I'll be moving many of the unit tests to Hatchet, however
this at least makes the tests more dependable in the meantime.

Closes @W-8060219@.
Closes @W-8176779@.

[skip changelog]
2020-10-07 15:10:20 +01:00
29 changed files with 184 additions and 158 deletions
+4
View File
@@ -34,6 +34,10 @@ env:
- STACK=heroku-18 TEST_CMD=test/run-deps - STACK=heroku-18 TEST_CMD=test/run-deps
- STACK=heroku-18 TEST_CMD=test/run-versions - STACK=heroku-18 TEST_CMD=test/run-versions
- STACK=heroku-18 TEST_CMD=test/run-features - STACK=heroku-18 TEST_CMD=test/run-features
- STACK=heroku-20 TEST_CMD=test/run-deps
- STACK=heroku-20 TEST_CMD=test/run-versions
- STACK=heroku-20 TEST_CMD=test/run-features
global: global:
- HATCHET_RETRIES=3 - HATCHET_RETRIES=3
- IS_RUNNING_ON_CI=true - IS_RUNNING_ON_CI=true
+4
View File
@@ -3,6 +3,10 @@
## Unreleased ## Unreleased
## v183 (2020-10-12)
- Add support for Heroku-20 (#968).
## v182 (2020-10-06) ## v182 (2020-10-06)
- Python 3.9.0 is now available (CPython) (#1090). - Python 3.9.0 is now available (CPython) (#1090).
+3 -3
View File
@@ -9,11 +9,11 @@ GEM
excon excon
moneta moneta
multi_json (>= 1.9.2) multi_json (>= 1.9.2)
heroku_hatchet (7.3.0) heroku_hatchet (7.3.1)
excon (~> 0) excon (~> 0)
platform-api (~> 3) platform-api (~> 3)
rrrretry (~> 1) rrrretry (~> 1)
thor (~> 0) thor (~> 1)
threaded (~> 0) threaded (~> 0)
moneta (1.0.0) moneta (1.0.0)
multi_json (1.15.0) multi_json (1.15.0)
@@ -43,7 +43,7 @@ GEM
rspec-retry (0.6.2) rspec-retry (0.6.2)
rspec-core (> 3.3) rspec-core (> 3.3)
rspec-support (3.9.3) rspec-support (3.9.3)
thor (0.20.3) thor (1.0.1)
threaded (0.0.4) threaded (0.0.4)
PLATFORMS PLATFORMS
+4 -1
View File
@@ -21,8 +21,11 @@ source "$BIN_DIR/utils"
# If GDAL exists within requirements, use vendored gdal. # If GDAL exists within requirements, use vendored gdal.
if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
if [ ! -f ".heroku/vendor/bin/gdalserver" ]; then if [[ ! -f ".heroku/vendor/bin/gdalserver" && "${STACK}" == 'heroku-20' ]]; then
puts-warn "The buildpack's built-in GDAL functonality is not supported on Heroku-20."
puts-warn "Please use this buildpack instead: https://github.com/heroku/heroku-geo-buildpack"
elif [[ ! -f ".heroku/vendor/bin/gdalserver" ]]; then
puts-warn "The vendored GDAL package in the Heroku Python Buildpack now deprecated." puts-warn "The vendored GDAL package in the Heroku Python Buildpack now deprecated."
puts-warn "To enable GDAL use an alternative buildpack is available here - https://github.com/heroku/heroku-geo-buildpack" puts-warn "To enable GDAL use an alternative buildpack is available here - https://github.com/heroku/heroku-geo-buildpack"
+5 -2
View File
@@ -20,8 +20,11 @@ PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
# shellcheck source=bin/utils # shellcheck source=bin/utils
source "$BIN_DIR/utils" source "$BIN_DIR/utils"
# If GDAL exists within requirements, use vendored gdal. if [[ "$BUILD_WITH_GEO_LIBRARIES" && "${STACK}" == 'heroku-20' ]]; then
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then puts-warn "The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality is not supported on Heroku-20."
puts-warn "Please use this buildpack for GDAL, GEOS and PROJ: https://github.com/heroku/heroku-geo-buildpack"
puts-warn "To hide this message, unset the BUILD_WITH_GEO_LIBRARIES variable using: heroku config:unset BUILD_WITH_GEO_LIBRARIES"
elif [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
mcount "buildvar.BUILD_WITH_GEO_LIBRARIES" mcount "buildvar.BUILD_WITH_GEO_LIBRARIES"
puts-warn "The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated." puts-warn "The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated."
+20
View File
@@ -0,0 +1,20 @@
FROM heroku/heroku:20-build
ENV WORKSPACE_DIR="/app/builds" \
S3_BUCKET="heroku-buildpack-python" \
S3_PREFIX="heroku-20/" \
STACK="heroku-20"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
libsqlite3-dev \
python3-pip \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt /app/
RUN pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
COPY . /app
-1
View File
@@ -1 +0,0 @@
python-3.6.6
+1 -1
View File
@@ -6,4 +6,4 @@ verify_ssl = true
requests = "*" requests = "*"
[requires] [requires]
python_full_version = "3.6.3" python_full_version = "3.7.8"
+2 -15
View File
@@ -1,24 +1,11 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "22a052f4d1cfe6518b2f236fe45c3208c587a9ab1323bdd390632e27278b541e" "sha256": "8a36860f0f9cb55716222098062cea5c5e0f8127cafb9d0c694de327bac9fbc0"
},
"host-environment-markers": {
"implementation_name": "cpython",
"implementation_version": "3.6.3",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_python_implementation": "CPython",
"platform_release": "16.7.0",
"platform_system": "Darwin",
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
"python_full_version": "3.6.3",
"python_version": "3.6",
"sys_platform": "darwin"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
"python_full_version": "3.6.3" "python_full_version": "3.7.8"
}, },
"sources": [ "sources": [
{ {
+1 -1
View File
@@ -1 +1 @@
pypy2.7-7.2.0 pypy2.7-7.3.1
+1 -1
View File
@@ -1 +1 @@
pypy3.6-7.2.0 pypy3.6-7.3.1
-1
View File
@@ -1 +0,0 @@
requests
-1
View File
@@ -1 +0,0 @@
flask
-1
View File
@@ -1 +0,0 @@
flask
+1 -1
View File
@@ -1 +1 @@
python-3.6.8 python-3.6.12
-1
View File
@@ -1 +0,0 @@
requests
+1 -1
View File
@@ -1 +1 @@
python-3.6.7 python-3.6.11
+1 -1
View File
@@ -1 +1 @@
python-3.7.2 python-3.7.9
-1
View File
@@ -1 +0,0 @@
requests
+1 -1
View File
@@ -1 +1 @@
python-3.7.1 python-3.7.8
+1 -1
View File
@@ -1 +1 @@
python-3.8.2 python-3.8.6
-1
View File
@@ -1 +0,0 @@
requests
+1 -1
View File
@@ -1 +1 @@
python-3.8.0 python-3.8.5
-1
View File
@@ -1 +0,0 @@
flask
+12 -16
View File
@@ -21,16 +21,13 @@ testGEOS() {
local env_dir="$(mktmpdir)" local env_dir="$(mktmpdir)"
echo '1' > "${env_dir}/BUILD_WITH_GEO_LIBRARIES" echo '1' > "${env_dir}/BUILD_WITH_GEO_LIBRARIES"
compile 'geos' '' "${env_dir}" compile 'geos' '' "${env_dir}"
assertCaptured "geos" if [[ $STACK == "heroku-20" ]]; then
assertCapturedSuccess assertCaptured " ! The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality is not supported on Heroku-20."
} else
assertCaptured " ! The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated."
testGEOSDeprecation() { fi
local env_dir="$(mktmpdir)" # This should assertCapturedError on Heroku-20, but the test doesn't actually
echo '1' > "${env_dir}/BUILD_WITH_GEO_LIBRARIES" # install anything that uses GEOS so succeeds (see W-8145375)
compile 'geos' '' "${env_dir}"
assertCaptured " ! The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated.
! An alternative buildpack to enable GDAL, GEOS and PROJ use is available here - https://github.com/heroku/heroku-geo-buildpack"
assertCapturedSuccess assertCapturedSuccess
} }
@@ -55,17 +52,16 @@ testPsycopg2() {
} }
testPysqlite() { testPysqlite() {
# pysqlite does not support Python 3 (since the sqlite3 stdlib can be used there),
# so we have to test with Python 2, which we've not made available for Heroku-20.
if [[ $STACK == "heroku-20" ]]; then
return
fi
compile "pysqlite" compile "pysqlite"
assertCaptured "pysqlite" assertCaptured "pysqlite"
assertCapturedSuccess assertCapturedSuccess
} }
testSqliteInstall() {
compile "pythonDefault"
assertNotCaptured "Sqlite3 failed to install."
assertCapturedSuccess
}
testCffi() { testCffi() {
compile "cffi" compile "cffi"
assertCaptured "cffi" assertCaptured "cffi"
+15 -6
View File
@@ -59,24 +59,33 @@ testPipenvLock() {
assertCapturedSuccessWithStdErr assertCapturedSuccessWithStdErr
} }
testPipenvVersion() { testPipenvPythonVersion3_6() {
compile "pipenv-version" compile "pipenv-version"
assertCaptured $DEFAULT_PYTHON_VERSION assertCaptured "Installing ${LATEST_36}"
# Can't use `assertCapturedSuccess` since stderr contains: # Can't use `assertCapturedSuccess` since stderr contains:
# "cp: cannot stat '/tmp/build_*/requirements.txt': No such file or directory" (W-7924941) # "cp: cannot stat '/tmp/build_*/requirements.txt': No such file or directory" (W-7924941)
assertCapturedSuccessWithStdErr assertCapturedSuccessWithStdErr
} }
testPipenvVersion2() { testPipenvPythonVersion2_7() {
# Python 2.7 is EOL, so it has not been built for Heroku-20.
if [[ $STACK == "heroku-20" ]]; then
return
fi
compile "pipenv-version2" compile "pipenv-version2"
assertCaptured $LATEST_27 assertCaptured "Installing ${LATEST_27}"
# Can't use `assertCapturedSuccess` since stderr contains: # Can't use `assertCapturedSuccess` since stderr contains:
# "cp: cannot stat '/tmp/build_*/requirements.txt': No such file or directory" (W-7924941) # "cp: cannot stat '/tmp/build_*/requirements.txt': No such file or directory" (W-7924941)
assertCapturedSuccessWithStdErr assertCapturedSuccessWithStdErr
} }
testPipenvFullVersion() {
testPipenvPythonFullVersion() {
# Python 3.7+ requires newer libssl than is present on Cedar-14.
if [[ "${STACK}" = "cedar-14" ]]; then
return
fi
compile "pipenv-full-version" compile "pipenv-full-version"
assertCaptured "3.6.3" assertCaptured "3.7.8"
# Can't use `assertCapturedSuccess` since stderr contains: # Can't use `assertCapturedSuccess` since stderr contains:
# "cp: cannot stat '/tmp/build_*/requirements.txt': No such file or directory" (W-7924941) # "cp: cannot stat '/tmp/build_*/requirements.txt': No such file or directory" (W-7924941)
assertCapturedSuccessWithStdErr assertCapturedSuccessWithStdErr
+106 -93
View File
@@ -4,59 +4,78 @@
# shellcheck source=bin/default_pythons # shellcheck source=bin/default_pythons
source "bin/default_pythons" source "bin/default_pythons"
testPythonDefault() { testPythonVersionUnspecified() {
updateVersion "pythonDefault" $DEFAULT_PYTHON_VERSION compile "python_version_unspecified"
compile "pythonDefault" assertCaptured "Installing ${DEFAULT_PYTHON_VERSION}"
assertCaptured $DEFAULT_PYTHON_VERSION
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2" assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3" assertCaptured "Installing SQLite3"
assertCapturedSuccess assertCapturedSuccess
} }
testPython2() { testPython2_7() {
updateVersion "python2" $LATEST_27 # Python 2.7 is EOL, so it has not been built for Heroku-20.
echo $LATEST_27 > "runtime.txt" if [[ $STACK == "heroku-20" ]]; then
compile "python2" return
assertCaptured $LATEST_27 fi
assertCaptured "python-2-7-eol-faq"; compile "python2"
assertNotCaptured "security update" assertCaptured "Installing ${LATEST_27}"
assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2" assertCaptured "python-2-7-eol-faq";
assertCaptured "Installing SQLite3" assertNotCaptured "security update"
assertCapturedSuccess assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
} }
testPython2_warn() { testPython2_7_warn() {
compile "python2_warn" # Python 2.7 is EOL, so it has not been built for Heroku-20.
assertCaptured "python-2.7.15" if [[ $STACK == "heroku-20" ]]; then
assertCaptured "python-2-7-eol-faq"; return
assertCaptured "Only the latest version" fi
assertCaptured "Installing SQLite3" compile "python2_warn"
assertCapturedSuccess assertCaptured "Installing python-2.7.15"
assertCaptured "python-2-7-eol-faq";
assertCaptured "Only the latest version"
assertCaptured "${LATEST_27}"
assertCapturedSuccess
} }
testPython3_4() { testPython3_4() {
# Python 3.4 is EOL, so it has not been built for Heroku-20.
if [[ $STACK == "heroku-20" ]]; then
return
fi
compile "python3_4" compile "python3_4"
assertCaptured $LATEST_34 assertCaptured "Installing ${LATEST_34}"
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured "Installing pip 19.1.1, setuptools 43.0.0 and wheel 0.33.6" assertCaptured "Installing pip 19.1.1, setuptools 43.0.0 and wheel 0.33.6"
assertCaptured "Installing SQLite3"
# Can't use `assertCapturedSuccess` since Pip outputs a Python 3.4 EOL warning to stderr, # Can't use `assertCapturedSuccess` since Pip outputs a Python 3.4 EOL warning to stderr,
# and the newest Pip that works on Python 3.4 doesn't support `PIP_NO_PYTHON_VERSION_WARNING`. # and the newest Pip that works on Python 3.4 doesn't support `PIP_NO_PYTHON_VERSION_WARNING`.
assertCapturedSuccessWithStdErr assertCapturedSuccessWithStdErr
} }
testPython3_4_warn() { testPython3_4_warn() {
# Python 3.4 is EOL, so it has not been built for Heroku-20.
if [[ $STACK == "heroku-20" ]]; then
return
fi
compile "python3_4_warn" compile "python3_4_warn"
assertCaptured "python-3.4.9" assertCaptured "Installing python-3.4.9"
assertCaptured "security update!" assertCaptured "security update!"
assertCaptured "${LATEST_34}"
# Can't use `assertCapturedSuccess` since Pip outputs a Python 3.4 EOL warning to stderr, # Can't use `assertCapturedSuccess` since Pip outputs a Python 3.4 EOL warning to stderr,
# and the newest Pip that works on Python 3.4 doesn't support `PIP_NO_PYTHON_VERSION_WARNING`. # and the newest Pip that works on Python 3.4 doesn't support `PIP_NO_PYTHON_VERSION_WARNING`.
assertCapturedSuccessWithStdErr assertCapturedSuccessWithStdErr
} }
testPython3_5() { testPython3_5() {
# Python 3.5 is EOL, so it has not been built for Heroku-20.
if [[ $STACK == "heroku-20" ]]; then
return
fi
compile "python3_5" compile "python3_5"
assertCaptured $LATEST_35 assertCaptured "Installing ${LATEST_35}"
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2" assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3" assertCaptured "Installing SQLite3"
@@ -64,16 +83,20 @@ testPython3_5() {
} }
testPython3_5_warn() { testPython3_5_warn() {
# Python 3.5 is EOL, so it has not been built for Heroku-20.
if [[ $STACK == "heroku-20" ]]; then
return
fi
compile "python3_5_warn" compile "python3_5_warn"
assertCaptured "python-3.5.6" assertCaptured "Installing python-3.5.6"
assertCaptured "security update!" assertCaptured "security update!"
assertCaptured "${LATEST_35}"
assertCapturedSuccess assertCapturedSuccess
} }
testPython3_6() { testPython3_6() {
updateVersion "python3_6" $LATEST_36
compile "python3_6" compile "python3_6"
assertCaptured $LATEST_36 assertCaptured "Installing ${LATEST_36}"
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2" assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3" assertCaptured "Installing SQLite3"
@@ -82,62 +105,60 @@ testPython3_6() {
testPython3_6_warn() { testPython3_6_warn() {
compile "python3_6_warn" compile "python3_6_warn"
assertCaptured "python-3.6.7" assertCaptured "Installing python-3.6.11"
assertCaptured "security update!" assertCaptured "security update!"
assertCaptured "Installing SQLite3" assertCaptured "${LATEST_36}"
assertCapturedSuccess assertCapturedSuccess
} }
testPython3_7() { testPython3_7() {
updateVersion "python3_7" $LATEST_37 # Python 3.7+ requires newer libssl than is present on Cedar-14.
compile "python3_7" if [[ "${STACK}" = "cedar-14" ]]; then
if [[ $STACK = "cedar-14" ]]; then return
assertCapturedError
else
assertNotCaptured "security update"
assertCaptured $LATEST_37
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
fi fi
compile "python3_7"
assertCaptured "Installing ${LATEST_37}"
assertNotCaptured "security update"
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
} }
testPython3_7_warn() { testPython3_7_warn() {
compile "python3_7_warn" # Python 3.7+ requires newer libssl than is present on Cedar-14.
if [[ $STACK = "cedar-14" ]]; then if [[ "${STACK}" = "cedar-14" ]]; then
assertCapturedError return
else
assertCaptured "python-3.7.1"
assertCaptured "security update!"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
fi fi
compile "python3_7_warn"
assertCaptured "Installing python-3.7.8"
assertCaptured "security update!"
assertCaptured "${LATEST_37}"
assertCapturedSuccess
} }
testPython3_8() { testPython3_8() {
updateVersion "python3_8" $LATEST_38 # Python 3.7+ requires newer libssl than is present on Cedar-14.
compile "python3_8" if [[ "${STACK}" = "cedar-14" ]]; then
if [[ $STACK = "cedar-14" ]]; then return
assertCapturedError
else
assertNotCaptured "security update"
assertCaptured $LATEST_38
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
fi fi
compile "python3_8"
assertCaptured "Installing ${LATEST_38}"
assertNotCaptured "security update"
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
} }
testPython3_8_warn() { testPython3_8_warn() {
compile "python3_8_warn" # Python 3.7+ requires newer libssl than is present on Cedar-14.
if [[ $STACK = "cedar-14" ]]; then if [[ "${STACK}" = "cedar-14" ]]; then
assertCapturedError return
else
assertCaptured "python-3.8.0"
assertCaptured "security update!"
assertCaptured "Installing SQLite3"
assertCapturedSuccess
fi fi
compile "python3_8_warn"
assertCaptured "Installing python-3.8.5"
assertCaptured "security update!"
assertCaptured "${LATEST_38}"
assertCapturedSuccess
} }
testPython3_9() { testPython3_9() {
@@ -146,8 +167,8 @@ testPython3_9() {
return return
fi fi
compile "python3_9" compile "python3_9"
assertCaptured "Installing ${LATEST_39}"
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured $LATEST_39
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2" assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCaptured "Installing SQLite3" assertCaptured "Installing SQLite3"
assertCapturedSuccess assertCapturedSuccess
@@ -163,8 +184,9 @@ testPython3_9_warn() {
return return
fi fi
compile "python3_9_warn" compile "python3_9_warn"
assertCaptured "python-3.9.0" assertCaptured "Installing python-3.9.0"
assertCaptured "security update!" assertCaptured "security update!"
assertCaptured "${LATEST_39}"
assertCapturedSuccess assertCapturedSuccess
} }
@@ -177,67 +199,58 @@ testPythonVersionInvalid() {
testPypy3_6() { testPypy3_6() {
compile "pypy3_6" compile "pypy3_6"
assertCaptured "Installing pypy" assertCaptured "Installing ${LATEST_PYPY_36}"
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured "$LATEST_PYPY_36"
assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2" assertCaptured "Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2"
assertCapturedSuccess assertCapturedSuccess
} }
testPypy3_6_warn() { testPypy3_6_warn() {
compile "pypy3_6_warn" compile "pypy3_6_warn"
if [[ $STACK = "cedar-14" ]]; then assertCaptured "Installing pypy3.6-7.3.1"
assertCapturedError assertCaptured "security update!"
else assertCaptured "${LATEST_PYPY_36}"
assertCaptured "Installing pypy" assertCapturedSuccess
assertCaptured "security update!"
assertCaptured "$LATEST_PYPY_36"
assertCapturedSuccess
fi
} }
testPypy2_7() { testPypy2_7() {
compile "pypy2_7" compile "pypy2_7"
assertCaptured "Installing pypy" assertCaptured "Installing ${LATEST_PYPY_27}"
assertNotCaptured "security update" assertNotCaptured "security update"
assertCaptured "$LATEST_PYPY_27"
assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2" assertCaptured "Installing pip 20.1.1, setuptools 44.1.1 and wheel 0.34.2"
assertCapturedSuccess assertCapturedSuccess
} }
testPypy2_7_warn() { testPypy2_7_warn() {
compile "pypy2_7_warn" compile "pypy2_7_warn"
if [[ $STACK = "cedar-14" ]]; then assertCaptured "Installing pypy2.7-7.3.1"
assertCapturedError assertCaptured "security update!"
else assertCaptured "${LATEST_PYPY_27}"
assertCaptured "Installing pypy" assertCapturedSuccess
assertCaptured "security update!"
assertCaptured "$LATEST_PYPY_27"
assertCapturedSuccess
fi
} }
testStickyPythonVersion() { testStickyPythonVersion() {
local cache_dir="$(mktmpdir)" local cache_dir="$(mktmpdir)"
compile "python3_6_warn" "$cache_dir" compile "python3_6_warn" "$cache_dir"
assertCaptured "Installing python-3.6.7" assertCaptured "Installing python-3.6.11"
assertCapturedSuccess assertCapturedSuccess
compile "no-runtime-txt" "$cache_dir" compile "python_version_unspecified" "$cache_dir"
assertCaptured "Installing python-3.6.7" assertNotCaptured "Installing python"
assertCaptured "security update!"
assertCapturedSuccess assertCapturedSuccess
# Whilst this file seems like an implementation detail (so something that should # Whilst this file seems like an implementation detail (so something that should
# not be tested), we must guarantee the filename remains consistent for backwards # not be tested), we must guarantee the filename remains consistent for backwards
# compatibility across buildpack versions for already-built apps. # compatibility across buildpack versions for already-built apps.
assertFile "python-3.6.7" ".heroku/python-version" assertFile "python-3.6.11" ".heroku/python-version"
} }
testPythonVersionChange() { testPythonVersionChange() {
local cache_dir="$(mktmpdir)" local cache_dir="$(mktmpdir)"
compile "python3_6_warn" "$cache_dir" compile "python3_6_warn" "$cache_dir"
assertCaptured "Installing python-3.6.7" assertCaptured "Installing python-3.6.11"
assertCapturedSuccess assertCapturedSuccess
compile "python3_6" "$cache_dir" compile "python3_6" "$cache_dir"
assertCaptured "Found python-3.6.7, removing" assertCaptured "Found python-3.6.11, removing"
assertCapturedSuccess assertCapturedSuccess
} }
-5
View File
@@ -56,11 +56,6 @@ resetCapture()
unset rtrn # deprecated unset rtrn # deprecated
} }
updateVersion()
{
echo "$2" > "test/fixtures/${1}/runtime.txt"
}
assertCapturedEquals() assertCapturedEquals()
{ {
assertEquals "$@" "$(cat ${STD_OUT})" assertEquals "$@" "$(cat ${STD_OUT})"