From 6200c67619329f686dfb888ac7ef25469375df83 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Thu, 24 Nov 2016 14:01:47 +0800 Subject: Use `pbr` for setup configuration - `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 --- __init__.py | 0 docker/run_qtip.sh | 14 ++++++++------ qtip.py | 18 ------------------ qtip/__init__.py | 14 ++++++++++++++ scripts/qtip.py | 18 ++++++++++++++++++ setup.cfg | 22 ++++++++++++++++++++++ setup.py | 16 ++-------------- tox.ini | 2 ++ 8 files changed, 66 insertions(+), 38 deletions(-) delete mode 100644 __init__.py delete mode 100644 qtip.py create mode 100644 scripts/qtip.py create mode 100644 setup.cfg diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/docker/run_qtip.sh b/docker/run_qtip.sh index a7a20501..c2cf8c7b 100755 --- a/docker/run_qtip.sh +++ b/docker/run_qtip.sh @@ -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 diff --git a/qtip.py b/qtip.py deleted file mode 100644 index 66ff674f..00000000 --- a/qtip.py +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################## -# Copyright (c) 2015 Dell Inc and others. -# 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 -############################################################################## -from qtip.utils.cli import Cli - - -def main(): - Cli() - - -if __name__ == "__main__": - main() diff --git a/qtip/__init__.py b/qtip/__init__.py index e69de29b..228d036f 100644 --- a/qtip/__init__.py +++ b/qtip/__init__.py @@ -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() diff --git a/scripts/qtip.py b/scripts/qtip.py new file mode 100644 index 00000000..66ff674f --- /dev/null +++ b/scripts/qtip.py @@ -0,0 +1,18 @@ +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# 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 +############################################################################## +from qtip.utils.cli import Cli + + +def main(): + Cli() + + +if __name__ == "__main__": + main() diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..42f8a61d --- /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/* diff --git a/setup.py b/setup.py index 15900362..ce14d42e 100644 --- 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 f5859b6e..0ca99932 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,8 @@ commands= py.test \ --basetemp={envtmpdir} \ {posargs} +setenv= + PYTHONPATH = {toxinidir} [testenv:pep8] deps = flake8 -- cgit 1.2.3-korg