diff --git a/.github/workflows/tests-and-linters.yml b/.github/workflows/tests-and-linters.yml index 184889a7..a924c5e7 100644 --- a/.github/workflows/tests-and-linters.yml +++ b/.github/workflows/tests-and-linters.yml @@ -36,6 +36,17 @@ jobs: env: TOXENV: ${{ matrix.python-version }} + test-different-pydantic-versions: + name: Run tests with different pydantic versions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.12" + - run: pip install tox + - run: tox -e pydantic-v1,pydantic-v2 + test-coverage: name: Run tests with coverage runs-on: ubuntu-latest diff --git a/tox.ini b/tox.ini index 4e5d08aa..c06b0f95 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] parallel_show_output = true envlist= - coveralls, pylint, flake8, pydocstyle, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10 + coveralls, pylint, flake8, pydocstyle, pydantic-v1, pydantic-v2, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10 [testenv] deps= @@ -29,6 +29,27 @@ setenv = [testenv:.pkg] passenv = DEPENDENCY_INJECTOR_* +[testenv:pydantic-{v1,v2}] +description = run tests with different pydantic versions +base_python = python3.12 +deps = + v1: pydantic<2 + v2: pydantic-settings + pytest + pytest-asyncio + -rrequirements.txt + typing_extensions + httpx + fastapi + flask<2.2 + aiohttp<=3.9.0b1 + numpy + scipy + boto3 + mypy_boto3_s3 + werkzeug<=2.2.2 +commands = pytest -c tests/.configs/pytest.ini -m pydantic + [testenv:coveralls] passenv = GITHUB_*, COVERALLS_*, DEPENDENCY_INJECTOR_* basepython=python3.12 # TODO: Upgrade to version 3.13 is blocked by coveralls 4.0.1 not supporting Python 3.13