From 11bb15178cb2bcf3aeaf11ad1e90d1854bb6e893 Mon Sep 17 00:00:00 2001 From: Nathan Buckner Date: Mon, 28 Sep 2015 16:18:25 -0500 Subject: [PATCH] Adding MANIFEST.in, test-requirements.txt, tox.ini to pass gate Change-Id: I7e05401b1f6b46829d8ab64fe3580b16719ec5f3 --- .gitreview | 4 ++++ MANIFEST.in | 1 + pip-requires | 2 +- setup.py | 10 ++++++---- syntribos/clients/http/parser.py | 2 +- syntribos/tests/fuzz/datagen.py | 2 +- test-requirements.txt | 2 ++ tox.ini | 20 ++++++++++++++++++++ 8 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 .gitreview create mode 100644 MANIFEST.in create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitreview b/.gitreview new file mode 100644 index 00000000..df9b98b8 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/syntribos diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..70a4fa78 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include README.md LICENSE pip-requires HISTORY.rst diff --git a/pip-requires b/pip-requires index b0962bf4..20558f1f 100644 --- a/pip-requires +++ b/pip-requires @@ -1 +1 @@ -opencafe +opencafe>=0.2.1,<0.2.2 diff --git a/setup.py b/setup.py index d09dcd36..1856956e 100644 --- a/setup.py +++ b/setup.py @@ -14,22 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. """ from setuptools import setup, find_packages +import os -requires = open('pip-requires').readlines() +base_path = os.path.dirname(os.path.abspath(__file__)) +requires = open(os.path.join(base_path, 'pip-requires')).readlines() setup( name='syntribos', version='0.0.1', description=('API Security Scanner'), long_description='{0}\n\n{1}'.format( - open('README.md').read(), - open('HISTORY.rst').read()), + open(os.path.join(base_path, 'README.md')).read(), + open(os.path.join(base_path, 'HISTORY.rst')).read()), author='Rackspace Cloud QE', author_email='nathan.buckner@rackspace.com', packages=find_packages(), include_package_data=True, install_requires=requires, - license=open('LICENSE').read(), + license=open(os.path.join(base_path, 'LICENSE')).read(), zip_safe=False, entry_points={'console_scripts': [ 'syntribos = syntribos.runner:entry_point']}, diff --git a/syntribos/clients/http/parser.py b/syntribos/clients/http/parser.py index e716fd37..c83ba1b4 100644 --- a/syntribos/clients/http/parser.py +++ b/syntribos/clients/http/parser.py @@ -40,7 +40,7 @@ class RequestCreator(object): break method, url, params, version = cls._parse_url_line(lines[0], endpoint) headers = cls._parse_headers(lines[1:index]) - data = cls._parse_data(lines[index+1:]) + data = cls._parse_data(lines[index + 1:]) return cls.request_model_type( method=method, url=url, headers=headers, params=params, data=data, action_field=action_field) diff --git a/syntribos/tests/fuzz/datagen.py b/syntribos/tests/fuzz/datagen.py index 9d02c420..16ee9763 100644 --- a/syntribos/tests/fuzz/datagen.py +++ b/syntribos/tests/fuzz/datagen.py @@ -49,7 +49,7 @@ class FuzzMixin(object): start, stop = match.span() yield "{0}{1}{2}".format( cls.remove_braces(data[:start]), - string, cls.remove_braces(data[stop+1:])) + string, cls.remove_braces(data[stop + 1:])) @classmethod def _build_combinations(cls, stri, dic, skip_var): diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..191e0ea2 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +flake8>=2.2.4,<=2.4.1 +nose diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..c683c7f1 --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +envlist=pep8,py27,py34 + +[testenv] +setenv=VIRTUAL_ENV={envdir} +deps=-r{toxinidir}/pip-requires + -r{toxinidir}/test-requirements.txt + +[testenv:py27] +commands=nosetests + +[testenv:py34] +commands=nosetests + +[testenv:pep8] +commands=flake8 + +[flake8] +ignore=F401,E402 +