From 45b78ab587f4e601d3e605bed0fc7e70f521a460 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 9 Oct 2018 14:46:49 -0500 Subject: [PATCH 1/2] pin pip version used by pipenv --- bin/steps/pip-install | 4 ++-- bin/steps/pipenv | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/steps/pip-install b/bin/steps/pip-install index 5de8e3d..d7ffa82 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -13,7 +13,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then # and makes them accessible to the pip install process. # # PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used. - if [[ -r $ENV_DIR/PIP_EXTRA_INDEX_URL ]]; then + if [[ -r "$ENV_DIR/PIP_EXTRA_INDEX_URL" ]]; then PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")" export PIP_EXTRA_INDEX_URL mcount "buildvar.PIP_EXTRA_INDEX_URL" @@ -22,7 +22,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then set +e # Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10 - if [[ -r $ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE ]]; then + if [[ -r "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE" ]]; then SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")" export SLUGIFY_USES_TEXT_UNIDECODE mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE" diff --git a/bin/steps/pipenv b/bin/steps/pipenv index 31b479b..1190621 100755 --- a/bin/steps/pipenv +++ b/bin/steps/pipenv @@ -20,7 +20,6 @@ if [[ -f Pipfile.lock ]]; then export SKIP_PIPENV_INSTALL=1 export SKIP_PIP_INSTALL=1 fi - fi fi fi @@ -40,14 +39,14 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then # and makes them accessible to the pip install process. # # PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used. - if [[ -r $ENV_DIR/PIP_EXTRA_INDEX_URL ]]; then + if [[ -r "$ENV_DIR/PIP_EXTRA_INDEX_URL" ]]; then PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")" export PIP_EXTRA_INDEX_URL mcount "buildvar.PIP_EXTRA_INDEX_URL" fi # Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10 - if [[ -r $ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE ]]; then + if [[ -r "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE" ]]; then SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")" export SLUGIFY_USES_TEXT_UNIDECODE mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE" @@ -56,7 +55,10 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then export PIPENV_VERSION="2018.5.18" # Install pipenv. - /app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade &> /dev/null + # Due to weird old pip behavior and pipenv behavior, pipenv upgrades pip + # to latest if only --upgrade is specified. Specify upgrade strategy to + # avoid this eager behavior. + /app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade --upgrade-strategy only-if-needed &> /dev/null # Install the dependencies. if [[ ! -f Pipfile.lock ]]; then From a7a5971372753eabbb19430d5725e18faf1cd4b2 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Wed, 10 Oct 2018 09:23:54 -0500 Subject: [PATCH 2/2] changelog update --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 108a0ea..1a5e3a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Python Buildpack Changelog +# 141 (2018-10-10) + +Switch to cautious upgrade for Pipenv install to ensure the pinned pip version +is used with Pipenv + # 140 (2018-10-09) Add support for detecting SLUGIFY_USES_TEXT_UNIDECODE, which is required to