Skip to content

Commit 4e496ed

Browse files
committed
Make sure pip version is able to support external sources
1 parent bcde23d commit 4e496ed

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tools/python/setup.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ EOF
2929

3030
if virtualenv --system-site-packages .; then
3131
echo -e;
32-
(
33-
source bin/activate
34-
pip install --upgrade pip
35-
)
3632
else
3733
cat <<EOF
3834
Was unable to set up the virtualenv environment. Please see output for errors.
@@ -43,17 +39,22 @@ fi
4339

4440
source bin/activate
4541

46-
# Check if the dependencies are installed
47-
pip install --no-download -r requirements.txt > /dev/null 2>&1
48-
if [ $? -ne 0 ]; then
49-
# Install dependencies
50-
pip install -r requirements.txt --upgrade
42+
function ensureRequirementsMet() {
43+
# Check if installed
44+
pip install --no-download $@ > /dev/null 2>&1
5145
if [ $? -ne 0 ]; then
52-
cat <<EOF
53-
Unable to install the required dependencies. Please see error output above.
46+
# Install dependencies
47+
pip install --upgrade $@
48+
if [ $? -ne 0 ]; then
49+
cat <<EOF
50+
Unable to install dependencies. Please see error output above.
5451
EOF
55-
exit 1
52+
exit 1
53+
fi
5654
fi
57-
fi
55+
}
56+
57+
ensureRequirementsMet 'pip>=1.5'
58+
ensureRequirementsMet -r requirements.txt
5859

5960
cd $OLD_PWD

0 commit comments

Comments
 (0)