Skip to content
Snippets Groups Projects
Select Git revision
  • 5b480fd92a9d12e171bf759f5b4e164e75f3031c
  • main default protected
  • add-editorconfig
3 results

tox.ini

Blame
  • Klaas's avatar
    Klaas Kliffen authored
    5b480fd9
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    tox.ini 2.21 KiB
    [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