-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
73 lines (64 loc) · 1.83 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
; SPDX-FileCopyrightText: 2019 Peter Bittner <django@bittner.it>
;
; SPDX-License-Identifier: GPL-3.0-or-later
# Tox (https://tox.wiki/) - run tests in isolation using virtualenv.
[tox]
envlist =
lint
format
py3{6,7,8,9,10,11,12}
pypy3{8,9,10}
package
clean
requires = virtualenv<20.22.0
[testenv]
description = Unit tests and test coverage
deps =
cli-test-helpers
coverage[toml]
coverage-conditional-plugin
pytest
commands =
coverage run -m pytest {posargs}
coverage xml
coverage report
[testenv:clean]
description = Clean up bytecode and build artifacts
skip_install = true
deps = pyclean
commands = pyclean {posargs:. --debris --erase tests/junit-report.xml --yes}
[testenv:ensure_version_matches]
description = Verify package version is same as Git tag
deps =
commands = python -c 'import os; from importlib.metadata import version; pkg, tag = os.environ["PKG_NAME"], os.environ["GIT_TAG"]; ver = version(pkg); error = f"`{ver}` != `{tag}`"; abort = f"Package version does not match the Git tag ({error}). ABORTING."; raise SystemExit(0 if ver and tag and ver == tag else abort)'
setenv =
PKG_NAME=pyclean
GIT_TAG={posargs}
[testenv:format]
description = Ensure consistent code style (Ruff)
skip_install = true
deps = ruff
commands = ruff format {posargs:--check --diff .}
[testenv:license]
description = Manage license compliance
skip_install = true
deps = reuse
commands = reuse {posargs:lint}
[testenv:lint]
description = Lightening-fast linting (Ruff)
skip_install = true
deps = ruff
commands = ruff check {posargs:.}
[testenv:package]
description = Build package and check metadata (or upload package)
skip_install = true
deps =
build
twine
commands =
python -m build
twine {posargs:check --strict} dist/*
passenv =
TWINE_USERNAME
TWINE_PASSWORD
TWINE_REPOSITORY_URL