Compare commits

..

8 Commits

9 changed files with 17 additions and 33 deletions
-10
View File
@@ -1,15 +1,5 @@
# Python Buildpack Changelog
# 114
- Bugfixes.
Blacklisting `PYTHONHOME` and `PYTHONPATH` for older apps. Upgrades to nltk support.
# 113
- Updates to Pipenv support.
# 112
Bugfix.
+9 -7
View File
@@ -4,7 +4,7 @@
[![Build Status](https://travis-ci.org/heroku/heroku-buildpack-python.svg?branch=master)](https://travis-ci.org/heroku/heroku-buildpack-python)
This is the official [Heroku buildpack](https://devcenter.heroku.com/articles/buildpacks) for Python apps, powered by [Pipenv](http://docs.pipenv.org/en/latest/), [pip](https://pip.pypa.io/) and other excellent software.
This is the official [Heroku buildpack](https://devcenter.heroku.com/articles/buildpacks) for Python apps, powered by [pip](https://pip.pypa.io/) and other excellent software.
Recommended web frameworks include **Django** and **Flask**. The recommended webserver is **Gunicorn**. There are no restrictions around what software can be used (as long as it's pip-installable). Web processes must bind to `$PORT`, and only the HTTP protocol is permitted for incoming connections.
@@ -16,7 +16,7 @@ See it in Action
Deploying a Python application couldn't be easier:
$ ls
Pipfile Procfile web.py
Procfile requirements.txt web.py
$ heroku create --buildpack heroku/python
@@ -24,14 +24,16 @@ Deploying a Python application couldn't be easier:
...
-----> Python app detected
-----> Installing python-3.6.2
-----> Installing pip
-----> Installing requirements with latest pipenv...
...
Installing dependencies from Pipfile...
$ pip install -r requirements.txt
Collecting requests (from -r requirements.txt (line 1))
Downloading requests-2.12.4-py2.py3-none-any.whl (576KB)
Installing collected packages: requests
Successfully installed requests-2.12.4
-----> Discovering process types
Procfile declares types -> (none)
A `Pipfile` or `requirements.txt` must be present at the root of your application's repository.
A `requirements.txt` file must be present at the root of your application's repository.
You can also specify the latest production release of this buildpack for upcoming builds of an existing application:
+4 -3
View File
@@ -21,10 +21,10 @@ if sp-grep -s nltk; then
if [ -f "$nltk_packages_definition" ]; then
readarray -t nltk_packages < "$nltk_packages_definition"
puts-step "Downloading NLTK packages: ${nltk_packages[*]}"
nltk_packages=$(tr "\n" " " < "$nltk_packages_definition")
puts-step "Downloading NLTK packages: $nltk_packages"
python -m nltk.downloader -d "$BUILD_DIR/.heroku/python/nltk_data" "${nltk_packages[@]}" | indent
python -m nltk.downloader -d "$BUILD_DIR/.heroku/python/nltk_data" "$nltk_packages" | indent
set_env NLTK_DATA "/app/.heroku/python/nltk_data"
else
@@ -32,3 +32,4 @@ if sp-grep -s nltk; then
puts-warn "Learn more: https://devcenter.heroku.com/articles/python-nltk"
fi
fi
-3
View File
@@ -6,9 +6,6 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
puts-step "Installing requirements with pip"
set +e
BLACKLIST='PYTHONHOME|PYTHONPATH'
export BLACKLIST
sub_env /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
+1 -1
View File
@@ -9,7 +9,7 @@ if [[ -f Pipfile ]]; then
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
# Install the dependencies.
/app/.heroku/python/bin/pipenv install --system --skip-lock 2>&1 | indent
/app/.heroku/python/bin/pipenv install --system 2>&1 | indent
# Skip pip install, later.
export SKIP_PIP_INSTALL=1
+1 -1
View File
@@ -2,7 +2,7 @@
# Detect Python-version with Pipenv.
if [[ -f $BUILD_DIR/Pipfile ]]; then
if [[ -f $BUILD_DIR/Pipfile.lock ]]; then
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then
if [[ ! -f $BUILD_DIR/Pipfile.lock ]]; then
+1 -2
View File
@@ -1,2 +1 @@
city_database
stopwords
wordnet
+1 -1
View File
@@ -24,7 +24,7 @@ testGEOS() {
testNLTK() {
compile "nltk"
assertCaptured "Downloading NLTK packages: city_database stopwords"
assertCaptured "wordnet"
assertCapturedSuccess
}
-5
View File
@@ -150,11 +150,6 @@ _assertContains()
esac
fail "${msg:-${default_msg}}"
if [ "${haystack_type}" == "file" ]; then
echo
cat "${haystack}"
fi
fi
}