-
Notifications
You must be signed in to change notification settings - Fork 571
/
tox.ini
74 lines (67 loc) · 1.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
[tox]
min_version = 4
env_list =
py3{8,9,10,11,12,13}-pydantic{1,2}-tests
lint
typecheck-pydantic{1,2}
integration
[coverage:paths]
source =
python/cog
.tox/*/lib/python*/site-packages/cog
[pytest]
addopts = --timeout=20
[testenv]
package = wheel
# Build the same wheel for all environments
wheel_build_env = .pkg
deps =
pydantic1: pydantic>=1,<2
pydantic2: pydantic>=2,<3
extras =
tests: tests
pass_env =
HYPOTHESIS_PROFILE
FORCE_COLOR
set_env =
tests: COVERAGE_FILE={env_dir}/.coverage
commands =
tests: pytest python/tests --cov={env_site_packages_dir}/cog --cov-report term-missing:skip-covered {posargs:-n auto -vv}
[testenv:lint]
base_python = python3.12
skip_install = true
deps = ruff
commands =
ruff check python/cog
ruff format --check python
[testenv:typecheck-pydantic1]
base_python = python3.12
deps =
pyright==1.1.375
pydantic>=1,<2
# copy to envtmpdir so we can modify pyproject.toml
commands =
cp -r python pyproject.toml {envtmpdir}
sed -i 's/PYDANTIC_V2 = .*$/PYDANTIC_V2 = false/' {envtmpdir}/pyproject.toml
pyright -p {envtmpdir} {posargs}
allowlist_externals =
cp
sed
[testenv:typecheck-pydantic2]
base_python = python3.12
deps =
pyright==1.1.375
pydantic>=2,<3
commands = pyright {posargs}
[testenv:integration]
base_python = python3.12
changedir = test-integration
skip_install = true
deps =
httpx
packaging
pytest
pytest-rerunfailures
pytest-timeout
pytest-xdist
commands = pytest {posargs:-n auto -vv --reruns 3}