From 7229a80279a19f24645a092670f77bcf19e6962b Mon Sep 17 00:00:00 2001 From: Chris MacNaughton Date: Fri, 24 Nov 2017 09:49:26 +0100 Subject: [PATCH] add basic setup for dependencies, and tox wrapping for testing --- .gitignore | 3 +++ VERSION | 1 + dependencies.txt | 1 + setup.py | 46 +++++++++++++++++++++++++++++++++++++++++++ test-requirements.txt | 7 +++++++ tox.ini | 30 ++++++++++++++++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 VERSION create mode 100644 dependencies.txt create mode 100644 setup.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index ee164ba..e232f02 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ xml/PenText.xpr .DS_Store *.orig + +chatops.egg-info +.tox \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/dependencies.txt b/dependencies.txt new file mode 100644 index 0000000..945c9b4 --- /dev/null +++ b/dependencies.txt @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e7c6991 --- /dev/null +++ b/setup.py @@ -0,0 +1,46 @@ +# Copyright 2016 RadicallyOpenSecurity B.V. + +import os + +from setuptools import setup, find_packages + + +version_file = os.path.abspath(os.path.join(os.path.dirname(__file__), + 'VERSION')) +with open(version_file) as v: + VERSION = v.read().strip() + + +SETUP = { + 'name': "chatops", + 'version': VERSION, + 'author': "RadicallyOpenSecurity", + 'url': "https://github.com/radicallyopensecurity/pentext", + 'install_requires': [ + 'lxml', + 'titlecase', + 'pyenchant', + 'pypandoc', + 'python-gitlab', + ], + 'packages': find_packages(), + 'scripts': [ + 'chatops/python/docbuilder.py', + 'chatops/python/gitlab-to-pentext.py', + 'chatops/python/pentext_id.py', + 'chatops/python/validate_report.py', + ], + # 'license': "Apache 2.0 (ASL)", + 'long_description': open('README.md').read(), + 'description': 'PenText system ', +} + + +# try: +# from sphinx_pypi_upload import UploadDoc +# SETUP['cmdclass'] = {'upload_sphinx': UploadDoc} +# except ImportError: +# pass + +if __name__ == '__main__': + setup(**SETUP) \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..bf1cda0 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,7 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. +coverage>=3.6 +flake8>=2.2.4,<=2.4.1 +mock>=1.2 +nose>=1.3.7 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..360908a --- /dev/null +++ b/tox.ini @@ -0,0 +1,30 @@ +[tox] +envlist = pep8 +skipsdist = True +skip_missing_interpreters = true + +[testenv] +basepython=python3.6 +install_command = pip install -U -v --no-cache-dir {opts} {packages} +usedevelop = True +commands = nosetests {toxinidir}/tests + +[testenv:py27] +basepython = python2.7 +deps = -r{toxinidir}/test-requirements.txt + +[testenv:py35] +basepython = python3.5 +deps = -r{toxinidir}/test-requirements.txt + +[testenv:py36] +deps = -r{toxinidir}/test-requirements.txt + +[flake8] +show-source = True +max-line-length = 160 + +[testenv:pep8] +basepython = python2.7 +commands = flake8 {posargs} chatops/python +deps = -r{toxinidir}/test-requirements.txt \ No newline at end of file