From: Loic Dachary Date: Sat, 2 May 2015 13:59:12 +0000 (+0200) Subject: install-deps.sh: pip wheel for python dependencies X-Git-Tag: v9.0.2~221^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b7953affc22d9fba95e364d0cc5f1b332269aa5;p=ceph.git install-deps.sh: pip wheel for python dependencies For all tox.ini in the source tree which also have requirement.txt files, create a wheelhouse with the dependencies. This allows tox to setup test environment with no access to the network with something like (in tox.ini): deps = --use-wheel --find-links={toxinidir}/wheelhouse -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt Signed-off-by: Loic Dachary --- diff --git a/install-deps.sh b/install-deps.sh index 6fea6bdd182..dbc720b8772 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -2,7 +2,7 @@ # # Ceph distributed storage system # -# Copyright (C) 2014 Red Hat +# Copyright (C) 2014, 2015 Red Hat # # Author: Loic Dachary # @@ -83,3 +83,26 @@ CentOS|Fedora|RedHatEnterpriseServer) echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually." ;; esac + +# +# preload python modules so that tox can run without network access +# +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 install wheel + 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 + # although pip comes with virtualenv, having a recent version + # of pip matters when it comes to using wheel packages + pip wheel $require 'distribute >= 0.7' 'pip >= 6.1' + fi + ) + done +done +rm -fr install-deps