tox.ini 3.3 KB
Newer Older
1 2 3
#
# Tox global configuration
#
4
[tox]
5
envlist = py{35,36,37}
6 7
skip_missing_interpreters = true

8 9 10
#
# Defaults for all environments
#
11
# Anything specified here is inherited by the sections
12
#
13
[testenv]
14
commands =
15
    # Running with coverage reporting enabled
16
    py{35,36,37}-!external-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
17
    py{35,36,37}-!nocover: mkdir -p .coverage-reports
18
    external-!nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} --cov=buildstream --cov-append {posargs}
19 20
    py{35,36,37}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
    # Running with coverage reporting disabled
21 22
    py{35,36,37}-!external-nocover: pytest --basetemp {envtmpdir} {posargs}
    external-nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} {posargs}
23
deps =
24 25 26 27 28 29
    py{35,36,37}: -rrequirements/requirements.txt
    py{35,36,37}: -rrequirements/dev-requirements.txt
    py{35,36,37}: -rrequirements/plugin-requirements.txt

    # Only require coverage and pytest-cov when using it
    !nocover: -rrequirements/cov-requirements.txt
30
passenv =
31
    ARTIFACT_CACHE_SERVICE
32
    BST_FORCE_BACKEND
33 34
    GI_TYPELIB_PATH
    INTEGRATION_CACHE
35 36 37 38 39 40
    http_proxy
    HTTP_PROXY
    https_proxy
    HTTPS_PROXY
    no_proxy
    NO_PROXY
41 42
    REMOTE_EXECUTION_SERVICE
    SOURCE_CACHE_SERVICE
43
    SSL_CERT_FILE
44

45 46 47 48 49
#
# These keys are not inherited by any other sections
#
setenv =
    py{35,36,37}: COVERAGE_FILE = {envtmpdir}/.coverage
50 51 52 53
    py{35,36,37}: XDG_CACHE_HOME = {envtmpdir}/cache
    py{35,36,37}: XDG_CONFIG_HOME = {envtmpdir}/config
    py{35,36,37}: XDG_DATA_HOME = {envtmpdir}/share

54 55 56 57 58 59 60 61 62 63
whitelist_externals =
    py{35,36,37}:
        mv
        mkdir

#
# Coverage reporting
#
[testenv:coverage]
commands =
64 65 66
    coverage combine --rcfile={toxinidir}/.coveragerc {toxinidir}/.coverage-reports/
    coverage html --rcfile={toxinidir}/.coveragerc --directory={toxinidir}/.coverage-reports/
    coverage report --rcfile={toxinidir}/.coveragerc --show-missing
67 68 69
deps =
    -rrequirements/requirements.txt
    -rrequirements/dev-requirements.txt
70
    -rrequirements/cov-requirements.txt
71 72 73 74 75 76
setenv =
    COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage

#
# Running linters
#
77 78 79
[testenv:lint]
commands =
    pycodestyle
80
    pylint buildstream tests
81
deps =
82 83 84
    -rrequirements/requirements.txt
    -rrequirements/dev-requirements.txt
    -rrequirements/plugin-requirements.txt
85

86

87 88 89
#
# Building documentation
#
90 91 92
[testenv:docs]
commands =
    make -C doc
93
# sphinx_rtd_theme < 0.4.2 breaks search functionality for Sphinx >= 1.8
94
deps =
95
    sphinx == 1.8.5
96
    sphinx-click
97
    sphinx_rtd_theme >= 0.4.2
98
    pytest
99 100
    -rrequirements/requirements.txt
    -rrequirements/plugin-requirements.txt
101 102 103 104 105 106 107 108
passenv =
    BST_FORCE_SESSION_REBUILD
    BST_SOURCE_CACHE
    HOME
    LANG
    LC_ALL
whitelist_externals =
    make
109 110 111 112 113 114 115 116

#
# (re-)Generating man pages
#
[testenv:man]
commands =
    python3 setup.py --command-packages=click_man.commands man_pages
deps =
117
    click-man >= 0.3.0
118
    -rrequirements/requirements.txt
119 120 121 122 123 124 125 126 127 128 129

#
# Usefull for running arbitrary scripts in a BuildStream virtual env
#
[testenv:venv]
commands = {posargs}
deps =
    -rrequirements/requirements.txt
    -rrequirements/dev-requirements.txt
    -rrequirements/plugin-requirements.txt
whitelist_externals = *