Skip to content
Snippets Groups Projects
Commit 5b480fd9 authored by Klaas Kliffen's avatar Klaas Kliffen :satellite:
Browse files

Start on tox

parent 4580a08c
No related branches found
No related tags found
1 merge request!5Resolve CWG-11 "Features/ add tox"
Pipeline #39015 passed
...@@ -3,5 +3,4 @@ include README.md ...@@ -3,5 +3,4 @@ include README.md
include VERSION include VERSION
recursive-include docs * recursive-include docs *
recursive-exclude tests * recursive-exclude tests *
black
build
flake8
pylint
tox.ini 0 → 100644
[tox]
# Generative environment list to test all supported Python versions
envlist = py3{7,8,9,10},black,pep8,pylint
minversion = 3.18.0
# Source distributions are explicitly build using tox -e build
skipsdist = True
[testenv]
usedevelop = True
setenv =
LANGUAGE=en_US
LC_ALL=en_US.UTF-8
PYTHONWARNINGS=default::DeprecationWarning
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/tests/requirements.txt
commands =
{envpython} --version
stestr run {posargs}
# Use generative name and command prefixes to reuse the same virtualenv
# for all linting jobs.
[testenv:{pep8,black,pylint}]
usedevelop = False
envdir = {toxworkdir}/linting
commands =
pep8: {envpython} -m flake8 --version
pep8: {envpython} -m flake8
black: {envpython} -m black --version
black: {envpython} -m black --check --diff .
pylint: {envpython} -m pylint --version
pylint: {envpython} -m pylint lofar_station_client
[testenv:debug]
commands = {envpython} -m testtools.run {posargs}
[testenv:coverage]
; stestr does not natively support generating coverage reports use
; `PYTHON=python -m coverage run....` to overcome this.
setenv =
PYTHON={envpython} -m coverage run --source lofar_station_client --omit='*tests*' --parallel-mode
commands =
{envpython} -m coverage erase
{envpython} -m stestr run {posargs}
{envpython} -m coverage combine
{envpython} -m coverage html -d cover --omit='*tests*'
{envpython} -m coverage xml -o coverage.xml
{envpython} -m coverage report --omit='*tests*'
[testenv:build]
usedevelop = False
commands = {envpython} -m build
[testenv:docs]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/docs/requirements.txt
commands = sphinx-build -b html -W docs/source docs/build/html
[testenv:integration]
# Do no install the lofar station client package, force packaged version install
skip_install = true
# Intentionally break import paths if not installed from package
changedir={toxinidir}/integration
# Allow bash for wheel file substitution
allowlist_external =
bash
commands =
# We need the bash substitutions here
bash -ec 'pip install --force-reinstall {toxinidir}/dist/*.whl'
{envpython} -m stestr run --serial {posargs}
[flake8]
filename = *.py
exclude=.tox,.egg-info
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment