]> git-server-git.apps.pok.os.sepia.ceph.com Git - ragweed.git/commitdiff
add virtualenv creation utils
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 24 Jan 2017 23:18:50 +0000 (15:18 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 24 Jan 2017 23:18:50 +0000 (15:18 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
bootstrap [new file with mode: 0755]
requirements.txt [new file with mode: 0644]
setup.py [new file with mode: 0644]

diff --git a/bootstrap b/bootstrap
new file mode 100755 (executable)
index 0000000..907596c
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,43 @@
+#!/bin/sh
+set -e
+
+if [ -f /etc/debian_version ]; then
+    for package in python-pip python-virtualenv python-dev python-six libevent-dev libxml2-dev libxslt-dev zlib1g-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 DEB packages. Installing via sudo." 1>&2
+        sudo apt-get -y install $missing
+    fi
+fi
+if [ -f /etc/redhat-release ]; then
+    for package in python-pip python-virtualenv python-devel python-six libevent-devel libxml2-devel libxslt-devel zlib-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
+fi
+
+virtualenv --no-site-packages --distribute virtualenv
+
+# avoid pip bugs
+./virtualenv/bin/pip install --upgrade pip
+
+# work-around change in pip 1.5
+./virtualenv/bin/pip install six
+./virtualenv/bin/pip install setuptools --no-use-wheel --upgrade
+
+./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
diff --git a/requirements.txt b/requirements.txt
new file mode 100644 (file)
index 0000000..1a17333
--- /dev/null
@@ -0,0 +1,6 @@
+PyYAML
+nose >=1.0.0
+boto >=2.6.0
+bunch >=1.0.0
+httplib2
+lxml
diff --git a/setup.py b/setup.py
new file mode 100644 (file)
index 0000000..9229f22
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+from setuptools import setup, find_packages
+
+setup(
+    name='ragweed',
+    version='0.0.1',
+    packages=find_packages(),
+
+    author='Yehuda Sadeh',
+    author_email='yehuda@redhat.com',
+    description='A test suite for ceph rgw',
+    license='MIT',
+    keywords='ceph rgw testing',
+
+    install_requires=[
+        'boto >=2.0b4',
+        'PyYAML',
+        'bunch >=1.0.0',
+        'gevent >=1.0',
+        'isodate >=0.4.4',
+        ],
+
+    #entry_points={
+    #    'console_scripts': [
+    #        'ragweed = ragweed:main',
+    #        ],
+    #    },
+
+    )