From: Loic Dachary Date: Fri, 8 May 2015 18:53:54 +0000 (+0200) Subject: install-deps.sh: only pip install after make clean X-Git-Tag: v9.0.2~177^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=78c73c512aabaa6a15b4a9d63557554c9dcc5bdc;p=ceph.git install-deps.sh: only pip install after make clean 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 --- diff --git a/Makefile.am b/Makefile.am index eac97bd89147..f2d1e8c112bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/install-deps.sh b/install-deps.sh index 81ef5320f65a..00de548906bf 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -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