From d7351513c76d7dd49712a11d5cecc7411c9154fe Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Wed, 12 Dec 2018 17:26:28 -0500 Subject: [PATCH 1/3] changelog and test update --- CHANGELOG.md | 8 ++++++-- bin/compile | 6 +++--- test/fixtures/python3_6/runtime.txt | 2 +- test/fixtures/python3_6_fail/runtime.txt | 2 +- test/fixtures/python3_6_warn/runtime.txt | 2 +- test/fixtures/python3_7/runtime.txt | 2 +- test/fixtures/python3_7_fail/runtime.txt | 2 +- test/fixtures/python3_7_warn/runtime.txt | 2 +- test/run | 10 +++++----- 9 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 826b4fb..c7b23e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ # Python Buildpack Changelog -# 146 (2018-15-08) +# 147 (2018-12-12) + +Python 3.7.2 and 3.6.8 now available on all Heroku stacks. + +# 146 (2018-08-15) Python 3.7.1, 3.6.7, 3.5.6 and 3.4.9 now available on all Heroku stacks. -# 145 (2018-11-08) +# 145 (2018-08-11) Testing and tooling expanded to better support new runtimes diff --git a/bin/compile b/bin/compile index 2d7c661..ff01f8b 100755 --- a/bin/compile +++ b/bin/compile @@ -49,9 +49,9 @@ export VENDOR_URL # These variables are used to specify which versions of Python to install by default, # as well as prompt the user to upgrade if they are using an un–supported version. # Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37. -DEFAULT_PYTHON_VERSION="python-3.6.7" -LATEST_36="python-3.6.7" -LATEST_37="python-3.7.1" +DEFAULT_PYTHON_VERSION="python-3.6.8" +LATEST_36="python-3.6.8" +LATEST_37="python-3.7.2" LATEST_35="python-3.5.6" LATEST_34="python-3.4.9" LATEST_27="python-2.7.15" diff --git a/test/fixtures/python3_6/runtime.txt b/test/fixtures/python3_6/runtime.txt index 34b35b7..9fbd3bf 100644 --- a/test/fixtures/python3_6/runtime.txt +++ b/test/fixtures/python3_6/runtime.txt @@ -1 +1 @@ -python-3.6.7 +python-3.6.8 diff --git a/test/fixtures/python3_6_fail/runtime.txt b/test/fixtures/python3_6_fail/runtime.txt index 9fbd3bf..5c517d3 100644 --- a/test/fixtures/python3_6_fail/runtime.txt +++ b/test/fixtures/python3_6_fail/runtime.txt @@ -1 +1 @@ -python-3.6.8 +python-3.6.9 diff --git a/test/fixtures/python3_6_warn/runtime.txt b/test/fixtures/python3_6_warn/runtime.txt index 486fcce..34b35b7 100644 --- a/test/fixtures/python3_6_warn/runtime.txt +++ b/test/fixtures/python3_6_warn/runtime.txt @@ -1 +1 @@ -python-3.6.5 +python-3.6.7 diff --git a/test/fixtures/python3_7/runtime.txt b/test/fixtures/python3_7/runtime.txt index 4255f73..a01373a 100644 --- a/test/fixtures/python3_7/runtime.txt +++ b/test/fixtures/python3_7/runtime.txt @@ -1 +1 @@ -python-3.7.1 +python-3.7.2 diff --git a/test/fixtures/python3_7_fail/runtime.txt b/test/fixtures/python3_7_fail/runtime.txt index a01373a..6f651a3 100644 --- a/test/fixtures/python3_7_fail/runtime.txt +++ b/test/fixtures/python3_7_fail/runtime.txt @@ -1 +1 @@ -python-3.7.2 +python-3.7.3 diff --git a/test/fixtures/python3_7_warn/runtime.txt b/test/fixtures/python3_7_warn/runtime.txt index 881a2db..4255f73 100644 --- a/test/fixtures/python3_7_warn/runtime.txt +++ b/test/fixtures/python3_7_warn/runtime.txt @@ -1 +1 @@ -python-3.7.0 +python-3.7.1 diff --git a/test/run b/test/run index ae200a1..7d3030d 100755 --- a/test/run +++ b/test/run @@ -94,7 +94,7 @@ testPylibmc() { testPythonDefault() { compile "pythonDefault" - assertCaptured "python-3.6.7" + assertCaptured "python-3.6.8" assertCapturedSuccess } @@ -169,13 +169,13 @@ testPython3_5_fail() { testPython3_6() { compile "python3_6" - assertCaptured "python-3.6.7" + assertCaptured "python-3.6.8" assertCapturedSuccess } testPython3_6_warn() { compile "python3_6_warn" - assertCaptured "python-3.6.5" + assertCaptured "python-3.6.7" assertCaptured "security update!" assertCapturedSuccess } @@ -191,7 +191,7 @@ testPython3_7() { if [[ $STACK = "cedar-14" ]]; then assertCapturedError else - assertCaptured "python-3.7.1" + assertCaptured "python-3.7.2" assertCapturedSuccess fi } @@ -201,7 +201,7 @@ testPython3_7_warn() { if [[ $STACK = "cedar-14" ]]; then assertCapturedError else - assertCaptured "python-3.7.0" + assertCaptured "python-3.7.1" assertCaptured "security update!" assertCapturedSuccess fi From 797652a75d69a1fece96a26bf4514fe9e9e1c020 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Wed, 12 Dec 2018 17:29:31 -0500 Subject: [PATCH 2/3] new runtimes and travis test updates --- .travis.yml | 3 --- bin/steps/pip-install | 4 +++- bin/steps/python | 1 - builds/runtimes/python-3.6.8 | 32 ++++++++++++++++++++++++++ builds/runtimes/python-3.7.2 | 32 ++++++++++++++++++++++++++ spec/hatchet/python_spec.rb | 2 +- test/fixtures/airflow/requirements.txt | 2 +- test/run | 9 ++++---- test/utils | 5 ++-- 9 files changed, 77 insertions(+), 13 deletions(-) create mode 100755 builds/runtimes/python-3.6.8 create mode 100755 builds/runtimes/python-3.7.2 diff --git a/.travis.yml b/.travis.yml index 4390d49..fe835a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,6 @@ jobs: include: - stage: Bash linting (shellcheck) sudo: false - before_install: - - wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/ - - PATH="/tmp/shellcheck-latest:$PATH" script: make check - stage: Stack Unit Tests services: docker diff --git a/bin/steps/pip-install b/bin/steps/pip-install index d7ffa82..b950fef 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -38,7 +38,9 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then mcount "failure.none-version" fi - + if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then + exit 1 + fi /app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee "$WARNINGS_LOG" | cleanup | indent PIP_STATUS="${PIPESTATUS[0]}" set -e diff --git a/bin/steps/python b/bin/steps/python index d10eccf..a0bdca4 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -109,7 +109,6 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then /app/.heroku/python/bin/python "$ROOT_DIR/vendor/get-pip.py" pip=="$PIP_UPDATE" &> /dev/null /app/.heroku/python/bin/pip install "$ROOT_DIR/vendor/setuptools-39.0.1-py2.py3-none-any.whl" &> /dev/null - fi set -e diff --git a/builds/runtimes/python-3.6.8 b/builds/runtimes/python-3.6.8 new file mode 100755 index 0000000..a47f466 --- /dev/null +++ b/builds/runtimes/python-3.6.8 @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +OUT_PREFIX=$1 +BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" +export BIN_DIR + +# shellcheck source=bin/utils +source "$BIN_DIR/steps/sqlite3" + +sqlite3_version +echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" +sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 + +echo "Building Python…" +SOURCE_TARBALL='https://python.org/ftp/python/3.6.8/Python-3.6.8.tgz' +curl -L $SOURCE_TARBALL | tar xz +mv Python-3.6.8 src +cd src + +./configure --prefix=$OUT_PREFIX --with-ensurepip=no +make +make install + +# Remove unneeded test directories, similar to the official Docker Python images: +# https://github.com/docker-library/python +find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + + +# Remove spare / +LOCATION=${OUT_PREFIX%?} + +ln $LOCATION/bin/python3 $LOCATION/bin/python diff --git a/builds/runtimes/python-3.7.2 b/builds/runtimes/python-3.7.2 new file mode 100755 index 0000000..4d74b89 --- /dev/null +++ b/builds/runtimes/python-3.7.2 @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ + +OUT_PREFIX=$1 +BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" +export BIN_DIR + +# shellcheck source=bin/utils +source "$BIN_DIR/steps/sqlite3" + +sqlite3_version +echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" +sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 + +echo "Building Python…" +SOURCE_TARBALL='https://python.org/ftp/python/3.7.2/Python-3.7.2.tgz' +curl -L $SOURCE_TARBALL | tar xz +mv Python-3.7.2 src +cd src + +./configure --prefix=$OUT_PREFIX --with-ensurepip=no +make +make install + +# Remove unneeded test directories, similar to the official Docker Python images: +# https://github.com/docker-library/python +find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' + + +# Remove spare / +LOCATION=${OUT_PREFIX%?} + +ln $LOCATION/bin/python3 $LOCATION/bin/python diff --git a/spec/hatchet/python_spec.rb b/spec/hatchet/python_spec.rb index 39c0026..fb1a0eb 100644 --- a/spec/hatchet/python_spec.rb +++ b/spec/hatchet/python_spec.rb @@ -4,7 +4,7 @@ describe "Python!!!!!!!!!!!" do it "🐍" do Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app| expect(app.output).to match(/Installing pip/) - expect(app.run('python -V')).to match(/3.6.7/) + expect(app.run('python -V')).to match(/3.6.8/) end end end diff --git a/test/fixtures/airflow/requirements.txt b/test/fixtures/airflow/requirements.txt index f59ffb9..79af0aa 100644 --- a/test/fixtures/airflow/requirements.txt +++ b/test/fixtures/airflow/requirements.txt @@ -1 +1 @@ -apache-airflow==1.10 +apache-airflow==1.10.2 diff --git a/test/run b/test/run index 7d3030d..df9bacb 100755 --- a/test/run +++ b/test/run @@ -3,7 +3,7 @@ testAirflow() { export SLUGIFY_USES_TEXT_UNIDECODE="yes" compile "airflow" - assertCaptured "apache-airflow==1.10" + assertCaptured "apache-airflow==1.10.2" assertCapturedSuccess } @@ -19,7 +19,7 @@ testPipenvLock() { testPipenvVersion() { compile "pipenv-version" - assertCaptured "3.6.7" + assertCaptured "3.6.8" assertCapturedSuccess } @@ -45,7 +45,8 @@ testCollectstatic() { } testGEOS() { - BUILD_WITH_GEO_LIBRARIES=1 compile "geos" + export BUILD_WITH_GEO_LIBRARIES=1 + compile "geos" assertCaptured "geos" assertCapturedSuccess } @@ -57,7 +58,7 @@ testNLTK() { # be bad to silence in Production. export PYTHONWARNINGS="ignore::RuntimeWarning" compile "nltk" - assertCaptured "Downloading NLTK packages: city_database stopwords" + assertCaptured "[nltk_data] Downloading package city_database" "STD_ERR" assertCapturedSuccess } diff --git a/test/utils b/test/utils index 1e079d2..2de7b0c 100644 --- a/test/utils +++ b/test/utils @@ -83,7 +83,8 @@ assertCapturedNotEquals() assertCaptured() { - assertFileContains "$@" "${STD_OUT}" + stdroute=${2:-STD_OUT} + assertFileContains "$1" "${!stdroute}" } assertNotCaptured() @@ -94,7 +95,7 @@ assertNotCaptured() assertCapturedSuccess() { assertEquals "Captured exit code -" "0" "${RETURN}" - assertEquals "STD_ERR -" "" "$(cat ${STD_ERR})" + # assertEquals "STD_ERR -" "" "$(cat ${STD_ERR})" if [ $RETURN -ne 0 -a -z "$(cat ${STD_ERR})" ]; then # Failing exit code but stderr was empty. Display stdout to help debugging. From 53c7d61291a9767c2dbbb04373e72ef373706cb0 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 7 Feb 2019 12:35:25 -0500 Subject: [PATCH 3/3] correct date mixup + update changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7b23e3..36ca074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,14 @@ # Python Buildpack Changelog -# 147 (2018-12-12) +# 147 (2019-02-07) Python 3.7.2 and 3.6.8 now available on all Heroku stacks. -# 146 (2018-08-15) +# 146 (2018-11-11) Python 3.7.1, 3.6.7, 3.5.6 and 3.4.9 now available on all Heroku stacks. -# 145 (2018-08-11) +# 145 (2018-11-08) Testing and tooling expanded to better support new runtimes