-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
64 lines (52 loc) · 1.35 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
[tox]
envlist =
lint
py311-test
combine-test-reports
isolated_build = True
[testenv]
set_env =
PIP_EXTRA_INDEX_URL = https://pytorch-extension.intel.com/release-whl/stable/xpu/cn/
[testenv:lint]
description = Run static checkers.
basepython = py311
extras = lint
commands =
[testenv:py311-test]
description = Run doc tests and unit tests.
package = wheel
extras = test
setenv =
PY_IGNORE_IMPORTMISMATCH=1 # https://github.com/pytest-dev/pytest/issues/2042
COVERAGE_FILE = reports{/}.coverage.{envname}
commands =
# Run tests and doctests from .py files
pytest --junitxml=reports/pytest.xml.{envname} tests/unit {posargs}
[testenv:combine-test-reports]
description = Combine test and coverage data from multiple test runs.
depends = py311-test
skip_install = true
setenv =
COVERAGE_FILE = reports/.coverage
deps =
junitparser
coverage[toml]
commands =
junitparser merge --glob reports/pytest.xml.* reports/pytest.xml
coverage html
[testenv:docs]
description = Test and build the docs.
extras = docs
commands =
sphinx-build -b html -d "docs/build/doctrees" "docs" "docs/build/html"
[testenv:build]
description = Build the package.
extras = build
allowlist_externals = *
commands =
# Check formatting
ruff format . --check
# Lint code and docstrings
ruff check .
# Check type hinting
mypy .