Commit cbb718bb authored by Ed Morley's avatar Ed Morley Committed by Kenneth Reitz

Fix pip uninstall by moving it prior to pip install (#413)

The pip-uninstall step stopped working when it was moved to after
the pip-install step in f27a84e0.

This regression was temporarily fixed by part of #397, however that
PR was reverted in #404.

Adds a test to hopefully catch any future regressions :-)

Fixes #393.
parent db95cdd3
# Python Buildpack Changelog # Python Buildpack Changelog
# Unreleased
Fixed automatic pip uninstall of dependencies removed from requirements.txt.
# 109 # 109
Fix output for collectstatic step. Fix output for collectstatic step.
......
...@@ -170,16 +170,16 @@ sub-env $BIN_DIR/steps/geo-libs ...@@ -170,16 +170,16 @@ sub-env $BIN_DIR/steps/geo-libs
# GDAL support. # GDAL support.
source $BIN_DIR/steps/gdal source $BIN_DIR/steps/gdal
# Install dependencies with Pip (where the magic happens).
let start=$(nowms)
source $BIN_DIR/steps/pip-install
mtime "pip.install.time" "${start}"
# Uninstall removed dependencies with Pip. # Uninstall removed dependencies with Pip.
let start=$(nowms) let start=$(nowms)
source $BIN_DIR/steps/pip-uninstall source $BIN_DIR/steps/pip-uninstall
mtime "pip.uninstall.time" "${start}" mtime "pip.uninstall.time" "${start}"
# Install dependencies with Pip (where the magic happens).
let start=$(nowms)
source $BIN_DIR/steps/pip-install
mtime "pip.install.time" "${start}"
# Support for NLTK corpora. # Support for NLTK corpora.
let start=$(nowms) let start=$(nowms)
sub-env $BIN_DIR/steps/nltk sub-env $BIN_DIR/steps/nltk
......
...@@ -62,6 +62,16 @@ testPython3() { ...@@ -62,6 +62,16 @@ testPython3() {
assertCapturedSuccess assertCapturedSuccess
} }
testSmartRequirements() {
local cache_dir="$(mktmpdir)"
compile "requirements-standard" "$cache_dir"
assertFile "requests" ".heroku/python/requirements-declared.txt"
assertCapturedSuccess
compile "psycopg2" "$cache_dir"
assertCaptured "Uninstalling requests"
assertFile "psycopg2" ".heroku/python/requirements-declared.txt"
assertCapturedSuccess
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment