mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
b37090bc9b
Most recent version of setuptools breaks when asked to load requests 0.14.0.
symptom, complains about not being able to import filterfalse thus:
from six.moves import map, filter, filterfalse
this comes from setuptools, and older versions of setuptools don't have
this problem.
Various versions of centos7 and fedora have interesting names for packages,
centos7: python-pip is python2-pip
fedora24: python-virtualenv is python2-virtualenv
This is somewhat masked by using sudo yum: if the actual package
is installed, rpm knows that the capability is there and does nothing.
But, if the package isn't there, or you haven't chosen to set up
sudo to work that way, this does not work.
Signed-off-by: Marcus Watts <mwatts@redhat.com>
(cherry picked from commit ddc150439d
)
53 lines
1.9 KiB
Bash
Executable file
53 lines
1.9 KiB
Bash
Executable file
#!/bin/sh
|
|
set -e
|
|
|
|
if [ -f /etc/debian_version ]; then
|
|
for package in python-pip python-virtualenv python-dev libevent-dev; do
|
|
if [ "$(dpkg --status -- $package 2>/dev/null|sed -n 's/^Status: //p')" != "install ok installed" ]; then
|
|
# add a space after old values
|
|
missing="${missing:+$missing }$package"
|
|
fi
|
|
done
|
|
if [ -n "$missing" ]; then
|
|
echo "$0: missing required packages, please install them:" 1>&2
|
|
echo " sudo apt-get install $missing"
|
|
exit 1
|
|
fi
|
|
elif [ -f /etc/fedora-release ]; then
|
|
for package in python-pip python2-virtualenv python-devel libevent-devel; do
|
|
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
|
missing="${missing:+$missing }$package"
|
|
fi
|
|
done
|
|
if [ -n "$missing" ]; then
|
|
echo "$0: missing required RPM packages. Installing via sudo." 1>&2
|
|
sudo yum -y install $missing
|
|
fi
|
|
elif [ -f /etc/redhat-release ]; then
|
|
for package in python2-pip python-virtualenv python-devel libevent-devel; do
|
|
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
|
missing="${missing:+$missing }$package"
|
|
fi
|
|
done
|
|
if [ -n "$missing" ]; then
|
|
echo "$0: missing required packages, please install them:" 1>&2
|
|
echo " sudo yum install $missing"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
virtualenv --no-site-packages --distribute virtualenv
|
|
|
|
# avoid pip bugs
|
|
./virtualenv/bin/pip install --upgrade pip
|
|
|
|
# slightly old version of setuptools; newer fails w/ requests 0.14.0
|
|
./virtualenv/bin/pip install setuptools==32.3.1
|
|
|
|
./virtualenv/bin/pip install -r requirements.txt
|
|
|
|
# forbid setuptools from using the network because it'll try to use
|
|
# easy_install, and we really wanted pip; next line will fail if pip
|
|
# requirements.txt does not match setup.py requirements -- sucky but
|
|
# good enough for now
|
|
./virtualenv/bin/python setup.py develop
|