diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6a7d7a0fe28e1355254c786b41c44b0f7bf257..f36c0a921d6b2633a9376e52d0c928f9f6df96be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Python Buildpack Changelog +# 124 + +Update buildpack to automatically install [dev-packages] (Pipenv) during Heroku CI builds. + # 123 Update gunicorn init.d script to allow overrides. diff --git a/README.md b/README.md index df808ebe5d667d2de7aea58d79a8872a438400d9..7ec68184e0f42f9a9390700ce6bb979b34a490bb 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Deploying a Python application couldn't be easier: $ git push heroku master … -----> Python app detected - -----> Installing python-3.6.3 + -----> Installing python-3.6.4 -----> Installing pip -----> Installing requirements with latest pipenv… ... @@ -58,7 +58,7 @@ Or, more specifically: Runtime options include: -- `python-3.6.3` +- `python-3.6.4` - `python-2.7.14` - `pypy-5.7.1` (unsupported, experimental) - `pypy3-5.5.1` (unsupported, experimental) diff --git a/bin/steps/pip-install b/bin/steps/pip-install index e0d5dd391e096bfc7c605c4cf6b19d65b4bd4d6a..be92bd14d457e9b55dd1b5f6fec7646c769fe9d9 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -29,4 +29,12 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt echo + + # Install test dependencies, for CI. + if [ "$INSTALL_TEST" ]; then + if [[ -f "$1/requirements-test.txt" ]]; then + puts-step "Installing test dependencies…" + /app/.heroku/python/bin/pip install -r "$1/requirements-test.txt" --exists-action=w --src=./.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | cleanup | indent + fi + fi fi diff --git a/bin/steps/pipenv b/bin/steps/pipenv index 857bcd82890a8a02832d989ca0d271838b0ef98a..5e050f740938ac88539ae485ed49d04682fac2d5 100644 --- a/bin/steps/pipenv +++ b/bin/steps/pipenv @@ -16,13 +16,18 @@ if [[ -f Pipfile ]]; then # Install pipenv. /app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null + # Install the dependencies. if [[ ! -f Pipfile.lock ]]; then /app/.heroku/python/bin/pipenv install --system --skip-lock 2>&1 | indent else /app/.heroku/python/bin/pipenv install --system --deploy 2>&1 | indent fi - # Install the dependencies. + # Install the test dependencies, for CI. + if [ "$INSTALL_TEST" ]; then + puts-step "Installing test dependencies…" + /app/.heroku/python/bin/pipenv install --dev --system --deploy 2>&1 | cleanup | indent + fi # Skip pip install, later. export SKIP_PIP_INSTALL=1 diff --git a/bin/test-compile b/bin/test-compile index d19814dbbe6bd55413a972fd0ed711ed89bc2c57..fa4a6580a3e7eb2158165f47cc46f37ee1d5e6b2 100755 --- a/bin/test-compile +++ b/bin/test-compile @@ -6,8 +6,8 @@ BIN_DIR=$(cd "$(dirname "$0")" || return; pwd) # absolute path # shellcheck source=bin/utils source "$BIN_DIR/utils" -DISABLE_COLLECTSTATIC=1 "$(dirname "${0:-}")/compile" "$1" "$2" "$3" +# Locale support for Pipenv. +export LC_ALL=C.UTF-8 +export LANG=C.UTF-8 -if [[ -f "$1/requirements-test.txt" ]]; then - /app/.heroku/python/bin/pip install -r "$1/requirements-test.txt" --exists-action=w --src=./.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | cleanup | indent -fi +DISABLE_COLLECTSTATIC=1 INSTALL_TEST=1 "$(dirname "${0:-}")/compile" "$1" "$2" "$3" \ No newline at end of file