Use `pbr` for setup configuration 21/24821/2
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 24 Nov 2016 06:01:47 +0000 (14:01 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 24 Nov 2016 09:06:18 +0000 (17:06 +0800)
- `pbr` does a bunch of things[1] and is used widely in OpenStack
- moved legacy `qtip.py` to scripts in order to keep the project folder clean

[1]: http://docs.openstack.org/developer/pbr/#what-it-does

Change-Id: I6a9b83883283eaa527e2c3d4cd8d221ee6efca41
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
__init__.py [deleted file]
docker/run_qtip.sh
qtip/__init__.py
scripts/qtip.py [moved from qtip.py with 100% similarity]
setup.cfg [new file with mode: 0644]
setup.py
tox.ini

diff --git a/__init__.py b/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
index a7a2050..c2cf8c7 100755 (executable)
@@ -1,20 +1,22 @@
 #! /bin/bash
 
+QTIP=scripts/qtip.py
+
 run_test_suite()
 {
     if [ "$TEST_CASE" == "compute" ]; then
-        cd ${QTIP_DIR}  && python qtip.py -l default -f compute
+        cd ${QTIP_DIR}  && python ${QTIP} -l default -f compute
         cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute
     elif [ "$TEST_CASE" == "storage" ]; then
-        cd ${QTIP_DIR}  && python qtip.py -l default -f storage
+        cd ${QTIP_DIR}  && python ${QTIP} -l default -f storage
         cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage
     elif [ "$TEST_CASE" == "network" ]; then
-        cd ${QTIP_DIR}  && python qtip.py -l default -f network
+        cd ${QTIP_DIR}  && python ${QTIP} -l default -f network
         cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network
     elif [ "$TEST_CASE" == "all" ]; then
-        cd ${QTIP_DIR}  && python qtip.py -l default -f compute
-        cd ${QTIP_DIR}  && python qtip.py -l default -f storage
-        cd ${QTIP_DIR}  && python qtip.py -l default -f network
+        cd ${QTIP_DIR}  && python ${QTIP} -l default -f compute
+        cd ${QTIP_DIR}  && python ${QTIP} -l default -f storage
+        cd ${QTIP_DIR}  && python ${QTIP} -l default -f network
 
         cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute
         cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage
index e69de29..228d036 100644 (file)
@@ -0,0 +1,14 @@
+##############################################################################
+# Copyright (c) 2016 ZTE Corp and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+import pbr.version
+
+
+__version__ = pbr.version.VersionInfo(
+    'qtip').version_string()
similarity index 100%
rename from qtip.py
rename to scripts/qtip.py
diff --git a/setup.cfg b/setup.cfg
new file mode 100644 (file)
index 0000000..42f8a61
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,22 @@
+[metadata]
+name = qtip
+summary = Platform Performance Benchmarking
+description-file =
+    README.md
+author = OPNFV
+author-email = opnfv-tech-discuss@lists.opnfv.org
+home-page = https://wiki.opnfv.org/display/qtip
+
+[global]
+setup-hooks =
+    pbr.hooks.setup_hook
+
+[entry_points]
+console_scripts =
+    qtip = qti.cli:entry
+
+[files]
+packages =
+    qtip
+data_files =
+    etc/qtip = benchmarks/*
index 1590036..ce14d42 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,19 +2,7 @@
 
 from setuptools import setup
 
-
 setup(
-    name='qtip-cli',
-    version='0.1.dev0',
-    description='Platform Performance Benchmarking for OPNFV',
-    author='OPNFV',
-    author_email='zhang.yujunz@zte.com.cn',
-    install_requires=['click', 'pyyaml', 'prettytable'],
-    packages=['qtip.cli'],
-    entry_points={
-        'console_scripts': ['qtip=qtip.cli.entry:cli']
-    },
-    license='Apache-2.0',
-    keywords="performance benchmark opnfv",
-    url="https://wiki.opnfv.org/display/qtip"
+    setup_requires=['pbr>=1.9', 'setuptools>=17.1'],
+    pbr=True,
 )
diff --git a/tox.ini b/tox.ini
index f5859b6..0ca9993 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -17,6 +17,8 @@ commands=
   py.test \
     --basetemp={envtmpdir}  \
     {posargs}
+setenv=
+  PYTHONPATH = {toxinidir}
 
 [testenv:pep8]
 deps = flake8