-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtox.ini
More file actions
83 lines (73 loc) · 1.98 KB
/
tox.ini
File metadata and controls
83 lines (73 loc) · 1.98 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
; 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 =
format
lint
types
license
py3{9,10,11,12,13,14}
pypy3{9,10,11}
package
clean
requires = virtualenv
[testenv]
description = Unit tests and test coverage
deps =
cli-test-helpers
coverage[toml]
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 uv.lock --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 -l}
[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
[testenv:types]
description = Perform static type checking
skip_install = true
deps =
cli-test-helpers
pytest
ty
commands = ty check {posargs}