From 5f6941f04a084f859908921afcfe4c483e174b80 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 10 Nov 2020 14:33:52 +0000 Subject: [PATCH] Remove redundant Mercurial install step (#1111) Mercurial is installed in the stack image for all stacks, so the pip install of packages from Mercurial VCS URLs works without the need for the buildpack to install it itself. See: https://github.com/heroku/stack-images/pull/141 https://github.com/heroku/stack-images/search?q=mercurial Closes @W-7906950@. --- CHANGELOG.md | 1 + Makefile | 2 +- bin/compile | 6 ------ bin/steps/mercurial | 9 --------- test/fixtures/requirements-mercurial/requirements.txt | 1 + test/run-deps | 6 ++++++ 6 files changed, 9 insertions(+), 16 deletions(-) delete mode 100755 bin/steps/mercurial create mode 100644 test/fixtures/requirements-mercurial/requirements.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index dde59cd..70808c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Remove redundant Mercurial install step (#1111). - Remove support for the Cedar-14 stack (#1110). ## v184 (2020-10-21) diff --git a/Makefile b/Makefile index 48b3fef..84668a7 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/gdal bin/steps/geo-libs bin/steps/mercurial 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/gdal bin/steps/geo-libs 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/hooks/* test: diff --git a/bin/compile b/bin/compile index 1ba32a7..150dc83 100755 --- a/bin/compile +++ b/bin/compile @@ -263,12 +263,6 @@ fi # shellcheck source=bin/steps/eggpath-fix source "$BIN_DIR/steps/eggpath-fix" -# Mercurial support. -# If a customer appears to be using mercurial for dependency resolution, we install it first. -# Note: this only applies to pip, not pipenv. This can likely be removed, over time. Measure it first. -# shellcheck source=bin/steps/mercurial -source "$BIN_DIR/steps/mercurial" - # Support for Geo libraries. This is deprecated functionality. # It is undocumented. # shellcheck source=bin/steps/geo-libs diff --git a/bin/steps/mercurial b/bin/steps/mercurial deleted file mode 100755 index c36cb9a..0000000 --- a/bin/steps/mercurial +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Install Mercurial if it appears to be required. -if [[ -f "requirements.txt" ]]; then - if (grep -Fiq "hg+" requirements.txt) then - /app/.heroku/python/bin/pip install mercurial | cleanup | indent - mcount "steps.mercurial" - fi -fi diff --git a/test/fixtures/requirements-mercurial/requirements.txt b/test/fixtures/requirements-mercurial/requirements.txt new file mode 100644 index 0000000..08ee098 --- /dev/null +++ b/test/fixtures/requirements-mercurial/requirements.txt @@ -0,0 +1 @@ +hg+https://www.mercurial-scm.org/repo/python-hglib/#egg=python-hglib diff --git a/test/run-deps b/test/run-deps index beb87f6..4af435f 100755 --- a/test/run-deps +++ b/test/run-deps @@ -74,6 +74,12 @@ testPylibmc() { assertCapturedSuccess } +testMercurial() { + compile "requirements-mercurial" + assertCaptured "Cloning hg" + assertCapturedSuccess +} + pushd $(dirname 0) >/dev/null popd >/dev/null