Compare commits

...

15 Commits

Author SHA1 Message Date
Ian Stapleton Cordasco 83d5d6caa9 Merge pull request #722 from heroku/python-3.7-and-3.6.6
Build Python 3.6.6 and 3.7.0
2018-06-28 11:09:23 -05:00
Ian Stapleton Cordasco abade31848 Update defaults for Python 3 apps on Heroku
Also update our documentation and CHANGELOG for this version of the
buildpack.
2018-06-28 10:57:13 -05:00
Ian Stapleton Cordasco 9a3c1fab04 Build Python 3.6.6 and 3.7.0
Add runtime build recipes for our newly released versions

Closes gh-720
Closes gh-721
2018-06-28 08:33:50 -05:00
Ian Stapleton Cordasco d18f1fedd8 Merge pull request #710 from KevinBrolly/master
Updated README for python 3.6.5 and CHANGELOG for v135
2018-06-12 08:19:20 -05:00
Kevin Brolly d9a963c8b2 Updated README for python 3.6.5 and CHANGELOG for v135 2018-06-08 12:14:55 -07:00
Ian Stapleton Cordasco dbeca147d2 Merge pull request #701 from allyjweir/bump-pipenv-version
Bump pipenv version
2018-05-29 07:11:12 -05:00
Ian Stapleton Cordasco ca41bc87d3 Merge branch 'master' into bump-pipenv-version 2018-05-25 12:56:58 -05:00
Ian Stapleton Cordasco e717d0a60b Merge pull request #703 from heroku/fix-new-shellcheck-warnings
Fix new shellcheck warnings breaking periodic CI
2018-05-25 12:56:43 -05:00
Ian Stapleton Cordasco f0081e6faf Fix new shellcheck warnings breaking periodic CI
New warnings were found in our periodic (CRON) CI jobs.

Fixes https://travis-ci.org/heroku/heroku-buildpack-python/jobs/383404864
2018-05-25 12:16:47 -05:00
Ally Weir 57ec0c38ae Fix shellcheck linting issues 2018-05-24 14:38:14 +01:00
Ally Weir f1e1df2fa1 Bump pipenv version 2018-05-24 11:37:01 +01:00
Ian Stapleton Cordasco b0f49570d4 Merge pull request #699 from heroku/reenable-shellcheck
Let's test re-enabling shellcheck in CI
2018-05-18 08:39:52 -05:00
Ian Stapleton Cordasco f072b73093 Fix-up SC2219 errors in our shell scripts
Caught these with the re-added shellcheck linting.
2018-05-10 08:32:24 -05:00
Ian Stapleton Cordasco f174d03f7d Let's test re-enabling shellcheck in CI
shellcheck is a truly valuable utility. Unfortunately installing the
packages from debian-sid introduces a conflict. Let's try another
suggestion from: https://github.com/koalaman/shellcheck/wiki/TravisCI

Refs
https://github.com/heroku/heroku-buildpack-python/commit/a0275888a26b8f0132c7bb9fe3bf194b5c4fab1f
2018-05-10 08:16:36 -05:00
Pradeep Damodara af7332b5b2 Update pipenv-to-pip to read lockfiles properly
Use the appropriate encoding to read a Pipfile.lock so we can
properly load the data.

