-
Notifications
You must be signed in to change notification settings - Fork 12
/
tox.ini
78 lines (70 loc) · 1.62 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
# SPDX-License-Identifier: Apache-2.0
[tox]
# py3-unit runs unit tests with 'python3'
# py311-unit runs the same tests with 'python3.11'
envlist = ruff, pylint, mypy, jsonschema, py3-unit
minversion = 4.4
[testenv]
description = Run tests with pytest
package = wheel
wheel_build_env = pkg
passenv =
GITHUB_ACTIONS
GITHUB_WORKFLOW
deps =
pytest
assertpy
commands =
unit: {envpython} -m pytest {posargs:tests}
[testenv:pylint]
description = Lint with pylint
deps =
pylint
{[testenv]deps}
commands =
{envpython} -m pylint {posargs:src tests}
[testenv:ruff]
description = Reformat and fix code with Ruff
skip_install = True
skipsdist = true
deps =
ruff
{[testenv]deps}
commands =
ruff check --fix
ruff format
[testenv:ruffcheck]
description = Check code with Ruff
skip_install = True
skipsdist = true
deps =
{[testenv:ruff]deps}
commands =
ruff check --diff
ruff format --check
[testenv:mypy]
description = Python type checking with mypy
namespace_packages = True
explicit_package_bases = True
deps =
mypy
{[testenv]deps}
types-assertpy
types-PyYAML
types-jsonschema
commands =
{envpython} -m mypy {posargs:src tests}
[testenv:jsonschema]
description = JSON schema file validation with check-jsonschema
skip_install = True
skipsdist = true
deps =
check-jsonschema
commands =
bash -c "{envpython} -m check_jsonschema --verbose --schemafile https://json-schema.org/draft/2020-12/schema {posargs:$(find src/instructlab/schema/v* -name \"*.json\" -print)}"
allowlist_externals = bash
[gh]
python =
3.12 = py312-unit
3.11 = py311-unit
3.10 = py310-unit