From c112ef81adcf717a60d9e4abac07a257e282df31 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Thu, 12 Nov 2020 13:43:49 +0000 Subject: [PATCH] Remove unused pip-uninstall step (#1117) The pip-uninstall step has been unused for pip-using apps since #925, since the buildpack now invalidates the entire package cache instead. Whilst the step appears to still be used for pipenv-using apps, the code is not run, since `SKIP_PIP_INSTALL=1` is set too early. This bug was introduced in a334672a1a2814509f4bad06139786e497adbf3f which landed straight to `master` two days after the feature was introduced in #650. Longer term we should likely get pipenv installs to do something similar to pip (invalidate the whole cache based on checksum of the lockfile), however for now I'm removing this deadcode since it's the last consumer of the `pip-diff` script which we want to remove. Closes @W-8386830@. [skip changelog] --- Makefile | 2 +- bin/steps/pip-uninstall | 28 ---------------------------- bin/steps/pipenv | 1 - 3 files changed, 1 insertion(+), 30 deletions(-) delete mode 100755 bin/steps/pip-uninstall diff --git a/Makefile b/Makefile index 185fc2f..8ad8c13 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ STACK_IMAGE_TAG := heroku/$(subst -,:,$(STACK))-build check: @shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings bin/default_pythons - @shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/nltk bin/steps/pip-install bin/steps/pip-uninstall bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/python + @shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/nltk bin/steps/pip-install bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/python @shellcheck -x bin/steps/hooks/* test: diff --git a/bin/steps/pip-uninstall b/bin/steps/pip-uninstall deleted file mode 100755 index 4e0ad91..0000000 --- a/bin/steps/pip-uninstall +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set +e -# Install dependencies with Pip. -# shellcheck source=bin/utils -source "$BIN_DIR/utils" - -if [ ! "$SKIP_PIP_INSTALL" ]; then - - if [[ -f .heroku/python/requirements-declared.txt ]]; then - - cp .heroku/python/requirements-declared.txt requirements-declared.txt - - - if ! pip-diff --stale requirements-declared.txt requirements.txt --exclude setuptools pip wheel > .heroku/python/requirements-stale.txt; then - mcount "failure.bad-requirements" - fi - - rm -rf requirements-declared.txt - - if [[ -s .heroku/python/requirements-stale.txt ]]; then - puts-step "Uninstalling stale dependencies" - /app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w --disable-pip-version-check | cleanup | indent - fi - fi - -fi -set -e diff --git a/bin/steps/pipenv b/bin/steps/pipenv index 4f2600a..bbbbb15 100755 --- a/bin/steps/pipenv +++ b/bin/steps/pipenv @@ -69,7 +69,6 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then else pipenv-to-pip Pipfile.lock > requirements.txt - "$BIN_DIR/steps/pip-uninstall" cp requirements.txt .heroku/python/requirements-declared.txt openssl dgst -sha256 Pipfile.lock > .heroku/python/Pipfile.lock.sha256