forked from caikit/caikit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
87 lines (74 loc) · 2.11 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
[tox]
envlist = py, lint, fmt, proto3
[testenv]
description = run tests with pytest with coverage
extras =
all
dev-test
passenv =
LOG_LEVEL
LOG_FILTERS
LOG_FORMATTER
LOG_THREAD_ID
LOG_CHANNEL_WIDTH
setenv =
DFTYPE = pandas_all
commands = pytest --cov=caikit --cov-report=html:coverage-{env_name} --cov-report=xml:coverage-{env_name}.xml --html=durations/{env_name}.html {posargs:tests -m "not (examples or slow)"} -W error::UserWarning
; -W ignore::DeprecationWarning
; Unclear: We probably want to test wheel packaging
; But! tox will fail when this is set and _any_ interpreter is missing
; Without this, sdist packaging is tested so that's a start.
package=wheel
[testenv:docs]
recreate = True
extras = dev-docs
changedir = docs/source
; Disabled '-W' flag as warnings in the files
; TOTO: Add back in once build warnings fixed
commands =
sphinx-build -E -a -b html -T . _build/html
[testenv:fmt]
description = format with pre-commit
extras = dev-fmt
commands = ./scripts/fmt.sh
allowlist_externals = ./scripts/fmt.sh
[testenv:lint]
description = lint with ruff
extras =
all
dev-fmt
dev-test
commands = ruff check caikit examples
[testenv:imports]
description = enforce internal import rules
extras = dev-fmt
commands = ./scripts/check_deps.sh
allowlist_externals = ./scripts/check_deps.sh
[testenv:build]
description = build wheel
deps =
build
setuptools
commands = python -m build
skip_install = True
[testenv:twinecheck]
description = check wheel
deps = twine
commands = twine check dist/*
# Ensure compatibility is maintained with protobuf 3.X
[testenv:proto3]
description = run tests with pytest with coverage
extras = dev-proto3
commands =
pytest --cov=caikit --cov-report=html {posargs:tests -m "not (examples or slow)"}
# Ensure tests targeting caikit.core can be run with no optional dependencies
[testenv:core]
description = run tests against caikit.core without any extras
base = ""
extras = dev-test
commands =
pytest tests/core
# Runs dsconverter on caikit
[testenv:dsconverter]
description = convert docstrings to google
commands = python ./scripts/dsconverter.py caikit