[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