-
Notifications
You must be signed in to change notification settings - Fork 10
/
tox.ini
38 lines (34 loc) · 1.08 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
[tox]
min_version = 4.0
env_list = format, lint, py{38,39,310,311,312}-pydantic{1,2}-{test,type}
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: format, lint, py312
[testenv]
labels = core
allowlist_externals = poetry
# The "pydanticX:", "test:", and "type:" prefixes are Tox factor-conditional settings.
# https://tox.wiki/en/3.4.0/config.html?highlight=conditional#factors-and-factor-conditional-settings
# Note that "poetry add" changes pyproject.toml, but at least we
# change it back when the tests finish.
commands_pre =
pydantic1: poetry add --lock pydantic<2
pydantic2: poetry add --lock pydantic>=1.8
poetry install --no-root --all-extras
commands =
test: poetry run pytest -vv tests
type: poetry run mypy openapi_pydantic tests
[testenv:format]
allowlist_externals = poetry
commands_pre = poetry install --only dev --no-root
commands =
poetry run black --check openapi_pydantic tests
[testenv:lint]
allowlist_externals = poetry
commands_pre = poetry install --only dev --no-root
commands =
poetry run ruff check openapi_pydantic tests