pip-uninstall 808 Bytes
Newer Older
Kenneth Reitz's avatar
Kenneth Reitz committed
1 2
#!/usr/bin/env bash

3 4
set +e
# Install dependencies with Pip.
5
# shellcheck source=bin/utils
6
source "$BIN_DIR/utils"
Kenneth Reitz's avatar
Kenneth Reitz committed
7

8
if [ ! "$SKIP_PIP_INSTALL" ]; then
9

10
  if [[ -f .heroku/python/requirements-declared.txt ]]; then
11

12
    cp .heroku/python/requirements-declared.txt requirements-declared.txt
13

Kenneth Reitz's avatar
Kenneth Reitz committed
14 15

    if ! pip-diff --stale requirements-declared.txt requirements.txt --exclude setuptools pip wheel > .heroku/python/requirements-stale.txt; then
16
      mcount "failure.bad-requirements"
Kenneth Reitz's avatar
Kenneth Reitz committed
17
    fi
18

19 20 21 22
    rm -fr requirements-declared.txt

    if [[ -s .heroku/python/requirements-stale.txt ]]; then
      puts-step "Uninstalling stale dependencies"
David Zülke's avatar
David Zülke committed
23
      /app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w --disable-pip-version-check | cleanup | indent
24
    fi
25
  fi
Kenneth Reitz's avatar
Kenneth Reitz committed
26

27
fi
Ed Morley's avatar
Ed Morley committed
28
set -e