-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathtox.ini
136 lines (111 loc) · 3.56 KB
/
tox.ini
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
# SPDX-FileCopyrightText: 2022 Aleksandr Mezin <mezin.alexander@gmail.com>
#
# SPDX-License-Identifier: CC0-1.0
[tox]
minversion = 4.0
skipsdist = true
envlist =
eslint
markdownlint
flake8
reuse
version
meson-test
meson-test-legacy
[testenv]
passenv =
FORCE_COLOR
GITHUB_ACTIONS
PIP_DISABLE_PIP_VERSION_CHECK
DDTERM_BUILT_PACK
suicide_timeout = 15
interrupt_timeout = 15
terminate_timeout = 15
[testenv:pip-compile]
description = Lock Python dependencies
deps = -r requirements/pip-compile.txt
changedir = {toxinidir}/requirements
commands =
{envpython} -m piptools compile --strip-extras {posargs} test.in
{envpython} -m piptools compile --strip-extras {posargs} test-images.in
{envpython} -m piptools compile --strip-extras {posargs} flake8.in
{envpython} -m piptools compile --strip-extras {posargs} reuse.in
{envpython} -m piptools compile --strip-extras {posargs} meson.in
{envpython} -m piptools compile --strip-extras {posargs} version.in
{envpython} -m piptools compile --strip-extras {posargs} pip-compile.in
[testenv:pytest]
description = Run tests using pytest (advanced)
deps = -r tests/requirements.txt
# https://github.com/pytest-dev/pytest/issues/10451
commands_pre = rm -f '{envsitepackagesdir}/py.py'
allowlist_externals = rm
commands = {envpython} -m pytest --html=tests/report.html --dist=worksteal {posargs}
[testenv:meson{,-test}{,-legacy}]
description =
Build
test: and test
!legacy: esm
legacy: legacy
package using Meson
base =
test: testenv:pytest
deps =
-r requirements/meson.txt
test: {[testenv:pytest]deps}
commands_pre =
test: {[testenv:pytest]commands_pre}
{envpython} -m mesonbuild.mesonmain setup --reconfigure {env:CONFIGURE_FLAGS} {toxinidir}
commands =
test: {envpython} -m mesonbuild.mesonmain {posargs:test --no-suite lint-source}
!test: {envpython} -m mesonbuild.mesonmain {posargs:compile}
changedir = {envdir}
setenv =
CONFIGURE_FLAGS={env:CONFIGURE_FLAGS}
legacy: CONFIGURE_FLAGS={env:CONFIGURE_FLAGS} -Desm=false
passenv =
DISPLAY
XAUTHORITY
[testenv:test{,-legacy}]
description =
Test
!legacy: esm
legacy: legacy
package using pytest. It needs to be built by running
!legacy: meson
legacy: meson-legacy
before
base = testenv:pytest
depends =
!legacy: meson
legacy: meson-legacy
setenv =
DDTERM_BUILT_PACK={env:DDTERM_BUILT_PACK:{[testenv:meson]changedir}/ddterm@amezin.github.com.shell-extension.zip}
legacy: DDTERM_BUILT_PACK={[testenv:meson-legacy]changedir}/ddterm@amezin.github.com.legacy.shell-extension.zip
[testenv:images]
description = Manage container images for pytest
deps = -r requirements/test-images.txt
commands = {envpython} tests/images.py {posargs: pull}
[testenv:flake8]
description = Check Python source code using flake8
deps = -r requirements/flake8.txt
commands = {envpython} -m flake8 {posargs}
[testenv:reuse]
description = Check source code for REUSE compliance
deps = -r requirements/reuse.txt
commands = {envpython} -m reuse {posargs: lint}
[testenv:eslint]
description = Check JavaScript source code using ESLint
deps =
allowlist_externals = npm
commands_pre = npm install
commands = npm run-script lint:eslint -- {posargs}
[testenv:markdownlint]
description = Check Markdown files
deps =
allowlist_externals = npm
commands_pre = npm install
commands = npm run-script lint:markdownlint -- {posargs}
[testenv:version]
description = Manage version number
deps = -r requirements/version.txt
commands = {envpython} -m bumpversion {posargs: bump --dry-run --allow-dirty major}