-
Notifications
You must be signed in to change notification settings - Fork 10
/
tox.ini
107 lines (91 loc) · 2.1 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
[tox]
skipsdist=True
# Run these envs when tox is invoked without -e
envlist=lint,py{38,39,310,311}-unittest
[testenv]
# Factors:
# lint: Lint Python files with black, flake8, and isort
# unittest: Run Python unittests
#
# These factors are expected to combine into the follow generative environments:
#
# lint
# unittest
#
# These factors are expected to combine to be invoked with:
#
# tox -e lint
# tox -e unittest
recreate=False
basepython=
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
deps=
lint: {[lint-config]deps}
unittest: {[unittest-config]deps}
commands=
lint: {[lint-config]commands}
unittest: {[unittest-config]commands}
passenv=
HOME
LOCALAPPDATA
[lint-config]
# Configuration necessary to lint Python files.
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e lint
#
# To run Python linting.
deps=
bandit
black
isort
ruff
commands=
black . --check
isort --check-only --diff .
ruff . --no-fix
bandit -r qbt_migrate
[unittest-config]
# Configuration necessary to run unittests.
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e unittest
#
# To run unit tests.
deps=
bencode.py==4.0.0
pytest
coverage
commands=
coverage erase
coverage run -m pytest {posargs}
[testenv:lint]
# Invoke with: tox -e lint
recreate=False
envdir={toxworkdir}/lint
deps={[lint-config]deps}
commands={[lint-config]commands}
[testenv:unittest]
# Invoke with: tox -e unittest
recreate=False
envdir={toxworkdir}/unittest
deps=
{[unittest-config]deps}
commands={[unittest-config]commands}
[testenv:coverage]
# Invoke with: tox -e coverage
# Report out the coverage of changes on the current branch against the main
# branch. This will fail if the coverage of changes is below 100%. This env
# requires a coverage file and should only be run after unittest
deps=
bencode.py==4.0.0
pytest
coverage
diff-cover
commands=
coverage report
coverage xml
diff-cover coverage.xml --compare-branch=origin/master --fail-under=100