Skip to content

Commit e094c54

Browse files
authored
Merge pull request #769 from heroku/pip-pipenv-pin
Pin pip version used by pipenv
2 parents 63e84ac + a7a5971 commit e094c54

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Python Buildpack Changelog
22

3+
# 141 (2018-10-10)
4+
5+
Switch to cautious upgrade for Pipenv install to ensure the pinned pip version
6+
is used with Pipenv
7+
38
# 140 (2018-10-09)
49

510
Add support for detecting SLUGIFY_USES_TEXT_UNIDECODE, which is required to

bin/steps/pip-install

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
1313
# and makes them accessible to the pip install process.
1414
#
1515
# PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used.
16-
if [[ -r $ENV_DIR/PIP_EXTRA_INDEX_URL ]]; then
16+
if [[ -r "$ENV_DIR/PIP_EXTRA_INDEX_URL" ]]; then
1717
PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")"
1818
export PIP_EXTRA_INDEX_URL
1919
mcount "buildvar.PIP_EXTRA_INDEX_URL"
@@ -22,7 +22,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
2222
set +e
2323

2424
# Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10
25-
if [[ -r $ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE ]]; then
25+
if [[ -r "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE" ]]; then
2626
SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")"
2727
export SLUGIFY_USES_TEXT_UNIDECODE
2828
mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE"

bin/steps/pipenv

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if [[ -f Pipfile.lock ]]; then
2020
export SKIP_PIPENV_INSTALL=1
2121
export SKIP_PIP_INSTALL=1
2222
fi
23-
2423
fi
2524
fi
2625
fi
@@ -40,14 +39,14 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then
4039
# and makes them accessible to the pip install process.
4140
#
4241
# PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used.
43-
if [[ -r $ENV_DIR/PIP_EXTRA_INDEX_URL ]]; then
42+
if [[ -r "$ENV_DIR/PIP_EXTRA_INDEX_URL" ]]; then
4443
PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")"
4544
export PIP_EXTRA_INDEX_URL
4645
mcount "buildvar.PIP_EXTRA_INDEX_URL"
4746
fi
4847

4948
# Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10
50-
if [[ -r $ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE ]]; then
49+
if [[ -r "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE" ]]; then
5150
SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")"
5251
export SLUGIFY_USES_TEXT_UNIDECODE
5352
mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE"
@@ -56,7 +55,10 @@ if [ ! "$SKIP_PIPENV_INSTALL" ]; then
5655
export PIPENV_VERSION="2018.5.18"
5756

5857
# Install pipenv.
59-
/app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade &> /dev/null
58+
# Due to weird old pip behavior and pipenv behavior, pipenv upgrades pip
59+
# to latest if only --upgrade is specified. Specify upgrade strategy to
60+
# avoid this eager behavior.
61+
/app/.heroku/python/bin/pip install pipenv==$PIPENV_VERSION --upgrade --upgrade-strategy only-if-needed &> /dev/null
6062

6163
# Install the dependencies.
6264
if [[ ! -f Pipfile.lock ]]; then

0 commit comments

Comments
 (0)