add basic setup for dependencies, and tox wrapping for testing

This commit is contained in:
Chris MacNaughton 2017-11-24 09:49:26 +01:00
parent a80649e1a8
commit 7229a80279
6 changed files with 88 additions and 0 deletions

3
.gitignore vendored
View File

@ -8,3 +8,6 @@ xml/PenText.xpr
.DS_Store
*.orig
chatops.egg-info
.tox

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.0.1

1
dependencies.txt Normal file
View File

@ -0,0 +1 @@
.

46
setup.py Normal file
View File

@ -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)

7
test-requirements.txt Normal file
View File

@ -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

30
tox.ini Normal file
View File

@ -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