diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d9cd916b381ae1c2162720bb52c66efd4abcc4a..be4e30a13225e420d31abdbafd5957c3976c52d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,12 @@ image: artefact.skatelescope.org/ska-tango-images/tango-itango:9.3.3.7 variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - PBR_VERSION: "0.1" cache: paths: - .cache/pip - .tox -before_script: - - pip install tox +#before_script: +# - pip install tox stages: - linting - unit-tests @@ -15,8 +14,10 @@ linting: stage: linting allow_failure: true script: + - cd devices - tox -e pep8 unit_test: stage: unit-tests script: + - cd devices - tox -e py37 \ No newline at end of file diff --git a/.stestr.conf b/.stestr.conf deleted file mode 100644 index 10b8cdff7374e1fcec831f0bd206018814ac5ce3..0000000000000000000000000000000000000000 --- a/.stestr.conf +++ /dev/null @@ -1,3 +0,0 @@ -[DEFAULT] -test_path=./devices/test -top_dir=./ \ No newline at end of file diff --git a/devices/.stestr.conf b/devices/.stestr.conf new file mode 100644 index 0000000000000000000000000000000000000000..da4cd7aead6c305333a7802cf4e55e931554664c --- /dev/null +++ b/devices/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./test +top_dir=./ \ No newline at end of file diff --git a/devices/__init__.py b/devices/__init__.py index efefae1d5db0635d66689134d6ec2972e0f230d8..329b61fa54fd8d6afeee2937b3f6cd2c12efb711 100644 --- a/devices/__init__.py +++ b/devices/__init__.py @@ -1,7 +1,3 @@ -import pbr.version +from util.lofar_git import get_version -__version__ = pbr.version.VersionInfo( - 'TangoStationControl').version_string() -# from ._version import get_versions -# __version__ = get_versions()['version'] -# del get_versions +__version__ = get_version() diff --git a/requirements.txt b/devices/requirements.txt similarity index 100% rename from requirements.txt rename to devices/requirements.txt diff --git a/setup.cfg b/devices/setup.cfg similarity index 92% rename from setup.cfg rename to devices/setup.cfg index bc2b0d00865fc794bf9bde4eb7251ddf9e5e5463..3b338be4eea38f05c1e3403b0b2366a672b4dc32 100644 --- a/setup.cfg +++ b/devices/setup.cfg @@ -24,10 +24,10 @@ classifier = [files] packages = - devices + ./ [entry_points] console_scripts = - SDP = devices.SDP:main - PCC = devices.PCC:main + SDP = SDP:main + PCC = PCC:main diff --git a/devices/setup.py b/devices/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..c9cac6d255e727d8a3eca85a860afae1d77d8afc --- /dev/null +++ b/devices/setup.py @@ -0,0 +1,3 @@ +import setuptools + +setuptools.setup(setup_requires=['pbr>=2.0.0'], pbr=True) diff --git a/test-requirements.txt b/devices/test-requirements.txt similarity index 84% rename from test-requirements.txt rename to devices/test-requirements.txt index 3a6dd8dca9f0b9725cc3a55a00bfa6a7fd9a231b..e5a7e45d435a74c9021efa81fe1213104650250c 100644 --- a/test-requirements.txt +++ b/devices/test-requirements.txt @@ -5,11 +5,8 @@ coverage>=5.2.0 # Apache-2.0 doc8>=0.8.0 # Apache-2.0 hacking>=3.2.0,<3.3.0 # Apache-2.0 -#mypy>=0.812 # MIT python-subunit>=1.4.0 # Apache-2.0/BSD Pygments>=2.6.0 -#oslotest>=4.4.0 # Apache-2.0 -#oslo.messaging>=12.2.0 # Apache-2.0 stestr>=3.0.0 # Apache-2.0 testscenarios>=0.5.0 # Apache-2.0/BSD testtools>=2.4.0 # MIT diff --git a/devices/test/base.py b/devices/test/base.py index c3335dad5b6c10678f777928ff4ea7be3ef02a3f..5ef98096a1fd5187e83e5046b36a5ecbab757e03 100644 --- a/devices/test/base.py +++ b/devices/test/base.py @@ -7,10 +7,11 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. +import unittest import testscenarios -class BaseTestCase(testscenarios.WithScenarios): +class BaseTestCase(testscenarios.WithScenarios, unittest.TestCase): """Test base class.""" def setUp(self): diff --git a/devices/test/sdp/test_sdp.py b/devices/test/sdp/test_sdp.py index 5929acc0967b1710dba1666cb6660ddfb1495cb6..fd50438b0a60313d657ccd4284d24076f256927d 100644 --- a/devices/test/sdp/test_sdp.py +++ b/devices/test/sdp/test_sdp.py @@ -7,9 +7,9 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -from devices.SDP import SDP +from SDP import SDP -from devices.test import base +from test import base class TestSDP(base.TestCase): diff --git a/tox.ini b/devices/tox.ini similarity index 75% rename from tox.ini rename to devices/tox.ini index 1bd6bef4abadd7be647f36e553dd1b7fe1e661ff..88d048b1e994ca79ce1727fb3c4d397c45fcbbe7 100644 --- a/tox.ini +++ b/devices/tox.ini @@ -14,11 +14,11 @@ setenv = OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 deps = -r{toxinidir}/test-requirements.txt - -r{toxinidir}/docker-compose/lofar-device-base/lofar-requirements.txt + -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt commands = stestr run {posargs} [testenv:pep8] commands = ; doc8 doc/source/ README.rst - flake8 devices/{posargs} - bandit -r devices -x test -n5 -ll # -s B320 \ No newline at end of file + flake8 ./{posargs} + bandit -r ./ -x test -n5 -ll # -s B320 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 41c6476e1e62e0f9acd05e34c1b8e403ccdd8d83..0000000000000000000000000000000000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -import setuptools - -setuptools.setup(setup_requires=['pbr>=2.0.0'], pbr=True) \ No newline at end of file