forked from instructlab/instructlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
52 lines (45 loc) · 1.5 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
# SPDX-License-Identifier: Apache-2.0
[tox]
envlist = fmt, lint, unit, functional
[testenv]
# Use PyTorch CPU build instead of CUDA build in test envs. CUDA dependencies
# are huge. This reduces venv from 5.7 GB to 1.5 GB.
setenv =
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu
[testenv:unit]
description = run unit tests
deps = -r requirements-dev.txt
commands =
ilab --version
{envpython} -m instructlab --version
{envpython} -m pytest {posargs:tests}
[testenv:unitcov]
description = run unit tests with coverage
deps = -r requirements-dev.txt
commands =
ilab --version
{envpython} -m instructlab --version
{envpython} -m pytest --cov=instructlab --cov-report term --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
# "lint" and "fmt" targets don't build and install the project to speed up
# testing. The "fmt" only needs pre-commit.
[testenv:lint]
description = lint with pylint
skip_install = true
skipsdist = true
deps = -r requirements-dev.txt
commands =
{envpython} -m pylint src/instructlab/ tests/
[testenv:fmt]
description = format with pre-commit
skip_install = true
skipsdist = true
deps =
pre-commit>=3.0.4,<4.0
commands =
./scripts/fmt.sh
allowlist_externals = ./scripts/fmt.sh
[testenv:functional]
description = run functional tests
commands =
./scripts/functional-tests.sh
allowlist_externals = ./scripts/functional-tests.sh