summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 4f61cccf73fae57fcc6dedcb6a31c228bb8b0eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#
# Tox global configuration
#
[tox]
envlist = py{35,36,37}
skip_missing_interpreters = true

#
# Defaults for all environments
#
# Anything specified here is inherited by the sections
#
[testenv]
commands =
    # Running with coverage reporting enabled
    py{35,36,37}-!external-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
    py{35,36,37}-!nocover: mkdir -p .coverage-reports
    external-!nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} --cov=buildstream --cov-append {posargs}
    py{35,36,37}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
    # Running with coverage reporting disabled
    py{35,36,37}-!external-nocover: pytest --basetemp {envtmpdir} {posargs}
    external-nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} {posargs}
deps =
    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
passenv =
    BST_FORCE_BACKEND
    GI_TYPELIB_PATH
    INTEGRATION_CACHE
    http_proxy
    HTTP_PROXY
    https_proxy
    HTTPS_PROXY
    no_proxy
    NO_PROXY
    SSL_CERT_FILE

#
# These keys are not inherited by any other sections
#
setenv =
    py{35,36,37}: COVERAGE_FILE = {envtmpdir}/.coverage
whitelist_externals =
    py{35,36,37}:
        mv
        mkdir

#
# Coverage reporting
#
[testenv:coverage]
commands =
    - coverage combine --rcfile={toxinidir}/.coveragerc {toxinidir}/.coverage-reports/
    coverage report --rcfile={toxinidir}/.coveragerc -m
deps =
    -rrequirements/requirements.txt
    -rrequirements/dev-requirements.txt
    -rrequirements/cov-requirements.txt
setenv =
    COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage

#
# Running linters
#
[testenv:lint]
commands =
    pycodestyle
    pylint buildstream
deps =
    -rrequirements/requirements.txt
    -rrequirements/dev-requirements.txt
    -rrequirements/plugin-requirements.txt


#
# Building documentation
#
[testenv:docs]
commands =
    make -C doc
# sphinx_rtd_theme < 0.4.2 breaks search functionality for Sphinx >= 1.8
deps =
    sphinx
    sphinx-click
    sphinx_rtd_theme >= 0.4.2
    pytest
    -rrequirements/requirements.txt
    -rrequirements/plugin-requirements.txt
passenv =
    BST_FORCE_SESSION_REBUILD
    BST_SOURCE_CACHE
    HOME
    LANG
    LC_ALL
whitelist_externals =
    make

#
# (re-)Generating man pages
#
[testenv:man]
commands =
    python3 setup.py --command-packages=click_man.commands man_pages
deps =
    click-man >= 0.3.0
    -rrequirements/requirements.txt

#
# 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 = *