]> git.proxmox.com Git - ceph.git/blame - ceph/src/tools/setup-virtualenv.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / tools / setup-virtualenv.sh
CommitLineData
7c673cae
FG
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
18DIR=$1
19rm -fr $DIR
20mkdir -p $DIR
21virtualenv --python python2.7 $DIR
22. $DIR/bin/activate
23
24if pip --help | grep -q disable-pip-version-check; then
25 DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check
26else
27 DISABLE_PIP_VERSION_CHECK=
28fi
29
30# older versions of pip will not install wrap_console scripts
31# when using wheel packages
32pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install --upgrade 'pip >= 6.1'
33
34if pip --help | grep -q disable-pip-version-check; then
35 DISABLE_PIP_VERSION_CHECK=--disable-pip-version-check
36else
37 DISABLE_PIP_VERSION_CHECK=
38fi
39
40if test -d wheelhouse ; then
41 export NO_INDEX=--no-index
42fi
43
44pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --use-wheel --find-links=file://$(pwd)/wheelhouse 'tox >=1.9'
45if 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
47fi