From 521ed3ff60c61949fc1983131bc81e95305d64a3 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 14:07:09 -0700 Subject: [PATCH 01/11] create and stage new python runtimes --- CHANGELOG.md | 1 + builds/runtimes/python-3.7.5 | 4 ++++ builds/runtimes/python-3.8.0 | 4 ++++ 3 files changed, 9 insertions(+) create mode 100755 builds/runtimes/python-3.7.5 create mode 100755 builds/runtimes/python-3.8.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index e2265d6..9582c69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # Master +- Python 3.7.5 and 3.8.0 now available on Heroku 18 and 16. - Sqlite3 Update: - Add Tests - Test for Pysqlite diff --git a/builds/runtimes/python-3.7.5 b/builds/runtimes/python-3.7.5 new file mode 100755 index 0000000..ad41723 --- /dev/null +++ b/builds/runtimes/python-3.7.5 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +source $(dirname $0)/python3 diff --git a/builds/runtimes/python-3.8.0 b/builds/runtimes/python-3.8.0 new file mode 100755 index 0000000..ad41723 --- /dev/null +++ b/builds/runtimes/python-3.8.0 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +source $(dirname $0)/python3 From 9a830367fe3fc963fa199a21fecf293c7aa7a5f0 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 14:59:26 -0700 Subject: [PATCH 02/11] add 3.8 support --- CHANGELOG.md | 1 + bin/compile | 1 + bin/default_pythons | 5 +++-- bin/steps/python | 8 ++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2265d6..d54db85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # Master +- Add support for Python 3.8 branch - Sqlite3 Update: - Add Tests - Test for Pysqlite diff --git a/bin/compile b/bin/compile index 284b313..9319463 100755 --- a/bin/compile +++ b/bin/compile @@ -52,6 +52,7 @@ export VENDOR_URL source "$BIN_DIR/default_pythons" # Supported Python Branches +PY38="python-3.8" PY37="python-3.7" PY36="python-3.6" PY35="python-3.5" diff --git a/bin/default_pythons b/bin/default_pythons index e0f443f..ecc569c 100755 --- a/bin/default_pythons +++ b/bin/default_pythons @@ -1,10 +1,11 @@ #!/usr/bin/env bash DEFAULT_PYTHON_VERSION="python-3.6.9" +LATEST_38="python-3.8.0" +LATEST_37="python-3.7.5" LATEST_36="python-3.6.9" -LATEST_37="python-3.7.4" LATEST_35="python-3.5.7" LATEST_34="python-3.4.10" LATEST_27="python-2.7.16" -export DEFAULT_PYTHON_VERSION LATEST_37 LATEST_36 LATEST_35 LATEST_34 LATEST_27 +export DEFAULT_PYTHON_VERSION LATEST_38 LATEST_37 LATEST_36 LATEST_35 LATEST_34 LATEST_27 diff --git a/bin/steps/python b/bin/steps/python index 2d00754..8b553d5 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -10,6 +10,14 @@ VENDORED_PYTHON="${VENDOR_URL}/runtimes/$PYTHON_VERSION.tar.gz" SECURITY_UPDATE="Python has released a security update! Please consider upgrading to" # check if runtime exists +if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then + if [[ "$PYTHON_VERSION" == $PY38* ]]; then + # do things to alert the user of security release available + if [ "$PYTHON_VERSION" != "$LATEST_38" ]; then + puts-warn "$SECURITY_UPDATE" "$LATEST_38" + echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" + fi + fi if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then if [[ "$PYTHON_VERSION" == $PY37* ]]; then # do things to alert the user of security release available From 7ff7fa44629a03f7e3f7280cac609eadde260cc6 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 15:01:32 -0700 Subject: [PATCH 03/11] add 3.8 tests --- test/fixtures/python3_8/requirements.txt | 1 + test/fixtures/python3_8/runtime.txt | 1 + test/fixtures/python3_8_fail/requirements.txt | 1 + test/fixtures/python3_8_fail/runtime.txt | 1 + test/run-versions | 19 +++++++++++++++++++ 5 files changed, 23 insertions(+) create mode 100644 test/fixtures/python3_8/requirements.txt create mode 100644 test/fixtures/python3_8/runtime.txt create mode 100644 test/fixtures/python3_8_fail/requirements.txt create mode 100644 test/fixtures/python3_8_fail/runtime.txt diff --git a/test/fixtures/python3_8/requirements.txt b/test/fixtures/python3_8/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/test/fixtures/python3_8/requirements.txt @@ -0,0 +1 @@ +requests diff --git a/test/fixtures/python3_8/runtime.txt b/test/fixtures/python3_8/runtime.txt new file mode 100644 index 0000000..73b1cf8 --- /dev/null +++ b/test/fixtures/python3_8/runtime.txt @@ -0,0 +1 @@ +python-3.8.0 diff --git a/test/fixtures/python3_8_fail/requirements.txt b/test/fixtures/python3_8_fail/requirements.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/test/fixtures/python3_8_fail/requirements.txt @@ -0,0 +1 @@ +flask diff --git a/test/fixtures/python3_8_fail/runtime.txt b/test/fixtures/python3_8_fail/runtime.txt new file mode 100644 index 0000000..fbcec36 --- /dev/null +++ b/test/fixtures/python3_8_fail/runtime.txt @@ -0,0 +1 @@ +python-3.8.99 diff --git a/test/run-versions b/test/run-versions index 6feb5e1..15c7e38 100755 --- a/test/run-versions +++ b/test/run-versions @@ -146,6 +146,25 @@ testPython3_7_fail() { assertCapturedError } +testPython3_8() { + updateVersion "python3_8" $LATEST_38 + compile "python3_8" + if [[ $STACK = "cedar-14" ]]; then + assertCapturedError + else + assertNotCaptured "security update" + assertCaptured $LATEST_38 + assertCaptured "Installing SQLite3" + assertCapturedSuccess + fi +} + +testPython3_8_fail() { + compile "python3_8_fail" + assertCaptured "Aborting" + assertCapturedError +} + pushd $(dirname 0) >/dev/null popd >/dev/null From 33cd4a5fe19a5dd8354b094e7a517e4e71cc2dc0 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 16:09:27 -0700 Subject: [PATCH 04/11] remove copy-paste typo --- bin/steps/python | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/steps/python b/bin/steps/python index 8b553d5..2625b44 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -18,7 +18,6 @@ if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" fi fi -if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then if [[ "$PYTHON_VERSION" == $PY37* ]]; then # do things to alert the user of security release available if [ "$PYTHON_VERSION" != "$LATEST_37" ]; then From 0fc7b6c186faa662bd4c68f27d7aee39e03d905d Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 16:34:44 -0700 Subject: [PATCH 05/11] bump the warning version to an available version --- test/fixtures/python3_4_warn/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/python3_4_warn/runtime.txt b/test/fixtures/python3_4_warn/runtime.txt index fe5dcf7..cc8325f 100644 --- a/test/fixtures/python3_4_warn/runtime.txt +++ b/test/fixtures/python3_4_warn/runtime.txt @@ -1 +1 @@ -python-3.4.0 +python-3.4.9 From af1ef93311f4082ddf7e58c8c5cc6a3ea9cd67f8 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 16:35:57 -0700 Subject: [PATCH 06/11] CHANGELOG CHANGELOG CHANGELOG --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2265d6..da779d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,7 @@ # Master - Sqlite3 Update: - - Add Tests - - Test for Pysqlite + - Test improvements - Bug fix: pipenv no longer installs twice on CI - Add support for staging binary testing -------------------------------------------------------------------------------- From 34508bfc3513f2b2dc0f8adb97cb0b61a155a4a4 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 16:44:58 -0700 Subject: [PATCH 07/11] Temporarily Revert "Fix pipenv install twice in CI" This reverts commit c410fd36a66e74d9b159b98c0dc8d6cc616e5c01. This is a temporary revert in order to release new python binaries first and then roll this change out in a separate release. This keeps releases smaller and better organized in case we need to roll back. --- bin/steps/pipenv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/steps/pipenv b/bin/steps/pipenv index c799c7d..a84d549 100755 --- a/bin/steps/pipenv +++ b/bin/steps/pipenv @@ -60,16 +60,10 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then # avoid this eager behavior. /app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade --upgrade-strategy only-if-needed &> /dev/null - # Install the test dependencies, for CI. - if [ "$INSTALL_TEST" ]; then - puts-step "Installing test dependencies…" - /app/.heroku/python/bin/pipenv install --dev --system --deploy 2>&1 | cleanup | indent - # Install the dependencies. - elif [[ ! -f Pipfile.lock ]]; then + if [[ ! -f Pipfile.lock ]]; then puts-step "Installing dependencies with Pipenv $PIPENV_VERSION…" /app/.heroku/python/bin/pipenv install --system --skip-lock 2>&1 | indent - else pipenv-to-pip Pipfile.lock > requirements.txt "$BIN_DIR/steps/pip-uninstall" @@ -79,6 +73,12 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then puts-step "Installing dependencies with Pipenv $PIPENV_VERSION…" /app/.heroku/python/bin/pipenv install --system --deploy 2>&1 | indent fi + + # Install the test dependencies, for CI. + if [ "$INSTALL_TEST" ]; then + puts-step "Installing test dependencies…" + /app/.heroku/python/bin/pipenv install --dev --system --deploy 2>&1 | cleanup | indent + fi fi else export SKIP_PIP_INSTALL=1 From ec56074c18647e912dcd614dfbab503882e46bff Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 17 Oct 2019 16:49:31 -0700 Subject: [PATCH 08/11] CHANGELOG --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2265d6..20228cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ - Sqlite3 Update: - Add Tests - Test for Pysqlite -- Bug fix: pipenv no longer installs twice on CI - Add support for staging binary testing -------------------------------------------------------------------------------- From 0b804b186c0cff2d3dcf9c3ca02d170737f0fcfc Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Fri, 18 Oct 2019 08:53:40 -0700 Subject: [PATCH 09/11] correct the capture version too --- test/run-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run-versions b/test/run-versions index 6feb5e1..5c67ac6 100755 --- a/test/run-versions +++ b/test/run-versions @@ -50,7 +50,7 @@ testPython3_4() { testPython3_4_warn() { compile "python3_4_warn" if [[ $STACK = "cedar-14" ]]; then - assertCaptured "python-3.4.0" + assertCaptured "python-3.4.9" assertCaptured "security update!" assertCapturedSuccess else From 011f1e7e606f99c8c1abe41580bba358ed62fd99 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Fri, 18 Oct 2019 09:57:09 -0700 Subject: [PATCH 10/11] wardn case should succeed on all stacks --- test/run-versions | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/run-versions b/test/run-versions index 5c67ac6..58c1004 100755 --- a/test/run-versions +++ b/test/run-versions @@ -49,13 +49,9 @@ testPython3_4() { testPython3_4_warn() { compile "python3_4_warn" - if [[ $STACK = "cedar-14" ]]; then - assertCaptured "python-3.4.9" - assertCaptured "security update!" - assertCapturedSuccess - else - assertCapturedError - fi + assertCaptured "python-3.4.9" + assertCaptured "security update!" + assertCapturedSuccess } testPython3_4_fail() { From 99a2a55f6a2794bca49b2ea47809b91391c2bd73 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Mon, 21 Oct 2019 14:19:53 -0700 Subject: [PATCH 11/11] update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19c6060..83ff428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,14 @@ # Master +-------------------------------------------------------------------------------- +# 158 (2019-10-21) + - Python 3.7.5 and 3.8.0 now available on Heroku 18 and 16. - Add support for Python 3.8 branch - Sqlite3 Update: - Test Improvements - Add support for staging binary testing --------------------------------------------------------------------------------- # 157 (2019-09-18)