diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index a5040abd159bdd7db4b7be8b9954163e2ca7a1f1..0000000000000000000000000000000000000000 --- a/.coveragerc +++ /dev/null @@ -1,3 +0,0 @@ -[run] -source = CLMCservice -omit = CLMCservice/tests.py diff --git a/setup.py b/setup.py index 08b25d9c6a2e565b527ebe77a1368fd116246c9d..300ceb07896049b3145baf04d374468b05392e1e 100644 --- a/setup.py +++ b/setup.py @@ -40,45 +40,22 @@ def get_version(fname): return git_revision -requires = [ - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_debugtoolbar', - 'waitress', - 'influxdb', -] - -tests_require = [ - 'WebTest >= 1.3.1', # py3 compat - 'pytest', - 'pytest-cov', -] - setup( - name = "CLMCservice", + name = "clmctest", version = get_version("clmctest/_version.py"), author = "Michael Boniface", author_email = "mjb@it-innovation.soton.ac.uk", - description = "FLAME CLMC Service and Test Module", - long_description="FLAME CLMC tests", + description = "FLAME CLMC Test Module", license = "https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc/blob/integration/LICENSE", - keywords = "FLAME CLMC service tests", - url = 'https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc', + keywords = "FLAME CLMC tests", + url='https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc', packages=find_packages(exclude=["services"]), include_package_data=True, - install_requires=requires, - extras_require={ - 'testing': tests_require, - }, package_data={'': ['_version.py', '*.yml', '*.sh', '*.json', '*.conf']}, + long_description="FLAME CLMC tests", classifiers=[ "Development Status :: Alpha", "Topic :: FLAME Tests", "License :: ", ], - entry_points={ - 'paste.app_factory': [ - 'main = CLMCservice:main', - ], - }, -) \ No newline at end of file +) diff --git a/src/clmcservice/.coveragerc b/src/clmcservice/.coveragerc new file mode 100644 index 0000000000000000000000000000000000000000..a3edc11a103c310fff7b5b2dc3ef5937f1dcfa0d --- /dev/null +++ b/src/clmcservice/.coveragerc @@ -0,0 +1,3 @@ +[run] +source = clmcservice +omit = clmcservice/tests.py diff --git a/src/clmcservice/MANIFEST.in b/src/clmcservice/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..eaf16db0e28d54b95ae8f085c1d4c3cfa1b8278d --- /dev/null +++ b/src/clmcservice/MANIFEST.in @@ -0,0 +1,2 @@ +include MANIFEST.in +recursive-include clmcservice \ No newline at end of file diff --git a/CLMCservice/__init__.py b/src/clmcservice/clmcservice/__init__.py similarity index 93% rename from CLMCservice/__init__.py rename to src/clmcservice/clmcservice/__init__.py index 80dfcc74f743b5e543ce9320d4e92541577b8f7b..9c6d4e7b7de62fc9476de5dc4f69daebceede078 100644 --- a/CLMCservice/__init__.py +++ b/src/clmcservice/clmcservice/__init__.py @@ -1,6 +1,6 @@ from pyramid.config import Configurator from pyramid.settings import asbool -from CLMCservice.views import AggregatorConfig +from clmcservice.views import AggregatorConfig def main(global_config, **settings): diff --git a/CLMCservice/tests.py b/src/clmcservice/clmcservice/tests.py similarity index 95% rename from CLMCservice/tests.py rename to src/clmcservice/clmcservice/tests.py index c475fa7fa0e49591d13aefbf718ae536c6ec5980..e3cc20214753cc365e2b43170600bc89a47a57fd 100644 --- a/CLMCservice/tests.py +++ b/src/clmcservice/clmcservice/tests.py @@ -26,7 +26,7 @@ class TestAggregatorConfig(object): Tests the GET method for the status of the aggregator. """ - from CLMCservice.views import AggregatorConfig # nested import so that importing the class view is part of the test itself + from clmcservice.views import AggregatorConfig # nested import so that importing the class view is part of the test itself assert not self.config.get_settings().get('aggregator_running'), "Initially aggregator is not running." @@ -54,7 +54,7 @@ class TestAggregatorConfig(object): :param output_val: the expected output value, None for expecting an Exception """ - from CLMCservice.views import AggregatorConfig # nested import so that importing the class view is part of the test itself + from clmcservice.views import AggregatorConfig # nested import so that importing the class view is part of the test itself assert not self.config.get_settings().get('aggregator_running'), "Initially aggregator is not running." diff --git a/CLMCservice/utilities.py b/src/clmcservice/clmcservice/utilities.py similarity index 100% rename from CLMCservice/utilities.py rename to src/clmcservice/clmcservice/utilities.py diff --git a/CLMCservice/views.py b/src/clmcservice/clmcservice/views.py similarity index 97% rename from CLMCservice/views.py rename to src/clmcservice/clmcservice/views.py index 4b92523509077c7b2319c3d0d625a880ebd5cdbb..d7c76d6ff120c7cdd1a6d5aaa688b81e9fb9f951 100644 --- a/CLMCservice/views.py +++ b/src/clmcservice/clmcservice/views.py @@ -1,7 +1,7 @@ from pyramid.view import view_defaults from pyramid.httpexceptions import HTTPBadRequest -from CLMCservice.utilities import str_to_bool +from clmcservice.utilities import str_to_bool @view_defaults(route_name='aggregator', renderer='json') diff --git a/development.ini b/src/clmcservice/development.ini similarity index 91% rename from development.ini rename to src/clmcservice/development.ini index 0d37eed41f6e4abf6db45b22dc6d186af0d77355..dc8949ddd68950fa9f0f891e76ec5a35d2ae8916 100644 --- a/development.ini +++ b/src/clmcservice/development.ini @@ -4,7 +4,7 @@ ### [app:main] -use = egg:CLMCservice +use = egg:clmcservice pyramid.reload_templates = true pyramid.debug_authorization = false @@ -32,7 +32,7 @@ listen = localhost:8080 ### [loggers] -keys = root, CLMCservice +keys = root, clmcservice [handlers] keys = console @@ -44,10 +44,10 @@ keys = generic level = INFO handlers = console -[logger_CLMCservice] +[logger_clmcservice] level = DEBUG handlers = -qualname = CLMCservice +qualname = clmcservice [handler_console] class = StreamHandler diff --git a/production.ini b/src/clmcservice/production.ini similarity index 90% rename from production.ini rename to src/clmcservice/production.ini index d127f3a092030526e856386b5498c6a23bfa5ade..b3c643959bf5284ab0febea91a56c4d24231bbf4 100644 --- a/production.ini +++ b/src/clmcservice/production.ini @@ -4,7 +4,7 @@ ### [app:main] -use = egg:CLMCservice +use = egg:clmcservice pyramid.reload_templates = false pyramid.debug_authorization = false @@ -27,7 +27,7 @@ listen = *:8080 ### [loggers] -keys = root, CLMCservice +keys = root, clmcservice [handlers] keys = console @@ -39,10 +39,10 @@ keys = generic level = WARN handlers = console -[logger_CLMCservice] +[logger_clmcservice] level = WARN handlers = -qualname = CLMCservice +qualname = clmcservice [handler_console] class = StreamHandler diff --git a/pytest.ini b/src/clmcservice/pytest.ini similarity index 54% rename from pytest.ini rename to src/clmcservice/pytest.ini index d30f667ec5a99c0f58df21f2c653592982fa731c..2fb94a6c8131efcc6dcc9357a5b56f68af607de3 100644 --- a/pytest.ini +++ b/src/clmcservice/pytest.ini @@ -1,3 +1,3 @@ [pytest] -testpaths = CLMCservice +testpaths = clmcservice python_files = *.py diff --git a/src/clmcservice/setup.py b/src/clmcservice/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..bbc0d79dd8bac5232554ed2b626932a37b2ca85d --- /dev/null +++ b/src/clmcservice/setup.py @@ -0,0 +1,84 @@ +""" +// © University of Southampton IT Innovation Centre, 2018 +// +// Copyright in this software belongs to University of Southampton +// IT Innovation Centre of Gamma House, Enterprise Road, +// Chilworth Science Park, Southampton, SO16 7NS, UK. +// +// This software may not be used, sold, licensed, transferred, copied +// or reproduced in whole or in part in any manner or form or in or +// on any media by any person other than in accordance with the terms +// of the Licence Agreement supplied with the software, or otherwise +// without the prior written consent of the copyright owners. +// +// This software is distributed WITHOUT ANY WARRANTY, without even the +// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +// PURPOSE, except where stated in the Licence Agreement supplied with +// the software. +// +// Created By : Michael Boniface +// Created Date : 25-03-2018 +// Created for Project : FLAME +""" + + +import os +import os.path +from setuptools import setup, find_packages + + +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + + +def get_version(fname): + if os.path.isfile(fname): + git_revision = read(fname) + else: + git_revision = "SNAPSHOT" + + return git_revision + + +requires = [ + 'plaster_pastedeploy', + 'pyramid', + 'pyramid_debugtoolbar', + 'waitress', + 'influxdb', +] + +tests_require = [ + 'WebTest >= 1.3.1', # py3 compat + 'pytest', + 'pytest-cov', +] + +setup( + name = "clmcservice", + version = get_version("_version.py"), + author = "Michael Boniface", + author_email = "mjb@it-innovation.soton.ac.uk", + description = "FLAME CLMC Service Module", + long_description="FLAME CLMC Service", + license = "https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc/blob/integration/LICENSE", + keywords = "FLAME CLMC service", + url = 'https://gitlab.it-innovation.soton.ac.uk/FLAME/flame-clmc', + packages=find_packages(), + include_package_data=True, + install_requires=requires, + extras_require={ + 'testing': tests_require, + }, + package_data={'': ['_version.py']}, + classifiers=[ + "Development Status :: Alpha", + "Topic :: FLAME CLMC Service", + "License :: ", + ], + entry_points={ + 'paste.app_factory': [ + 'main = clmcservice:main', + ], + }, +) \ No newline at end of file diff --git a/src/clmcservice/tox.ini b/src/clmcservice/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..b7fe1eac855e39b717787d62b2a9c2144d715b7e --- /dev/null +++ b/src/clmcservice/tox.ini @@ -0,0 +1,5 @@ +[tox] +envlist = py36 +[testenv] +deps=pytest +commands=pytest \ No newline at end of file