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

Pipenv development dependencies (ci) (#633)

* initial stab at pipenv --dev support

* test installation output

* locale fix

* refactor

* fix typo

* fix typo

* ellipsis

* polish
parent 4a1fcafe
No related branches found
No related tags found
No related merge requests found
# Python Buildpack Changelog # Python Buildpack Changelog
# 124
Update buildpack to automatically install [dev-packages] (Pipenv) during Heroku CI builds.
# 123 # 123
Update gunicorn init.d script to allow overrides. Update gunicorn init.d script to allow overrides.
......
...@@ -23,7 +23,7 @@ Deploying a Python application couldn't be easier: ...@@ -23,7 +23,7 @@ Deploying a Python application couldn't be easier:
$ git push heroku master $ git push heroku master
-----> Python app detected -----> Python app detected
-----> Installing python-3.6.3 -----> Installing python-3.6.4
-----> Installing pip -----> Installing pip
-----> Installing requirements with latest pipenv… -----> Installing requirements with latest pipenv…
... ...
...@@ -58,7 +58,7 @@ Or, more specifically: ...@@ -58,7 +58,7 @@ Or, more specifically:
Runtime options include: Runtime options include:
- `python-3.6.3` - `python-3.6.4`
- `python-2.7.14` - `python-2.7.14`
- `pypy-5.7.1` (unsupported, experimental) - `pypy-5.7.1` (unsupported, experimental)
- `pypy3-5.5.1` (unsupported, experimental) - `pypy3-5.5.1` (unsupported, experimental)
...@@ -29,4 +29,12 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then ...@@ -29,4 +29,12 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
echo 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 fi
...@@ -16,13 +16,18 @@ if [[ -f Pipfile ]]; then ...@@ -16,13 +16,18 @@ if [[ -f Pipfile ]]; then
# Install pipenv. # Install pipenv.
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null /app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
# Install the dependencies.
if [[ ! -f Pipfile.lock ]]; then if [[ ! -f Pipfile.lock ]]; then
/app/.heroku/python/bin/pipenv install --system --skip-lock 2>&1 | indent /app/.heroku/python/bin/pipenv install --system --skip-lock 2>&1 | indent
else else
/app/.heroku/python/bin/pipenv install --system --deploy 2>&1 | indent /app/.heroku/python/bin/pipenv install --system --deploy 2>&1 | indent
fi 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. # Skip pip install, later.
export SKIP_PIP_INSTALL=1 export SKIP_PIP_INSTALL=1
......
...@@ -6,8 +6,8 @@ BIN_DIR=$(cd "$(dirname "$0")" || return; pwd) # absolute path ...@@ -6,8 +6,8 @@ BIN_DIR=$(cd "$(dirname "$0")" || return; pwd) # absolute path
# shellcheck source=bin/utils # shellcheck source=bin/utils
source "$BIN_DIR/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 DISABLE_COLLECTSTATIC=1 INSTALL_TEST=1 "$(dirname "${0:-}")/compile" "$1" "$2" "$3"
/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 \ No newline at end of file
fi
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