mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 13d2a58add | |||
| 49e9147439 | |||
| 3c0146c0b9 | |||
| 53c7d61291 | |||
| 797652a75d | |||
| d7351513c7 | |||
| fe029af603 | |||
| dd8fe58de1 | |||
| a979d57a20 | |||
| 3cb8db7e2e | |||
| 16cce92342 | |||
| b85fe3614c | |||
| b024e644d1 | |||
| 41e0f64252 | |||
| 3a0d4c18bf | |||
| b3988a565a | |||
| 0437a6e84f | |||
| 88a5ba5d39 | |||
| 3434972e32 | |||
| 1dfef44085 | |||
| 2ffb10da34 | |||
| 23999846ad | |||
| 8d1ebf7288 | |||
| f2165aaac6 | |||
| 05492e132a |
@@ -10,9 +10,6 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- stage: Bash linting (shellcheck)
|
- stage: Bash linting (shellcheck)
|
||||||
sudo: false
|
sudo: false
|
||||||
before_install:
|
|
||||||
- wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/
|
|
||||||
- PATH="/tmp/shellcheck-latest:$PATH"
|
|
||||||
script: make check
|
script: make check
|
||||||
- stage: Stack Unit Tests
|
- stage: Stack Unit Tests
|
||||||
services: docker
|
services: docker
|
||||||
|
|||||||
+13
-1
@@ -1,8 +1,20 @@
|
|||||||
# Python Buildpack Changelog
|
# Python Buildpack Changelog
|
||||||
|
|
||||||
|
# 148 (2019-02-21)
|
||||||
|
|
||||||
|
No user facing changes, improving internal metrics
|
||||||
|
|
||||||
|
# 147 (2019-02-07)
|
||||||
|
|
||||||
|
Python 3.7.2 and 3.6.8 now available on all Heroku stacks.
|
||||||
|
|
||||||
|
# 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-11-08)
|
# 145 (2018-11-08)
|
||||||
|
|
||||||
Python 3.7.1, 3.6.7, 3.5.6 and 3.4.9 now available on all Heroku stacks.
|
Testing and tooling expanded to better support new runtimes
|
||||||
|
|
||||||
# 144 (2018-10-10)
|
# 144 (2018-10-10)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# These targets are not files
|
# These targets are not files
|
||||||
.PHONY: tests
|
.PHONY: tests
|
||||||
|
|
||||||
test: test-heroku-16
|
test: test-heroku-18 test-heroku-16
|
||||||
|
|
||||||
check:
|
check:
|
||||||
@shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings
|
@shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings
|
||||||
|
|||||||
@@ -4,36 +4,54 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/heroku/heroku-buildpack-python)
|
[](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/), [pip](https://pip.pypa.io/) and other excellent software.
|
This is the official [Heroku buildpack](https://devcenter.heroku.com/articles/buildpacks) for Python apps.
|
||||||
|
|
||||||
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.
|
Recommended web frameworks include **Django** and **Flask**, among others. 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.
|
||||||
|
|
||||||
Python packages with C dependencies that are not [available on the stack image](https://devcenter.heroku.com/articles/stack-packages) are generally not supported, unless `manylinux` wheels are provided by the package maintainers (common). For recommended solutions, check out [this article](https://devcenter.heroku.com/articles/python-c-deps) for more information.
|
Python packages with C dependencies that are not [available on the stack image](https://devcenter.heroku.com/articles/stack-packages) are generally not supported, unless `manylinux` wheels are provided by the package maintainers (common). For recommended solutions, check out [this article](https://devcenter.heroku.com/articles/python-c-deps) for more information.
|
||||||
|
|
||||||
See it in Action
|
See it in Action
|
||||||
----------------
|
----------------
|
||||||
|
```
|
||||||
|
$ ls
|
||||||
|
my-application requirements.txt runtime.txt
|
||||||
|
|
||||||
Deploying a Python application couldn't be easier:
|
$ git push heroku master
|
||||||
|
Counting objects: 4, done.
|
||||||
|
Delta compression using up to 8 threads.
|
||||||
|
Compressing objects: 100% (2/2), done.
|
||||||
|
Writing objects: 100% (4/4), 276 bytes | 276.00 KiB/s, done.
|
||||||
|
Total 4 (delta 0), reused 0 (delta 0)
|
||||||
|
remote: Compressing source files... done.
|
||||||
|
remote: Building source:
|
||||||
|
remote:
|
||||||
|
remote: -----> Python app detected
|
||||||
|
remote: -----> Installing python-3.7.1
|
||||||
|
remote: -----> Installing pip
|
||||||
|
remote: -----> Installing SQLite3
|
||||||
|
remote: -----> Installing requirements with pip
|
||||||
|
remote: Collecting flask (from -r /tmp/build_c2c067ef79ff14c9bf1aed6796f9ed1f/requirements.txt (line 1))
|
||||||
|
remote: Downloading ...
|
||||||
|
remote: Installing collected packages: Werkzeug, click, MarkupSafe, Jinja2, itsdangerous, flask
|
||||||
|
remote: Successfully installed Jinja2-2.10 MarkupSafe-1.1.0 Werkzeug-0.14.1 click-7.0 flask-1.0.2 itsdangerous-1.1.0
|
||||||
|
remote:
|
||||||
|
remote: -----> Discovering process types
|
||||||
|
remote: Procfile declares types -> (none)
|
||||||
|
remote:
|
||||||
|
```
|
||||||
|
|
||||||
$ ls
|
A `requirements.txt` must be present at the root of your application's repository to deploy.
|
||||||
Pipfile Pipfile.lock Procfile web.py
|
|
||||||
|
|
||||||
$ heroku create --buildpack heroku/python
|
To specify your python version, you also need a `runtime.txt` file - unless you are using the default Python runtime version.
|
||||||
|
|
||||||
$ git push heroku master
|
Current default Python Runtime: Python 3.6.7
|
||||||
…
|
|
||||||
-----> Python app detected
|
|
||||||
-----> Installing python-3.6.6
|
|
||||||
-----> Installing pip
|
|
||||||
-----> Installing requirements with Pipenv 2018.5.18…
|
|
||||||
...
|
|
||||||
Installing dependencies from Pipfile…
|
|
||||||
-----> Discovering process types
|
|
||||||
Procfile declares types -> (none)
|
|
||||||
|
|
||||||
A `Pipfile` or `requirements.txt` must be present at the root of your application's repository.
|
Alternatively, you can provide a `setup.py` file, or a `Pipfile`. Using `Pipenv` will generate `runtime.txt` based on `python-version` at build time.
|
||||||
|
|
||||||
You can also specify the latest production release of this buildpack for upcoming builds of an existing application:
|
Specify a Buildpack Version
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
You can specify the latest production release of this buildpack for upcoming builds of an existing application:
|
||||||
|
|
||||||
$ heroku buildpacks:set heroku/python
|
$ heroku buildpacks:set heroku/python
|
||||||
|
|
||||||
@@ -41,23 +59,30 @@ You can also specify the latest production release of this buildpack for upcomin
|
|||||||
Specify a Python Runtime
|
Specify a Python Runtime
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Specific versions of the Python runtime can be specified in your `Pipfile`:
|
Supported runtime options include:
|
||||||
|
|
||||||
[requires]
|
- `python-3.7.1`
|
||||||
python_version = "2.7"
|
- `python-3.6.7`
|
||||||
|
|
||||||
Or, more specifically:
|
|
||||||
|
|
||||||
[requires]
|
|
||||||
python_full_version = "2.7.15"
|
|
||||||
|
|
||||||
Or, with a `runtime.txt` file:
|
|
||||||
|
|
||||||
$ cat runtime.txt
|
|
||||||
python-2.7.15
|
|
||||||
|
|
||||||
Runtime options include:
|
|
||||||
|
|
||||||
- `python-3.7.0`
|
|
||||||
- `python-3.6.6`
|
|
||||||
- `python-2.7.15`
|
- `python-2.7.15`
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
The buildpack tests use [Docker](https://www.docker.com/) to simulate
|
||||||
|
Heroku's [stack images.](https://devcenter.heroku.com/articles/stack)
|
||||||
|
|
||||||
|
To run the test suite:
|
||||||
|
|
||||||
|
```
|
||||||
|
make test
|
||||||
|
```
|
||||||
|
|
||||||
|
Or to test in a particular stack:
|
||||||
|
|
||||||
|
```
|
||||||
|
make test-heroku-18
|
||||||
|
make test-heroku-16
|
||||||
|
```
|
||||||
|
|
||||||
|
The tests are run via the vendored
|
||||||
|
[shunit2](https://github.com/kward/shunit2)
|
||||||
|
test framework.
|
||||||
|
|||||||
+3
-3
@@ -49,9 +49,9 @@ 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 un–supported version.
|
# 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.
|
# Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37.
|
||||||
DEFAULT_PYTHON_VERSION="python-3.6.6"
|
DEFAULT_PYTHON_VERSION="python-3.6.8"
|
||||||
LATEST_36="python-3.6.6"
|
LATEST_36="python-3.6.8"
|
||||||
LATEST_37="python-3.7.0"
|
LATEST_37="python-3.7.2"
|
||||||
LATEST_35="python-3.5.6"
|
LATEST_35="python-3.5.6"
|
||||||
LATEST_34="python-3.4.9"
|
LATEST_34="python-3.4.9"
|
||||||
LATEST_27="python-2.7.15"
|
LATEST_27="python-2.7.15"
|
||||||
|
|||||||
+1
-1
@@ -26,9 +26,9 @@ if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
|
|||||||
mkdir -p .heroku/vendor
|
mkdir -p .heroku/vendor
|
||||||
# Download and extract cryptography into target vendor directory.
|
# Download and extract cryptography into target vendor directory.
|
||||||
curl "$VENDORED_GDAL" -s | tar zxv -C .heroku/vendor &> /dev/null
|
curl "$VENDORED_GDAL" -s | tar zxv -C .heroku/vendor &> /dev/null
|
||||||
|
mcount "steps.vendor.gdal"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GDAL=$(pwd)/vendor
|
GDAL=$(pwd)/vendor
|
||||||
export GDAL
|
export GDAL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ source "$BIN_DIR/utils"
|
|||||||
|
|
||||||
# If GDAL exists within requirements, use vendored gdal.
|
# If GDAL exists within requirements, use vendored gdal.
|
||||||
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
|
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
|
||||||
|
mcount "buildvar.BUILD_WITH_GEO_LIBRARIES"
|
||||||
|
|
||||||
if [ ! -f ".heroku/vendor/bin/proj" ]; then
|
if [ ! -f ".heroku/vendor/bin/proj" ]; then
|
||||||
echo "-----> Bootstrapping gdal, geos, proj."
|
echo "-----> Bootstrapping gdal, geos, proj."
|
||||||
@@ -31,9 +32,11 @@ if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
|
|||||||
curl "$VENDORED_GEOS" -s | tar zxv -C .heroku/vendor &> /dev/null
|
curl "$VENDORED_GEOS" -s | tar zxv -C .heroku/vendor &> /dev/null
|
||||||
curl "$VENDORED_PROJ" -s | tar zxv -C .heroku/vendor &> /dev/null
|
curl "$VENDORED_PROJ" -s | tar zxv -C .heroku/vendor &> /dev/null
|
||||||
|
|
||||||
|
mcount "steps.vendor.geo_libs"
|
||||||
# Copy libjasper from build image to slug.
|
# Copy libjasper from build image to slug.
|
||||||
if [[ "$STACK" == "heroku-16" ]]; then
|
if [[ "$STACK" == "heroku-16" ]]; then
|
||||||
cp /usr/lib/x86_64-linux-gnu/libjasper.so* ".heroku/vendor/lib/."
|
cp /usr/lib/x86_64-linux-gnu/libjasper.so* ".heroku/vendor/lib/."
|
||||||
|
mcount "steps.vendor.libjasper"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
-1
@@ -4,6 +4,6 @@
|
|||||||
if [[ -f "requirements.txt" ]]; then
|
if [[ -f "requirements.txt" ]]; then
|
||||||
if (grep -Fiq "hg+" requirements.txt) then
|
if (grep -Fiq "hg+" requirements.txt) then
|
||||||
/app/.heroku/python/bin/pip install mercurial | cleanup | indent
|
/app/.heroku/python/bin/pip install mercurial | cleanup | indent
|
||||||
|
mcount "steps.mercurial"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ if sp-grep -s nltk; then
|
|||||||
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"
|
set_env NLTK_DATA "/app/.heroku/python/nltk_data"
|
||||||
|
|
||||||
|
mcount "buildvar.NLTK_PACKAGES_DEFINITION"
|
||||||
|
mcount "steps.nltk"
|
||||||
else
|
else
|
||||||
puts-warn "'nltk.txt' not found, not downloading any corpora"
|
puts-warn "'nltk.txt' not found, not downloading any corpora"
|
||||||
puts-warn "Learn more: https://devcenter.heroku.com/articles/python-nltk"
|
puts-warn "Learn more: https://devcenter.heroku.com/articles/python-nltk"
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
|
|||||||
mcount "failure.none-version"
|
mcount "failure.none-version"
|
||||||
fi
|
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
|
/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]}"
|
PIP_STATUS="${PIPESTATUS[0]}"
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
|
|||||||
if [[ "$PYTHON" == "null" ]]; then
|
if [[ "$PYTHON" == "null" ]]; then
|
||||||
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock")
|
PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock")
|
||||||
if [ "$PYTHON" = 2.7 ]; then
|
if [ "$PYTHON" = 2.7 ]; then
|
||||||
echo "$LATEST_2" > "$BUILD_DIR/runtime.txt"
|
echo "$LATEST_27" > "$BUILD_DIR/runtime.txt"
|
||||||
fi
|
fi
|
||||||
if [ "$PYTHON" = 3.6 ]; then
|
if [ "$PYTHON" = 3.6 ]; then
|
||||||
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt"
|
echo "$LATEST_36" > "$BUILD_DIR/runtime.txt"
|
||||||
@@ -33,4 +33,3 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
|
|||||||
mkdir -p .heroku/vendor
|
mkdir -p .heroku/vendor
|
||||||
# Download and extract libmemcached into target vendor directory.
|
# Download and extract libmemcached into target vendor directory.
|
||||||
curl "$VENDORED_MEMCACHED" -s | tar zxv -C .heroku/vendor &> /dev/null
|
curl "$VENDORED_MEMCACHED" -s | tar zxv -C .heroku/vendor &> /dev/null
|
||||||
|
mcount "steps.vendor.pylibmc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBMEMCACHED=$(pwd)/vendor
|
LIBMEMCACHED=$(pwd)/vendor
|
||||||
|
|||||||
@@ -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/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
|
/app/.heroku/python/bin/pip install "$ROOT_DIR/vendor/setuptools-39.0.1-py2.py3-none-any.whl" &> /dev/null
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
Executable
+32
@@ -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
|
||||||
Executable
+32
@@ -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
|
||||||
@@ -4,7 +4,7 @@ describe "Python!!!!!!!!!!!" do
|
|||||||
it "🐍" do
|
it "🐍" do
|
||||||
Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app|
|
Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app|
|
||||||
expect(app.output).to match(/Installing pip/)
|
expect(app.output).to match(/Installing pip/)
|
||||||
expect(app.run('python -V')).to match(/3.6.6/)
|
expect(app.run('python -V')).to match(/3.6.8/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
apache-airflow==1.10
|
apache-airflow==1.10.2
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,4 +6,4 @@ verify_ssl = true
|
|||||||
requests = "*"
|
requests = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.6"
|
python_version = "3.6"
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
[[source]]
|
||||||
|
url = "https://pypi.org/simple"
|
||||||
|
verify_ssl = true
|
||||||
|
name = "pypi"
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
|
||||||
|
[dev-packages]
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
python_version = "2.7"
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"_meta": {
|
||||||
|
"hash": {
|
||||||
|
"sha256": "ae4bdd7d4157baab65ae9d0e8389a6011e6b640995372c45ec81fa5d1ddfae9f"
|
||||||
|
},
|
||||||
|
"pipfile-spec": 6,
|
||||||
|
"requires": {
|
||||||
|
"python_version": "2.7"
|
||||||
|
},
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"name": "pypi",
|
||||||
|
"url": "https://pypi.org/simple",
|
||||||
|
"verify_ssl": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default": {},
|
||||||
|
"develop": {}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
requests
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
python-2.7.16
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
python-3.4.10
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
python-3.5.7
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
python-3.6.6
|
python-3.6.8
|
||||||
|
|||||||
-1
@@ -1 +0,0 @@
|
|||||||
python-3.6.7
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
flask
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
python-3.6.9
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
python-3.6.5
|
python-3.6.7
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
python-3.7.0
|
python-3.7.2
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
flask
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
python-3.7.3
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
requests
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
flask
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
testAirflow() {
|
testAirflow() {
|
||||||
export SLUGIFY_USES_TEXT_UNIDECODE="yes"
|
export SLUGIFY_USES_TEXT_UNIDECODE="yes"
|
||||||
compile "airflow"
|
compile "airflow"
|
||||||
assertCaptured "apache-airflow==1.10"
|
assertCaptured "apache-airflow==1.10.2"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,10 +19,15 @@ testPipenvLock() {
|
|||||||
|
|
||||||
testPipenvVersion() {
|
testPipenvVersion() {
|
||||||
compile "pipenv-version"
|
compile "pipenv-version"
|
||||||
assertCaptured "3.6.6"
|
assertCaptured "3.6.8"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testPipenvVersion2() {
|
||||||
|
compile "pipenv-version2"
|
||||||
|
assertCaptured "2.7.15"
|
||||||
|
assertCapturedSuccess
|
||||||
|
}
|
||||||
testPipenvFullVersion() {
|
testPipenvFullVersion() {
|
||||||
compile "pipenv-full-version"
|
compile "pipenv-full-version"
|
||||||
assertCaptured "3.6.3"
|
assertCaptured "3.6.3"
|
||||||
@@ -40,7 +45,8 @@ testCollectstatic() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testGEOS() {
|
testGEOS() {
|
||||||
BUILD_WITH_GEO_LIBRARIES=1 compile "geos"
|
export BUILD_WITH_GEO_LIBRARIES=1
|
||||||
|
compile "geos"
|
||||||
assertCaptured "geos"
|
assertCaptured "geos"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
@@ -52,7 +58,7 @@ testNLTK() {
|
|||||||
# be bad to silence in Production.
|
# be bad to silence in Production.
|
||||||
export PYTHONWARNINGS="ignore::RuntimeWarning"
|
export PYTHONWARNINGS="ignore::RuntimeWarning"
|
||||||
compile "nltk"
|
compile "nltk"
|
||||||
assertCaptured "Downloading NLTK packages: city_database stopwords"
|
assertCaptured "[nltk_data] Downloading package city_database" "STD_ERR"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,6 +93,18 @@ testPylibmc() {
|
|||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testPythonDefault() {
|
||||||
|
compile "pythonDefault"
|
||||||
|
assertCaptured "python-3.6.8"
|
||||||
|
assertCapturedSuccess
|
||||||
|
}
|
||||||
|
|
||||||
|
testPython2() {
|
||||||
|
compile "python2"
|
||||||
|
assertCaptured "python-2.7.15"
|
||||||
|
assertCapturedSuccess
|
||||||
|
}
|
||||||
|
|
||||||
testPython2_warn() {
|
testPython2_warn() {
|
||||||
compile "python2_warn"
|
compile "python2_warn"
|
||||||
if [[ $STACK = "heroku-18" ]]; then
|
if [[ $STACK = "heroku-18" ]]; then
|
||||||
@@ -98,31 +116,41 @@ testPython2_warn() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
testPython2() {
|
testPython2_fail() {
|
||||||
compile "python2"
|
compile "python2_fail"
|
||||||
assertCaptured "python-2.7.15"
|
assertCaptured "Aborting"
|
||||||
assertCapturedSuccess
|
assertCapturedError
|
||||||
|
}
|
||||||
|
|
||||||
|
testPython3_4() {
|
||||||
|
compile "python3_4"
|
||||||
|
assertCaptured "python-3.4.9"
|
||||||
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
# This fail
|
|
||||||
testPython3_4_warn() {
|
testPython3_4_warn() {
|
||||||
compile "python3_4_warn"
|
compile "python3_4_warn"
|
||||||
if [[ $STACK = "cedar-14" ]]; then
|
if [[ $STACK = "cedar-14" ]]; then
|
||||||
assertCaptured "python-3.4.0"
|
assertCaptured "python-3.4.0"
|
||||||
|
assertCaptured "security update!"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
else
|
else
|
||||||
assertCapturedError
|
assertCapturedError
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# This fail
|
testPython3_4_fail() {
|
||||||
testPython3_4() {
|
compile "python3_4_fail"
|
||||||
compile "python3_4"
|
assertCaptured "Aborting"
|
||||||
assertCaptured "python-3.4.9"
|
assertCapturedError
|
||||||
assertCapturedError
|
}
|
||||||
|
|
||||||
|
testPython3_5() {
|
||||||
|
compile "python3_5"
|
||||||
|
assertCaptured "python-3.5.6"
|
||||||
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
# This fail
|
|
||||||
testPython3_5_warn() {
|
testPython3_5_warn() {
|
||||||
compile "python3_5_warn"
|
compile "python3_5_warn"
|
||||||
if [[ $STACK = "cedar-14" ]]; then
|
if [[ $STACK = "cedar-14" ]]; then
|
||||||
@@ -134,32 +162,29 @@ testPython3_5_warn() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# This will fail
|
testPython3_5_fail() {
|
||||||
testPython3_5() {
|
compile "python3_5_fail"
|
||||||
compile "python3_5"
|
assertCaptured "Aborting"
|
||||||
assertCaptured "python-3.5.6"
|
assertCapturedError
|
||||||
assertCapturedError
|
|
||||||
}
|
|
||||||
|
|
||||||
# This will warn
|
|
||||||
testPython3_6_warn() {
|
|
||||||
compile "python3_6_warn"
|
|
||||||
assertCaptured "python-3.6.5"
|
|
||||||
assertCaptured "security update!"
|
|
||||||
assertCapturedSuccess
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testPython3_6() {
|
testPython3_6() {
|
||||||
compile "python3_6"
|
compile "python3_6"
|
||||||
assertCaptured "python-3.6.6"
|
assertCaptured "python-3.6.8"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
# This will fail
|
testPython3_6_warn() {
|
||||||
testPython3_6_7() {
|
compile "python3_6_warn"
|
||||||
compile "python3_6_7"
|
|
||||||
assertCaptured "python-3.6.7"
|
assertCaptured "python-3.6.7"
|
||||||
assertCapturedError
|
assertCaptured "security update!"
|
||||||
|
assertCapturedSuccess
|
||||||
|
}
|
||||||
|
|
||||||
|
testPython3_6_fail() {
|
||||||
|
compile "python3_6_fail"
|
||||||
|
assertCaptured "Aborting"
|
||||||
|
assertCapturedError
|
||||||
}
|
}
|
||||||
|
|
||||||
testPython3_7() {
|
testPython3_7() {
|
||||||
@@ -167,15 +192,25 @@ testPython3_7() {
|
|||||||
if [[ $STACK = "cedar-14" ]]; then
|
if [[ $STACK = "cedar-14" ]]; then
|
||||||
assertCapturedError
|
assertCapturedError
|
||||||
else
|
else
|
||||||
assertCaptured "python-3.7.0"
|
assertCaptured "python-3.7.2"
|
||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# This will fail
|
testPython3_7_warn() {
|
||||||
testPython3_7_1() {
|
compile "python3_7_warn"
|
||||||
compile "python3_7_1"
|
if [[ $STACK = "cedar-14" ]]; then
|
||||||
assertCaptured "python-3.7.1"
|
assertCapturedError
|
||||||
|
else
|
||||||
|
assertCaptured "python-3.7.1"
|
||||||
|
assertCaptured "security update!"
|
||||||
|
assertCapturedSuccess
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
testPython3_7_fail() {
|
||||||
|
compile "python3_7_fail"
|
||||||
|
assertCaptured "Aborting"
|
||||||
assertCapturedError
|
assertCapturedError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -83,7 +83,8 @@ assertCapturedNotEquals()
|
|||||||
|
|
||||||
assertCaptured()
|
assertCaptured()
|
||||||
{
|
{
|
||||||
assertFileContains "$@" "${STD_OUT}"
|
stdroute=${2:-STD_OUT}
|
||||||
|
assertFileContains "$1" "${!stdroute}"
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotCaptured()
|
assertNotCaptured()
|
||||||
@@ -94,7 +95,7 @@ assertNotCaptured()
|
|||||||
assertCapturedSuccess()
|
assertCapturedSuccess()
|
||||||
{
|
{
|
||||||
assertEquals "Captured exit code -" "0" "${RETURN}"
|
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
|
if [ $RETURN -ne 0 -a -z "$(cat ${STD_ERR})" ]; then
|
||||||
# Failing exit code but stderr was empty. Display stdout to help debugging.
|
# Failing exit code but stderr was empty. Display stdout to help debugging.
|
||||||
|
|||||||
Reference in New Issue
Block a user