Skip to content
Snippets Groups Projects
Commit cede7382 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-627: Update minimal python version

In addition this patch prepares our tox.ini for tox version 4
by better preventing system wide binary access using tox built in
variables.
parent 0585be44
No related branches found
No related tags found
1 merge request!252L2SS-627: Update minimal python version
...@@ -17,7 +17,6 @@ classifier = ...@@ -17,7 +17,6 @@ classifier =
Operating System :: POSIX :: Linux Operating System :: POSIX :: Linux
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
...@@ -27,7 +26,7 @@ classifier = ...@@ -27,7 +26,7 @@ classifier =
package_dir= package_dir=
=./ =./
packages=find: packages=find:
python_requires = >=3.6 python_requires = >=3.7
[options.packages.find] [options.packages.find]
where=./ where=./
......
[tox] [tox]
minversion = 2.0 minversion = 3.20
envlist = py36,py37,py38,py39,py310,pep8 envlist = py37,py38,py39,py310,pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
usedevelop = True usedevelop = True
; Module access is a bit of an ugly hack. This is due to testenv inheritance
; with sitepackages = True`, meaning that global packages can be accessed by the
; tox environment. Our tango images already have several dependencies system
; wide installed, however, the system wide installation will never look inside
; tox its virtualenv for packages. So accessing stestr and others fail.. We
; can't remove `sitepackages = True` either as we need access to tango and
; installing this package is non-trivial. The solution is to prevent calling
; binaries directly and utilizing python and tox variables to resolve the
; requested module.
sitepackages = True sitepackages = True
install_command = pip3 install {opts} {packages} install_command = {envbindir}/pip3 install {opts} {packages}
passenv = HOME passenv = HOME
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps = deps =
-r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = stestr run {posargs} commands = {envpython} -m stestr run {posargs}
[testenv:integration] [testenv:integration]
; Warning running integration tests will make changes to your docker system! ; Warning running integration tests will make changes to your docker system!
...@@ -25,39 +31,30 @@ commands = stestr run {posargs} ...@@ -25,39 +31,30 @@ commands = stestr run {posargs}
passenv = TANGO_HOST passenv = TANGO_HOST
setenv = TESTS_DIR=./tangostationcontrol/integration_test/{posargs} setenv = TESTS_DIR=./tangostationcontrol/integration_test/{posargs}
commands = commands =
stestr run --serial {envpython} -m stestr run --serial
; The access to coverage as module is a bit of an ugly hack. This is due to
; cover inheriting testenv which has `sitepackages = True`, meaning that global
; packages can be accessed by the tox environment. Our tango images already have
; coverage system wide installed, however, the system wide installation will
; never look inside tox its virtualenv for packages. So accessing stestr and
; others fail.. We can't remove `sitepackages = True` either as we need access
; to tango and installing this package is non-trivial. The solution is to
; prevent calling binaries directly and utilizing python to resolve the
; requested module. In addition stestr does not natively support generating
; coverage reports which is where the `PYTHON=python -m coverage run....` comes
; from.
[testenv:cover] [testenv:cover]
; stestr does not natively support generating coverage reports use
; `PYTHON=python -m coverage run....` to overcome this.
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
PYTHON=python -m coverage run --source tangostationcontrol --parallel-mode PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode
deps = 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
-r{toxinidir}/test-requirements.txt
commands = commands =
python -m coverage erase {envpython} -m coverage erase
stestr run {posargs} {envpython} -m stestr run {posargs}
python -m coverage combine {envpython} -m coverage combine
python -m coverage html -d cover {envpython} -m coverage html -d cover
python -m coverage xml -o coverage.xml {envpython} -m coverage xml -o coverage.xml
python -m coverage report {envpython} -m coverage report
; TODO(Corne): Integrate Hacking to customize pep8 rules ; TODO(Corne): Integrate Hacking to customize pep8 rules
[testenv:pep8] [testenv:pep8]
commands = commands =
doc8 docs/source/ --ignore D001 {envpython} -m doc8 docs/source/ --ignore D001
flake8 {envpython} -m flake8
[testenv:bandit]; [testenv:bandit];
; B104: hardcoded_bind_all_interfaces ; B104: hardcoded_bind_all_interfaces
...@@ -65,11 +62,11 @@ commands = ...@@ -65,11 +62,11 @@ commands =
; It thus matters what interfaces Docker will bind our ; It thus matters what interfaces Docker will bind our
; containers to, not what our containers listen on. ; containers to, not what our containers listen on.
commands = commands =
bandit -r devices/ -n5 -ll -s B104 {envpython} -m bandit -r devices/ -n5 -ll -s B104
[testenv:xenon]; [testenv:xenon];
commands = commands =
xenon tangostationcontrol -b B -m A -a A {envpython} -m xenon tangostationcontrol -b B -m A -a A
[testenv:docs] [testenv:docs]
deps = deps =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment