Skip to content
Snippets Groups Projects
Commit ff223597 authored by Kenneth Reitz's avatar Kenneth Reitz Committed by GitHub
Browse files

Upgrades :top: (#475)


* fixed the bug for pypy-5.8.0

* changelog

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* python 2.7.14

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* pipfile > requirements.txt

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* check for python_full_version too

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* 2.7.14

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* warn when using an older version of python

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* requirements for anaconda buildpack

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* remove hashes for conda buildpack

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* improvements to pipenv python version detection

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* oops

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* oops

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* oops

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* echo not puts

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* try this

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* learn more

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* there we go

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* cleanups

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* cleanups

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* cleanups

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* unsupported

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* consistiency

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* be more specific

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* capitalize Pipfile.lock

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* attempt to force color

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* try this

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* try this

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* interactive

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* interactive

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* diagnose

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* try without -l

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* confirmed env working

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* just -c

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* use latest, to debug

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* no more bash

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* try …

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* don't use the git version of pipenv

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* oops

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* next version

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* 2.7.14

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* comment out force color bits

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* readme

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* more tests

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* more tests

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>

* ellipsis

Signed-off-by: default avatarKenneth Reitz <me@kennethreitz.org>
parent 50950c59
No related branches found
No related tags found
No related merge requests found
Showing
with 138 additions and 27 deletions
# Python Buildpack Changelog
# 119
Improvements to Pipenv support, warning on unsupported Python versions.
- We now warn when a user is not using latest 2.x or 3.x Python.
- Heroku now supports `[requires]` `python_full_version` in addition to `python_version`.
# 118
Improvements to Pipenv support.
# 117
Bug fix.
......
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
[packages]
"bob-builder" = "==0.0.13"
\ No newline at end of file
{
"_meta": {
"hash": {
"sha256": "36d17c46a8b1b844b3cae475f6f42d6c0a9e59b2a9685cbcdc0985656a7a129f"
},
"host-environment-markers": {
"implementation_name": "cpython",
"implementation_version": "3.6.2",
"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.2",
"python_version": "3.6",
"sys_platform": "darwin"
},
"pipfile-spec": 6,
"requires": {},
"sources": [
{
"name": "pypi",
"url": "https://pypi.python.org/simple",
"verify_ssl": true
}
]
},
"default": {
"bob-builder": {
"hashes": [
"sha256:b4de49a8e436fcaf82236ea43f78413b4a4c92100726e382ab57b6bdfb38fe64",
"sha256:288e3e765c4890fe9a63ae52ac6b4a963c13fe508482c70ff701a5ae21b9a673"
],
"version": "==0.0.13"
},
"boto": {
"hashes": [
"sha256:13be844158d1bd80a94c972c806ec8381b9ea72035aa06123c5db6bc6a6f3ead",
"sha256:deb8925b734b109679e3de65856018996338758f4b916ff4fe7bb62b6d7000d1"
],
"version": "==2.48.0"
},
"docopt": {
"hashes": [
"sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
],
"version": "==0.6.2"
}
},
"develop": {}
}
......@@ -21,13 +21,13 @@ Deploying a Python application couldn't be easier:
$ heroku create --buildpack heroku/python
$ git push heroku master
...
-----> Python app detected
-----> Installing python-3.6.2
-----> Installing pip
-----> Installing requirements with latest pipenv...
-----> Installing requirements with latest pipenv
...
Installing dependencies from Pipfile...
Installing dependencies from Pipfile
-----> Discovering process types
Procfile declares types -> (none)
......@@ -44,11 +44,21 @@ Specify a Python Runtime
Specific versions of the Python runtime can be specified with a `runtime.txt` file:
$ cat runtime.txt
python-2.7.13
python-2.7.14
Or, with a `Pipfile.lock` (generated from the following `Pipfile`):
[requires]
python_version = "2.7"
Or, more specifically:
[requires]
python_full_version = "2.7.14"
Runtime options include:
- `python-3.6.2`
- `python-2.7.13`
- `python-2.7.14`
- `pypy-5.7.1` (unsupported, experimental)
- `pypy3-5.5.1` (unsupported, experimental)
......@@ -35,10 +35,13 @@ export BUILD_DIR CACHE_DIR ENV_DIR
# Python defaults
DEFAULT_PYTHON_VERSION="python-3.6.2"
LATEST_3="python-3.6.2"
LATEST_2="python-2.7.14"
DEFAULT_PYTHON_STACK="cedar-14"
PIP_UPDATE="9.0.1"
export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE
export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE LATEST_2 LATEST_3
# Common Problem Warnings
WARNINGS_LOG=$(mktemp)
......
......@@ -15,7 +15,7 @@ source "$BIN_DIR/utils"
# Check that nltk was installed by pip, otherwise obviously not needed
if sp-grep -s nltk; then
puts-step "Downloading NLTK corpora..."
puts-step "Downloading NLTK corpora"
nltk_packages_definition="$BUILD_DIR/nltk.txt"
......
#!/usr/bin/env bash
# export CLINT_FORCE_COLOR=1
# export PIPENV_FORCE_COLOR=1
# Pipenv support (Generate requriements.txt with pipenv).
if [[ -f Pipfile ]]; then
if [[ ! -f requirements.txt ]]; then
puts-step "Installing requirements with latest Pipenv..."
puts-step "Installing requirements with latest Pipenv"
# Install pipenv.
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
......
......@@ -6,19 +6,27 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then
if [[ ! -f $BUILD_DIR/Pipfile.lock ]]; then
puts-warn "No 'pipfile.lock' found! We recommend you commit this into your repository."
puts-warn "No 'Pipfile.lock' found! We recommend you commit this into your repository."
fi
if [[ -f $BUILD_DIR/Pipfile.lock ]]; then
set +e
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock")
PYTHON=$(jq -r '._meta.requires.python_full_version' "$BUILD_DIR/Pipfile.lock")
if [[ "$PYTHON" != "null" ]]; then
echo "python-$PYTHON" > "$BUILD_DIR/runtime.txt"
fi
set -e
if [ "$PYTHON" = 2.7 ]; then
echo "python-2.7.13" > "$BUILD_DIR/runtime.txt"
fi
if [ "$PYTHON" = 3.6 ]; then
echo "python-3.6.2" > "$BUILD_DIR/runtime.txt"
if [[ "$PYTHON" == "null" ]]; then
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock")
if [ "$PYTHON" = 2.7 ]; then
echo "python-2.7.14" > "$BUILD_DIR/runtime.txt"
fi
if [ "$PYTHON" = 3.6 ]; then
echo "python-3.6.2" > "$BUILD_DIR/runtime.txt"
fi
fi
fi
fi
fi
......
......@@ -4,6 +4,21 @@ set +e
runtime-fixer runtime.txt
PYTHON_VERSION=$(cat runtime.txt)
if [[ $PYTHON_VERSION =~ ^python-2 ]]; then
if [[ "$PYTHON_VERSION" != "$LATEST_2" ]]; then
puts-warn "The latest version of Python 2 is $LATEST_2 (you are using $PYTHON_VERSION, which is unsupported)."
puts-warn "We recommend upgrading by specifying the latest version ($LATEST_2)."
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi
else
if [[ "$PYTHON_VERSION" != "$LATEST_3" ]]; then
puts-warn "The latest version of Python 3 is $LATEST_3 (you are using $PYTHON_VERSION, which is unsupported)."
puts-warn "We recommend upgrading by specifying the latest version ($LATEST_3)."
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi
fi
if [[ "$STACK" != "$CACHED_PYTHON_STACK" ]]; then
puts-step "Stack has changed from $CACHED_PYTHON_STACK to $STACK, clearing cache"
rm -fr .heroku/python-stack .heroku/python-version .heroku/python .heroku/vendor
......
......@@ -3,7 +3,7 @@
OUT_PREFIX=$1
echo "Building SQLite..."
echo "Building SQLite"
SOURCE_TARBALL='https://www.sqlite.org/sqlite-autoconf-3070900.tar.gz'
......
......@@ -8,7 +8,7 @@ export PATH="/app/.heroku/python/bin/:$PATH"
hash -r
echo "Building gdal..."
echo "Building gdal"
VERSION="2.2.1"
SOURCE_TARBALL="http://download.osgeo.org/gdal/${VERSION}/gdal-${VERSION}.tar.gz"
......
......@@ -8,7 +8,7 @@ export PATH="/app/.heroku/python/bin/:$PATH"
hash -r
echo "Building geos..."
echo "Building geos"
VERSION=3.6.2
......
......@@ -13,7 +13,7 @@ export PATH="/app/.heroku/python/bin/:$PATH"
hash -r
echo "Building libffi..."
echo "Building libffi"
SOURCE_TARBALL='ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz'
......
......@@ -20,7 +20,7 @@ dep_archive_name=${dep_dirname}.tar.gz
dep_url=https://launchpad.net/libmemcached/1.0/${dep_version}/+download/${dep_archive_name}
# SASL Support.
echo "-----> Building cyrus-sasl 2.1.26..."
echo "-----> Building cyrus-sasl 2.1.26"
curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz
# FTP doesn't play well with piping into tar xz
......@@ -33,7 +33,7 @@ make -s -j 9
make install -s
popd
echo "-----> Building libmemcached ${dep_version}..."
echo "-----> Building libmemcached ${dep_version}"
curl -L ${dep_url} | tar xz
pushd ${dep_dirname}
......
......@@ -8,7 +8,7 @@ export PATH="/app/.heroku/python/bin/:$PATH"
hash -r
echo "Building gdal..."
echo "Building gdal"
VERSION=4.9.3
SOURCE_TARBALL="http://download.osgeo.org/proj/proj-${VERSION}.tar.gz"
......
......@@ -6,7 +6,7 @@
OUT_PREFIX=$1
echo "Building PyPy..."
echo "Building PyPy"
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.1-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy2-v5.3.1-linux64/* $OUT_PREFIX
......
......@@ -6,7 +6,7 @@
OUT_PREFIX=$1
echo "Building PyPy..."
echo "Building PyPy"
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.6.0-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy2-v5.6.0-linux64/* $OUT_PREFIX
......
......@@ -6,7 +6,7 @@
OUT_PREFIX=$1
echo "Building PyPy..."
echo "Building PyPy"
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.0-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy2-v5.7.0-linux64/* $OUT_PREFIX
......
......@@ -6,7 +6,7 @@
OUT_PREFIX=$1
echo "Building PyPy..."
echo "Building PyPy"
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy2-v5.7.1-linux64/* $OUT_PREFIX
......
......@@ -4,7 +4,7 @@
OUT_PREFIX=$1
echo "Building PyPy..."
echo "Building PyPy"
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux64.tar.bz2'
curl -L $SOURCE_TARBALL | tar jx
cp -R pypy2-v5.8.0-linux64/* $OUT_PREFIX
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment