Pipenv development dependencies (ci) (#633)

* initial stab at pipenv --dev support

* test installation output

* locale fix

* refactor

* fix typo

* fix typo

* ellipsis

* polish
This commit is contained in:
2018-01-16 13:36:01 -05:00
committed by GitHub
parent 4a1fcafecc
commit 500daaf6fc
5 changed files with 24 additions and 7 deletions
+4
View File
@@ -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.
+2 -2
View File
@@ -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)
+8
View File
@@ -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
+6 -1
View File
@@ -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
+4 -4
View File
@@ -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"