From 65648fb7a802078e125f4e0926b2042ba1f55b11 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz <me@kennethreitz.org>
Date: Thu, 16 Mar 2017 12:44:36 -0400
Subject: [PATCH] fix tests

---
 bin/compile      |  6 +++---
 bin/steps/pipenv |  1 +
 bin/steps/python | 24 ++++--------------------
 test/run         |  1 -
 4 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/bin/compile b/bin/compile
index 3f3c04c9..e46316e4 100755
--- a/bin/compile
+++ b/bin/compile
@@ -158,9 +158,6 @@ source $BIN_DIR/steps/python
 # Sanity check for setuptools/distribute.
 source $BIN_DIR/steps/setuptools
 
-# Fix egg-links.
-source $BIN_DIR/steps/eggpath-fix
-
 # Pipenv support.
 source $BIN_DIR/steps/pipenv
 
@@ -169,6 +166,9 @@ if [ ! -f requirements.txt ] && [ ! -f Pipfile ]; then
   echo "-e ." > requirements.txt
 fi
 
+# Fix egg-links.
+source $BIN_DIR/steps/eggpath-fix
+
 # Mercurial support.
 source $BIN_DIR/steps/mercurial
 
diff --git a/bin/steps/pipenv b/bin/steps/pipenv
index 60b64305..7b8aff94 100644
--- a/bin/steps/pipenv
+++ b/bin/steps/pipenv
@@ -4,6 +4,7 @@ if [[ -f Pipfile ]]; then
         puts-step "Generating 'requirements.txt' with pipenv"
 
         /app/.heroku/python/bin/pip install pipenv --upgrade &> /dev/null
+
         /app/.heroku/python/bin/pipenv lock --requirements --no-hashes > $BUILD_DIR/requirements.txt 2> /dev/null
     fi
 fi
\ No newline at end of file
diff --git a/bin/steps/python b/bin/steps/python
index b95f2007..14789dff 100755
--- a/bin/steps/python
+++ b/bin/steps/python
@@ -56,28 +56,12 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then
   trap "rm -rf $TMPTARDIR" RETURN
 
   puts-step "Installing pip"
-  /app/.heroku/python/bin/python $ROOT_DIR/vendor/get-pip.py &> /dev/null
-
-  # bpwatch start install_setuptools
-  #   # Prepare it for the real world
-  #   puts-step "Installing Setuptools ($SETUPTOOLS_VERSION)"
-  #   tar zxf $ROOT_DIR/vendor/setuptools-$SETUPTOOLS_VERSION.tar.gz -C $TMPTARDIR
-  #   cd $TMPTARDIR/setuptools-$SETUPTOOLS_VERSION/
-  #   /app/.heroku/python/bin/python setup.py install  &> /dev/null
-  #   cd $WORKING_DIR
-  # bpwatch stop install_setuptoools
-
-  # bpwatch start install_pip
-  #   puts-step "Installing Pip ($PIP_VERSION)"
-  #   tar zxf $ROOT_DIR/vendor/pip-$PIP_VERSION.tar.gz -C $TMPTARDIR
-  #   cd $TMPTARDIR/pip-$PIP_VERSION/
-  #   /app/.heroku/python/bin/python setup.py install &> /dev/null
-  #   cd $WORKING_DIR
-
-  # bpwatch stop install_pip
-
 
+  # Remove old installations.
+  rm -fr /app/.heroku/python/lib/python2.7/site-packages/pip-*
+  rm -fr /app/.heroku/python/lib/python2.7/site-packages/setuptools-*
 
+  /app/.heroku/python/bin/python $ROOT_DIR/vendor/get-pip.py &> /dev/null
 
   bpwatch stop prepare_environment
 fi
diff --git a/test/run b/test/run
index c14b2b1f..e1a23a1c 100755
--- a/test/run
+++ b/test/run
@@ -3,7 +3,6 @@
 
 testPipenv() {
   compile "pipenv"
-  debug
   assertCapturedSuccess
 }
 
-- 
GitLab