]> git.proxmox.com Git - ceph.git/blob - ceph/src/tools/setup-virtualenv.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / tools / setup-virtualenv.sh
1 #!/bin/bash
2 #
3 # Copyright (C) 2016 <contact@redhat.com>
4 #
5 # Author: Loic Dachary <loic@dachary.org>
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Library Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Library Public License for more details.
16 #
17
18 DIR=$1
19 rm -fr $DIR
20 mkdir -p $DIR
21 virtualenv --python python2.7 $DIR
22 . $DIR/bin/activate
23
24 if pip --help | grep -q disable-pip-version-check; then
25 DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check
26 else
27 DISABLE_PIP_VERSION_CHECK=
28 fi
29
30 # older versions of pip will not install wrap_console scripts
31 # when using wheel packages
32 pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install --upgrade 'pip >= 6.1'
33
34 if pip --help | grep -q disable-pip-version-check; then
35 DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check
36 else
37 DISABLE_PIP_VERSION_CHECK=
38 fi
39
40 if test -d wheelhouse ; then
41 export NO_INDEX=--no-index
42 fi
43
44 pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse 'tox >=1.9'
45 if test -f requirements.txt ; then
46 pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse -r requirements.txt
47 fi