|
1 | 1 | [tox]
|
2 | 2 | min_version = 4.0
|
3 |
| -env_list = format, test_pydantic1, type_pydantic1, test_pydantic2, type_pydantic2, lint, py{3.9,3.10,3.11} |
| 3 | +env_list = format, lint, py{39,310,311}-pydantic{1,2}-{test,type} |
4 | 4 |
|
5 | 5 | [gh-actions]
|
6 | 6 | python =
|
7 | 7 | 3.9: py39
|
8 | 8 | 3.10: py310
|
9 |
| - 3.11: py311, test_pydantic1, type_pydantic1, test_pydantic2, type_pydantic2, format, lint |
| 9 | + 3.11: format, lint, py311 |
10 | 10 |
|
11 |
| -[testenv:test_pydantic1] |
| 11 | +[testenv] |
12 | 12 | labels = core
|
13 | 13 | allowlist_externals = poetry
|
| 14 | +# The "pydanticX:", "test:", and "type:" prefixes are Tox factor-conditional settings. |
| 15 | +# https://tox.wiki/en/3.4.0/config.html?highlight=conditional#factors-and-factor-conditional-settings |
| 16 | +# Note that "poetry add" changes pyproject.toml, but at least we |
| 17 | +# change it back when the tests finish. |
14 | 18 | commands_pre =
|
15 |
| - poetry install --only main --only test --no-root --all-extras |
16 |
| - poetry add pydantic^1 |
17 |
| -commands = poetry run pytest -vv tests |
18 |
| - |
19 |
| -[testenv:type_pydantic1] |
20 |
| -allowlist_externals = poetry |
21 |
| -commands_pre = |
22 |
| - poetry install --no-root --all-extras |
23 |
| - poetry add pydantic^1 |
24 |
| -commands = poetry run mypy openapi_pydantic tests |
25 |
| - |
26 |
| -[testenv:test_pydantic2] |
27 |
| -labels = core |
28 |
| -allowlist_externals = poetry |
29 |
| -commands_pre = |
30 |
| - poetry install --only main --only test --no-root --all-extras |
31 |
| - poetry add 'pydantic>=1.8' |
32 |
| -commands = poetry run pytest -vv tests |
33 |
| - |
34 |
| -[testenv:type_pydantic2] |
35 |
| -allowlist_externals = poetry |
36 |
| -commands_pre = |
| 19 | + pydantic1: poetry add --lock pydantic<2 |
| 20 | + pydantic2: poetry add --lock pydantic>=1.8 |
37 | 21 | poetry install --no-root --all-extras
|
38 |
| - poetry add 'pydantic>=1.8' |
39 |
| -commands = poetry run mypy openapi_pydantic tests |
| 22 | +commands = |
| 23 | + test: poetry run pytest -vv tests |
| 24 | + type: poetry run mypy openapi_pydantic tests |
40 | 25 |
|
41 | 26 | [testenv:format]
|
42 | 27 | allowlist_externals = poetry
|
|
0 commit comments