Closes #678
2018-05-07 14:47:45 -05:00
13 changed files with 87 additions and 50 deletions
+6 -9
View File
@@ -2,15 +2,12 @@ language: bash
dist: trusty dist: trusty
jobs: jobs:
include: include:
# - stage: "Bash linting (shellcheck)" - stage: "Bash linting (shellcheck)"
# sudo: false sudo: false
# addons: before_install:
# apt: - wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/
# sources: - PATH="/tmp/shellcheck-latest:$PATH"
# - debian-sid # Grab shellcheck from the Debian repo (o_O) script: make check
# packages:
# - shellcheck
# script: make check
- stage: "Stack Tests" - stage: "Stack Tests"
services: docker services: docker
+8
View File
@@ -1,5 +1,13 @@
# Python Buildpack Changelog # Python Buildpack Changelog
# 136
Upgrade to 3.6.6 and support 3.7.0 on all runtimes.
# 135
Upgrade Pipenv to v2018.5.18.
# 134 # 134
Default to 3.6.5, bugfixes. Default to 3.6.5, bugfixes.
+4 -3
View File
@@ -23,9 +23,9 @@ Deploying a Python application couldn't be easier:
$ git push heroku master $ git push heroku master
-----> Python app detected -----> Python app detected
-----> Installing python-3.6.4 -----> Installing python-3.6.6
-----> Installing pip -----> Installing pip
-----> Installing requirements with Pipenv 11.7.1… -----> Installing requirements with Pipenv 2018.5.18
... ...
Installing dependencies from Pipfile… Installing dependencies from Pipfile…
-----> Discovering process types -----> Discovering process types
@@ -58,5 +58,6 @@ Or, with a `runtime.txt` file:
Runtime options include: Runtime options include:
- `python-3.6.4` - `python-3.7.0`
- `python-3.6.6`
- `python-2.7.15` - `python-2.7.15`
+7 -7
View File
@@ -49,8 +49,8 @@ export VENDOR_URL
# These variables are used to specify which versions of Python to install by default, # 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 unsupported version. # as well as prompt the user to upgrade if they are using an unsupported version.
# Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37. # Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37.
DEFAULT_PYTHON_VERSION="python-3.6.5" DEFAULT_PYTHON_VERSION="python-3.6.6"
LATEST_3="python-3.6.5" LATEST_3="python-3.6.6"
LATEST_2="python-2.7.15" LATEST_2="python-2.7.15"
# Which stack is used (for binary downloading), if none is provided (e.g. outside of Heroku)? # Which stack is used (for binary downloading), if none is provided (e.g. outside of Heroku)?
@@ -221,7 +221,7 @@ fi
# Download / Install Python, from pre-build binaries available on Amazon S3. # Download / Install Python, from pre-build binaries available on Amazon S3.
# This step also bootstraps pip / setuptools. # This step also bootstraps pip / setuptools.
let start=$(nowms) (( start=$(nowms) ))
# shellcheck source=bin/steps/python # shellcheck source=bin/steps/python
source "$BIN_DIR/steps/python" source "$BIN_DIR/steps/python"
mtime "python.install.time" "${start}" mtime "python.install.time" "${start}"
@@ -233,7 +233,7 @@ source "$BIN_DIR/steps/pipenv"
# Uninstall removed dependencies with Pip. # Uninstall removed dependencies with Pip.
# The buildpack will automatically remove any declared dependencies (in requirements.txt) # The buildpack will automatically remove any declared dependencies (in requirements.txt)
# that were explicitly removed. This machinery is a bit complex, but it is not complicated. # that were explicitly removed. This machinery is a bit complex, but it is not complicated.
let start=$(nowms) (( start=$(nowms) ))
# shellcheck source=bin/steps/pip-uninstall # shellcheck source=bin/steps/pip-uninstall
source "$BIN_DIR/steps/pip-uninstall" source "$BIN_DIR/steps/pip-uninstall"
mtime "pip.uninstall.time" "${start}" mtime "pip.uninstall.time" "${start}"
@@ -277,7 +277,7 @@ source "$BIN_DIR/steps/gdal"
# ----------- # -----------
# Install dependencies with pip (where the magic happens). # Install dependencies with pip (where the magic happens).
let start=$(nowms) (( start=$(nowms) ))
# shellcheck source=bin/steps/pip-install # shellcheck source=bin/steps/pip-install
source "$BIN_DIR/steps/pip-install" source "$BIN_DIR/steps/pip-install"
mtime "pip.install.time" "${start}" mtime "pip.install.time" "${start}"
@@ -286,7 +286,7 @@ mtime "pip.install.time" "${start}"
# Note: this may only work on Python 2.7. I don't think many customers use this functionality, # Note: this may only work on Python 2.7. I don't think many customers use this functionality,
# and it should probably be undocumented. # and it should probably be undocumented.
# (there's an import error on 3.6 that should hopefully be fixed upstream at some point) # (there's an import error on 3.6 that should hopefully be fixed upstream at some point)
let start=$(nowms) (( start=$(nowms) ))
sub_env "$BIN_DIR/steps/nltk" sub_env "$BIN_DIR/steps/nltk"
mtime "nltk.download.time" "${start}" mtime "nltk.download.time" "${start}"
@@ -304,7 +304,7 @@ fi
# This is the cause for the majority of build failures on the Python platform. # This is the cause for the majority of build failures on the Python platform.
# These failures are intentional — if collectstatic (which can be tricky, at times) fails, # These failures are intentional — if collectstatic (which can be tricky, at times) fails,
# your build fails. # your build fails.
let start=$(nowms) (( start=$(nowms) ))
sub_env "$BIN_DIR/steps/collectstatic" sub_env "$BIN_DIR/steps/collectstatic"
mtime "collectstatic.time" "${start}" mtime "collectstatic.time" "${start}"
+1 -1
View File
@@ -11,7 +11,7 @@
# - $DEBUG_COLLECTSTATIC: upon failure, print out environment variables. # - $DEBUG_COLLECTSTATIC: upon failure, print out environment variables.
# shellcheck source=bin/utils # shellcheck source=bin/utils
source $BIN_DIR/utils source "$BIN_DIR/utils"
# Location of 'manage.py', if it exists. # Location of 'manage.py', if it exists.
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' -printf '%d\t%P\n' | sort -nk1 | cut -f2 | head -1) MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' -printf '%d\t%P\n' | sort -nk1 | cut -f2 | head -1)
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck source=bin/utils # shellcheck source=bin/utils
source $BIN_DIR/utils source "$BIN_DIR/utils"
if [ ! "$SKIP_PIP_INSTALL" ]; then if [ ! "$SKIP_PIP_INSTALL" ]; then
+1 -1
View File
@@ -3,7 +3,7 @@
set +e set +e
# Install dependencies with Pip. # Install dependencies with Pip.
# shellcheck source=bin/utils # shellcheck source=bin/utils
source $BIN_DIR/utils source "$BIN_DIR/utils"
if [ ! "$SKIP_PIP_INSTALL" ]; then if [ ! "$SKIP_PIP_INSTALL" ]; then
+2 -2
View File
@@ -3,7 +3,7 @@
# export CLINT_FORCE_COLOR=1 # export CLINT_FORCE_COLOR=1
# export PIPENV_FORCE_COLOR=1 # export PIPENV_FORCE_COLOR=1
# shellcheck source=bin/utils # shellcheck source=bin/utils
source $BIN_DIR/utils source "$BIN_DIR/utils"
set -e set -e
if [[ -f Pipfile.lock ]]; then if [[ -f Pipfile.lock ]]; then
@@ -41,7 +41,7 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then
export PIP_EXTRA_INDEX_URL export PIP_EXTRA_INDEX_URL
fi fi
export PIPENV_VERSION="11.8.2" export PIPENV_VERSION="2018.5.18"
# Install pipenv. # Install pipenv.
/app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade &> /dev/null /app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade &> /dev/null
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/sqlite
OUT_PREFIX=$1
echo "Building Python…"
SOURCE_TARBALL='https://python.org/ftp/python/3.6.6/Python-3.6.6.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-3.6.6 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 '{}' +
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/sqlite
OUT_PREFIX=$1
echo "Building Python…"
SOURCE_TARBALL='https://python.org/ftp/python/3.7.0/Python-3.7.0.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-3.7.0 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 '{}' +
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
+11 -23
View File
@@ -1,27 +1,14 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "397f2c55e3558ea57d292e3fc19b34e483770e5ec02cdedfb1f330680cd26635" "sha256": "09ad9dcae1870ba083f43c5a05ed8943b23bd4c27e61a13ecf4e16d18500ad98"
},
"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": {},
"sources": [ "sources": [
{ {
"name": "pypi", "name": "pypi",
"url": "https://pypi.python.org/simple", "url": "https://pypi.org/simple",
"verify_ssl": true "verify_ssl": true
} }
] ]
@@ -29,22 +16,23 @@
"default": { "default": {
"delegator.py": { "delegator.py": {
"hashes": [ "hashes": [
"sha256:2575c4adc923ad0b8fdaa433f862b2b7cf21982717fb23cc895fd8f249ea820c", "sha256:2d46966a7f484d271b09e2646eae1e9acadc4fdf2cb760c142f073e81c927d8d",
"sha256:495e11ada66648650171a6c9a188df4eb050b235abff8771f41ee8a064eb9ded" "sha256:58f3ea6fe36680e1d828e2e66e52844b826f186409dfee4436e42351b0e699fe"
], ],
"version": "==0.0.13" "index": "pypi",
"version": "==0.1.0"
}, },
"pexpect": { "pexpect": {
"hashes": [ "hashes": [
"sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018", "sha256:9783f4644a3ef8528a6f20374eeb434431a650c797ca6d8df0d81e30fffdfa24",
"sha256:3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92" "sha256:9f8eb3277716a01faafaba553d629d3d60a1a624c7cf45daa600d2148c30020c"
], ],
"version": "==4.2.1" "version": "==4.5.0"
}, },
"ptyprocess": { "ptyprocess": {
"hashes": [ "hashes": [
"sha256:e8c43b5eee76b2083a9badde89fd1bbce6c8942d1045146e100b7b5e014f4f1a", "sha256:e64193f0047ad603b71f202332ab5527c5e52aa7c8b609704fc28c0dc20c4365",
"sha256:e64193f0047ad603b71f202332ab5527c5e52aa7c8b609704fc28c0dc20c4365" "sha256:e8c43b5eee76b2083a9badde89fd1bbce6c8942d1045146e100b7b5e014f4f1a"
], ],
"version": "==0.5.2" "version": "==0.5.2"
} }
+2 -2
View File
@@ -12,7 +12,7 @@ testPipenvLock() {
testPipenvVersion() { testPipenvVersion() {
compile "pipenv-version" compile "pipenv-version"
assertCaptured "3.6.5" assertCaptured "3.6.6"
assertCapturedSuccess assertCapturedSuccess
} }
@@ -83,7 +83,7 @@ testPython2() {
testPython3() { testPython3() {
compile "python3" compile "python3"
assertCaptured "python-3.6.5" assertCaptured "python-3.6.6"
assertCapturedSuccess assertCapturedSuccess
} }
+2 -1
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import io
import json import json
import sys import sys
@@ -7,7 +8,7 @@ import sys
def main(): def main():
INFILE = sys.argv[1] INFILE = sys.argv[1]
with open(INFILE, 'rb') as f: with io.open(INFILE, 'r', encoding='utf-8') as f:
lockfile = json.load(f) lockfile = json.load(f)
packages = [] packages = []