-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtox.ini
105 lines (94 loc) · 3.49 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
[tox]
labels =
static = pre-commit-all, typing
static-quick = pre-commit-quick, typing
tests = tests-unit, tests-e2e, tests-cicd_utils
upgrade-requirements = pre-commit-autoupgrade
isolated_build = true
requires =
tox>=4
tox-uv
[testenv]
description = run the pytest tests under {basepython}
package = wheel
wheel_build_env = .pkg
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONHASHSEED=0
COVERAGE_FILE=.coverage.{envname}
COVERAGE_XML_FILE=coverage.{envname}.xml
_DIFFCOVER_DFLT_ARGS=--compare-branch={env:DIFF_AGAINST:origin/main} {env:COVERAGE_XML_FILE}
_COV_REPORT_XML=--cov-report=xml:{env:COVERAGE_XML_FILE}
_COV_FILES_RM={env:COVERAGE_FILE} {env:COVERAGE_XML_FILE}
passenv =
CI
COVERAGE_*
GITHUB_*
PYTEST_*
parallel_show_output = true
deps = -r requirements/tests.txt
allowlist_externals = rm, mv
commands =
rm -rf build/
rm -f {env:_COV_FILES_RM}
pytest: pytest --no-cov {posargs}
tests-unit: pytest tests/unit --doctest-modules src {env:_COV_REPORT_XML} --cov-fail-under=95 {posargs:}
tests-unit: diff-cover {env:_DIFFCOVER_DFLT_ARGS} --fail-under=100
tests-e2e: pytest tests/e2e --cov=cicd_utils/ridgeplot_examples {env:_COV_REPORT_XML} --cov-fail-under=75 {posargs:}
tests-e2e: diff-cover {env:_DIFFCOVER_DFLT_ARGS}
tests-cicd_utils: pytest tests/cicd_utils --cov=cicd_utils/cicd {env:_COV_REPORT_XML} --cov-fail-under=60 {posargs:}
tests-cicd_utils: diff-cover {env:_DIFFCOVER_DFLT_ARGS}
coverage-combine: rm -rf coverage/
coverage-combine: coverage combine --keep --data-file=.coverage
coverage-combine: mv .coverage {env:COVERAGE_FILE}
coverage-combine: coverage xml --data-file={env:COVERAGE_FILE} --omit="cicd_utils/*,tests/*" -o {env:COVERAGE_XML_FILE}
coverage-combine: coverage html --data-file={env:COVERAGE_FILE} --omit="cicd_utils/*,tests/*"
coverage-combine: coverage report --data-file={env:COVERAGE_FILE} --omit="cicd_utils/*,tests/*" --fail-under=98
coverage-combine: diff-cover {env:_DIFFCOVER_DFLT_ARGS} --fail-under=100
[testenv:pre-commit-{all,quick,autoupgrade}]
description = run code style and linting checks with pre-commit
passenv =
{[testenv]passenv}
PRE_COMMIT_HOME
SKIP
XDG_CACHE_HOME
SSH_AUTH_SOCK
skip_install = true
deps = pre-commit
commands =
all: pre-commit run --all-files --show-diff-on-failure {posargs:}
quick: pre-commit run ruff-format --all-files
pre-commit run ruff --all-files
autoupgrade: pre-commit autoupdate {posargs:}
[testenv:typing]
description = run type checks
deps = -r requirements/typing.txt
commands =
pyright --skipunannotated
[testenv:docs-{live,static}]
description = generate Sphinx (live/static) HTML documentation
setenv =
{[testenv]setenv}
PYTHONPATH={env:PYTHONPATH}{:}{toxinidir}/cicd_utils
deps = -r requirements/docs.txt
allowlist_externals = make
commands =
make clean-docs
live: make --directory=docs livehtml
static: make --directory=docs html
python "cicd_utils/cicd/scripts/open_in_browser.py" "docs/_build/html/index.html"
[testenv:release-notes]
description = extract release notes from docs/reference/changelog.md
skip_install = true
deps = -r requirements/cicd_utils.txt
commands = python cicd_utils/cicd/scripts/extract_latest_release_notes.py
[testenv:build-dists]
description = build source (sdist) and binary (wheel) distributions
deps =
build
twine
allowlist_externals = rm
commands =
rm -rf dist/
python -m build
twine check --strict dist/*