]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: only pip install after make clean 4627/head
authorLoic Dachary <ldachary@redhat.com>
Fri, 8 May 2015 18:53:54 +0000 (20:53 +0200)
committerLoic Dachary <ldachary@redhat.com>
Wed, 13 May 2015 06:35:53 +0000 (08:35 +0200)
Do not re-install all python dependencies if there already exists a
wheelhouse directory. It makes it so running install-deps.sh twice will
only access the network the first time. The directories where the python
dependencies are installed are removed by make clean. Refreshing the
python dependencies cache can be done via make clean ; install-deps.sh

Signed-off-by: Loic Dachary <ldachary@redhat.com>
Makefile.am
install-deps.sh

index eac97bd89147861ea00aa335a05bb0147df1ceed..f2d1e8c112bf574cb5ef895d16d970a4f5415d1c 100644 (file)
@@ -64,6 +64,7 @@ clean-local:
        fi
 
        @rm -rf src/test/virtualenv
+       @rm -rf install-deps-*
 
 
 # NOTE: This only works when enough dependencies are installed for
index 81ef5320f65adb5b3a13f64d19a65e8ab2781a7a..00de548906bf06d49c9ea53c3e9ea2c6730dee88 100755 (executable)
@@ -89,20 +89,26 @@ esac
 #
 for interpreter in python2.7 python3 ; do
     type $interpreter > /dev/null 2>&1 || continue
-    rm -fr install-deps
-    virtualenv --python $interpreter install-deps
-    . install-deps/bin/activate
-    pip --timeout 600 --log install-deps/log.txt install wheel || exit 1
-    find . -name tox.ini | while read ini ; do
-        (
-            cd $(dirname $ini)
-            require=$(ls *requirements.txt 2>/dev/null | sed -e 's/^/-r /')
-            if test "$require" ; then
+    if ! test -d install-deps-$interpreter ; then
+        virtualenv --python $interpreter install-deps-$interpreter
+        . install-deps-$interpreter/bin/activate
+        pip --timeout 300 install wheel || exit 1
+    fi
+done
+
+find . -name tox.ini | while read ini ; do
+    top_srcdir=$(pwd)
+    (
+        cd $(dirname $ini)
+        require=$(ls *requirements.txt 2>/dev/null | sed -e 's/^/-r /')
+        if test "$require" && ! test -d wheelhouse ; then
+            for interpreter in python2.7 python3 ; do
+                type $interpreter > /dev/null 2>&1 || continue
+                . $top_srcdir/install-deps-$interpreter/bin/activate
                 # although pip comes with virtualenv, having a recent version
                 # of pip matters when it comes to using wheel packages
-                pip --timeout 600 --log install-deps/log.txt wheel $require 'distribute >= 0.7' 'pip >= 6.1' || exit 1
-            fi
-        )
-    done
+                pip --timeout 300 wheel $require 'setuptools >= 0.7' 'pip >= 6.1' || exit 1
+            done
+        fi
+    )
 done
-rm -fr install-deps