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

Faster pipenv (#385)

* skip pip install for pipenv

* better

* improvements

* indent

* chmod +x

* export

* skip uninstall too

* pip freeze

* Revert "skip uninstall too"

This reverts commit faac96f62004f78c3d27a92cd865954fc7a3a53d.

* better comments

* redirect stderr to stdout
parent 9157111d
No related branches found
No related tags found
No related merge requests found
# Install dependencies with Pip.
puts-step "Installing requirements with pip"
if [ ! "$SKIP_PIP_INSTALL" ]; then
set +e
/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]}"
set -e
# Install dependencies with Pip.
puts-step "Installing requirements with pip"
show-warnings
set +e
/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]}"
set -e
if [[ ! $PIP_STATUS -eq 0 ]]; then
exit 1
fi
show-warnings
if [[ ! $PIP_STATUS -eq 0 ]]; then
exit 1
fi
# Smart Requirements handling
cp requirements.txt .heroku/python/requirements-declared.txt
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
echo
# Smart Requirements handling
cp requirements.txt .heroku/python/requirements-declared.txt
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
echo
fi
\ No newline at end of file
# Pipenv support (Generate requriements.txt with pipenv).
if [[ -f Pipfile ]]; then
if [[ ! -f requirements.txt ]]; then
puts-step "Generating 'requirements.txt' with pipenv"
puts-step "Installing requirements with latest pipenv..."
# Install pipenv.
/app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
/app/.heroku/python/bin/pipenv lock --requirements --no-hashes > $BUILD_DIR/requirements.txt 2> /dev/null
# Install the dependencies.
/app/.heroku/python/bin/pipenv install --system 2>&1 | indent
# Skip pip install, later.
export SKIP_PIP_INSTALL=1
# Pip freeze, for compatibility.
/app/.heroku/python/bin/pip freeze > requirements.txt
fi
fi
\ No newline at end of file
File mode changed from 100644 to 100755
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