-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathtox.ini
More file actions
271 lines (242 loc) · 7.65 KB
/
tox.ini
File metadata and controls
271 lines (242 loc) · 7.65 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Tox global configuration
#
[tox]
envlist = py{310,311,312,313,314}
skip_missing_interpreters = true
isolated_build = true
# Configuration variables to share across environments
[config]
BST_PLUGINS_COMMUNITY_VERSION = 637e2d95e656b9d46575da5737b65fd0cc25dce2 # 2.1.0
BST_PLUGINS_VERSION = 79649529cffb695d0d22195ed9a4910c80ca6907 # 2.5.0
#
# Defaults for all environments
#
# Anything specified here is inherited by the sections
#
[testenv]
usedevelop =
# This is required by Cython in order to get coverage for cython files.
py{310,311,312,313,314}-!nocover: True
commands =
# Running with coverage reporting enabled
py{310,311,312,313,314}-!plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
# Running with coverage reporting disabled
py{310,311,312,313,314}-!plugins-nocover: pytest --basetemp {envtmpdir} {posargs}
# Running external plugins tests with coverage reporting enabled
py{310,311,312,313,314}-plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc --plugins {posargs}
# Running external plugins tests with coverage disabled
py{310,311,312,313,314}-plugins-nocover: pytest --basetemp {envtmpdir} --plugins {posargs}
commands_post:
py{310,311,312,313,314}-!nocover: mkdir -p .coverage-reports
py{310,311,312,313,314}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
deps =
py{310,311,312,313,314}: -rrequirements/requirements.txt
py{310,311,312,313,314}: -rrequirements/dev-requirements.txt
py{310,311,312,313,314}: git+https://github.com/apache/buildstream-plugins.git@{env:BST_PLUGINS_VERSION:{[config]BST_PLUGINS_VERSION}}
# Install local sample plugins for testing pip plugin origins
py{310,311,312,313,314}: {toxinidir}/tests/plugins/sample-plugins
# Install external plugins for plugin tests
py{310,311,312,313,314}-plugins: git+https://gitlab.com/buildstream/buildstream-plugins-community.git@{env:BST_PLUGINS_COMMUNITY_VERSION:{[config]BST_PLUGINS_COMMUNITY_VERSION}}#egg=bst_plugins_community[deb]
# Only require coverage and pytest-cov when using it
!nocover: -rrequirements/cov-requirements.txt
# Install pytest-random-order for '-randomized'
randomized: pytest-random-order
passenv =
ARTIFACT_CACHE_SERVICE
ARTIFACT_INDEX_SERVICE
ARTIFACT_STORAGE_SERVICE
BST_CAS_STAGING_ROOT
GI_TYPELIB_PATH
INTEGRATION_CACHE
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
REMOTE_EXECUTION_SERVICE
SOURCE_CACHE_SERVICE
SSL_CERT_FILE
BST_PLUGINS_COMMUNITY_VERSION
#
# These keys are not inherited by any other sections
#
setenv =
py{310,311,312,313,314}: COVERAGE_FILE = {envtmpdir}/.coverage
py{310,311,312,313,314}: BST_TEST_HOME = {envtmpdir}
py{310,311,312,313,314}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache
py{310,311,312,313,314}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config
py{310,311,312,313,314}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share
# This is required to get coverage for Cython
py{310,311,312,313,314}-!nocover: BST_CYTHON_TRACE = 1
randomized: PYTEST_ADDOPTS="--random-order-bucket=global"
allowlist_externals =
py{310,311,312,313,314}:
mv
mkdir
#
# Environment for native windows
#
[testenv:win32]
commands =
bst help
cmd /C md testdir
bst init testdir --project-name="test"
deps =
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt
colorama
windows-curses
cython
.
allowlist_externals =
bst
cmd
#
# Coverage reporting
#
[testenv:coverage]
# This is required by Cython in order to get coverage for cython files.
usedevelop = True
commands =
coverage combine --rcfile={toxinidir}/.coveragerc {toxinidir}/.coverage-reports/
coverage html --rcfile={toxinidir}/.coveragerc --directory={toxinidir}/.coverage-reports/
coverage report --rcfile={toxinidir}/.coveragerc --show-missing
deps =
-rrequirements/cov-requirements.txt
setenv =
COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage
#
# Code formatters
#
[testenv:format]
skip_install = True
deps =
black==22.3.0
commands =
black {posargs: src tests doc/source/conf.py setup.py}
#
# Code format checkers
#
[testenv:format-check]
skip_install = True
deps =
black==22.3.0
commands =
black --check --diff {posargs: src tests doc/source/conf.py setup.py}
#
# Running linters
#
[testenv:lint]
commands_pre =
# Build C extensions to allow Pylint to analyse them
{envpython} setup.py build_ext --inplace
commands =
pylint {posargs: buildstream tests doc/source/conf.py setup.py}
deps =
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt
setuptools
Cython
#
# Running static type checkers
#
[testenv:mypy]
skip_install = True
commands =
mypy --namespace-packages {posargs}
deps =
mypy==1.13.0
types-protobuf==5.28.3.20241030
types-ujson==5.10.0.20240515
-rrequirements/requirements.txt
-rrequirements/dev-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 == 8.1.3
sphinx-click == 6.0.0
sphinx_rtd_theme == 3.0.2
pytest
-rrequirements/requirements.txt
git+https://github.com/apache/buildstream-plugins.git@{env:BST_PLUGINS_VERSION:{[config]BST_PLUGINS_VERSION}}
passenv =
BST_FORCE_SESSION_REBUILD
BST_SOURCE_CACHE
HOME
LANG
LC_ALL
allowlist_externals =
make
#
# (re-)Generating man pages
#
[testenv:man]
commands =
# We set the version to 0, because click-man would now
# otherwise want to pull a hardcoded version from pyproject.toml
# that somehow gets magically transported to the EntryPoint.version
click-man --man-version {posargs} --target man bst
deps =
click-man >= 0.5.0
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt
Cython
#
# Usefull for running arbitrary scripts in a BuildStream virtual env
#
[testenv:venv]
commands = {posargs}
deps =
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt
allowlist_externals = *
#
# Convenience environment for running individual tests from the
# battery of templated source tests.
#
# You should pass this the part of a test node's id after "::". For
# example, to run the test
# buildstream/testing/_sourcetests/fetch.py::test_fetch_cross_junction[git-inline]
# you would do tox -e sourcetests -- test_fetch_cross_junction[git-inline]
#
# This does rely on the fact that none of the tests in
# buildstream.testing have the same name.
#
[testenv:sourcetests]
commands = pytest --basetemp {envtmpdir} --ignore tests -k "{posargs}"
deps =
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt
# When building using PEP518 and 517, we don't want default dependencies
# installed by the base environment.
[testenv:.package]
deps =
#
# Regenerate protobuf and grpc code
#
[testenv:build-grpc]
skip_install = True
commands = python setup.py build_grpc
deps =
grpcio-tools==1.69.0 # Requires protobuf >= 5.29
Cython