-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.toml
72 lines (65 loc) · 1.47 KB
/
tox.toml
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
requires = ["tox"]
env_list = ["py3.11", "py3.12", "codecov", "ruff", "mypy", "docs", "build"]
skip_missing_interpreters = true
[gh.python]
"3.11" = ["3.11"]
"3.12" = ["3.12", "codecov", "ruff", "mypy", "docs", "build"]
[env_run_base]
description = "Run tests."
deps = ["pytest"]
commands = [["pytest"]]
[env.codecov]
description = "Run coverage report."
deps = ["pytest", "pytest-cov"]
commands = [
[
"pytest",
"--cov=tests",
"--cov-config=pyproject.toml",
"--cov-fail-under=100",
],
[
"pytest",
"--cov=python_package_template",
"--cov-config=pyproject.toml",
"--cov-report=term-missing",
"--cov-fail-under=80",
"--cov-report=xml:{work_dir}/artifacts/coverage.xml",
],
]
[env.ruff]
description = "Lint and format the code."
deps = ["ruff"]
commands = [["ruff", "check", "src", "tests"]]
[env.mypy]
description = "Static type checking."
deps = ["mypy"]
commands = [["mypy", "src", "tests"]]
[env.docs]
description = "Build the documentation."
extras = ["docs"]
commands = [
[
"sphinx-build",
"--builder",
"html",
"--doctree-dir",
"{env_tmp_dir}/doctree",
"docs",
"{work_dir}/artifacts/docs",
"--color",
"--fail-on-warning",
],
]
[env.build]
description = "Build the package."
deps = ["build"]
commands = [
[
"python",
"-m",
"build",
"--outdir",
"{work_dir}/artifacts/dist",
],
]