mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
500daaf6fc
* initial stab at pipenv --dev support * test installation output * locale fix * refactor * fix typo * fix typo * ellipsis * polish
40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# export CLINT_FORCE_COLOR=1
|
|
# export PIPENV_FORCE_COLOR=1
|
|
# shellcheck source=bin/utils
|
|
source $BIN_DIR/utils
|
|
|
|
# Pipenv support (Generate requriements.txt with pipenv).
|
|
if [[ -f Pipfile ]]; then
|
|
if [[ ! -f requirements.txt ]]; then
|
|
puts-step "Installing requirements with latest Pipenv…"
|
|
|
|
# Measure that we're using Pipenv.
|
|
mcount "tool.pipenv"
|
|
|
|
# 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 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
|
|
|
|
# Pip freeze, for compatibility.
|
|
/app/.heroku/python/bin/pip freeze > requirements.txt
|
|
|
|
fi
|
|
fi
|