Skip to content

Commit 07ad9ed

Browse files
committed
Enhance tox.ini to test Pydantic 1 and 2
1 parent 8af0900 commit 07ad9ed

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

tox.ini

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
[tox]
22
min_version = 4.0
3-
env_list = format, type, lint, py{3.9,3.10,3.11}
3+
env_list = format, test_pydantic1, test_pydantic2, type_pydantic1, type_pydantic2, lint, py{3.9,3.10,3.11}
44

55
[gh-actions]
66
python =
77
3.9: py39
88
3.10: py310
99
3.11: py311, type, format, lint
1010

11-
[testenv]
11+
[testenv:test_pydantic1]
1212
labels = core
1313
allowlist_externals = poetry
14-
commands_pre = poetry install --only main --only test --no-root --all-extras
14+
commands_pre =
15+
poetry install --only main --only test --no-root --all-extras
16+
poetry add pydantic^1
1517
commands = poetry run pytest -vv tests
1618

17-
[testenv:type]
19+
[testenv:test_pydantic2]
20+
labels = core
21+
allowlist_externals = poetry
22+
commands_pre =
23+
poetry install --only main --only test --no-root --all-extras
24+
poetry add 'pydantic==*'
25+
commands = poetry run pytest -vv tests
26+
27+
[testenv:type_pydantic1]
28+
allowlist_externals = poetry
29+
commands_pre =
30+
poetry install --no-root --all-extras
31+
poetry add pydantic^1
32+
commands = poetry run mypy openapi_pydantic tests
33+
34+
[testenv:type_pydantic2]
1835
allowlist_externals = poetry
19-
commands_pre = poetry install --no-root --all-extras
36+
commands_pre =
37+
poetry install --no-root --all-extras
38+
poetry add 'pydantic==*'
2039
commands = poetry run mypy openapi_pydantic tests
2140

2241
[testenv:format]

0 commit comments

Comments
 (0)