]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: robust pip and wheel installation
authorLoic Dachary <ldachary@redhat.com>
Thu, 28 May 2015 23:34:45 +0000 (01:34 +0200)
committerLoic Dachary <ldachary@redhat.com>
Fri, 29 May 2015 21:43:06 +0000 (23:43 +0200)
The wheel and pip module must not only be installed in each wheelhouse
directory for tox to find. They must also be installed in the virtual
environment that populates the wheelhouse directory. Otherwise older pip
modules such as the one found by default on Ubuntu 12.04 will fail.

Python 2.7.3 on Ubuntu 12.04 also requires that distribute >= 0.7.3 is
installed although it is redundant with setuptools, otherwise it will
fail to run the wheel module.

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

index 00de548906bf06d49c9ea53c3e9ea2c6730dee88..e074f6de465d481c6b0c35449ba5a0082a654b82 100755 (executable)
@@ -84,6 +84,16 @@ CentOS|Fedora|RedHatEnterpriseServer)
         ;;
 esac
 
+function get_pip_and_wheel() {
+    local install=$1
+
+    # Ubuntu-12.04 and Python 2.7.3 require this line
+    pip --timeout 300 $install 'distribute >= 0.7.3' || return 1
+    # although pip comes with virtualenv, having a recent version
+    # of pip matters when it comes to using wheel packages
+    pip --timeout 300 $install 'setuptools >= 0.8' 'pip >= 7.0' 'wheel >= 0.24' || return 1
+}
+
 #
 # preload python modules so that tox can run without network access
 #
@@ -92,7 +102,7 @@ for interpreter in python2.7 python3 ; do
     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
+        get_pip_and_wheel install || exit 1
     fi
 done
 
@@ -105,9 +115,8 @@ find . -name tox.ini | while read ini ; do
             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 300 wheel $require 'setuptools >= 0.7' 'pip >= 6.1' || exit 1
+                get_pip_and_wheel wheel || exit 1
+                pip --timeout 300 wheel $require || exit 1
             done
         fi
     )