Skip to content

Commit 6b627be

Browse files
committed
Configure pipeline to run tests against different pydantic versions
1 parent b1d9526 commit 6b627be

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/tests-and-linters.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ jobs:
3636
env:
3737
TOXENV: ${{ matrix.python-version }}
3838

39+
test-different-pydantic-versions:
40+
name: Run tests with different pydantic versions
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v3
44+
- uses: actions/setup-python@v4
45+
with:
46+
python-version: "3.12"
47+
- run: pip install tox
48+
- run: tox -e pydantic-v1,pydantic-v2
49+
3950
test-coverage:
4051
name: Run tests with coverage
4152
runs-on: ubuntu-latest

tox.ini

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
parallel_show_output = true
33
envlist=
4-
coveralls, pylint, flake8, pydocstyle, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10
4+
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
55

66
[testenv]
77
deps=
@@ -29,6 +29,27 @@ setenv =
2929
[testenv:.pkg]
3030
passenv = DEPENDENCY_INJECTOR_*
3131

32+
[testenv:pydantic-{v1,v2}]
33+
description = run tests with different pydantic versions
34+
base_python = python3.12
35+
deps =
36+
v1: pydantic<2
37+
v2: pydantic-settings
38+
pytest
39+
pytest-asyncio
40+
-rrequirements.txt
41+
typing_extensions
42+
httpx
43+
fastapi
44+
flask<2.2
45+
aiohttp<=3.9.0b1
46+
numpy
47+
scipy
48+
boto3
49+
mypy_boto3_s3
50+
werkzeug<=2.2.2
51+
commands = pytest -c tests/.configs/pytest.ini -m pydantic
52+
3253
[testenv:coveralls]
3354
passenv = GITHUB_*, COVERALLS_*, DEPENDENCY_INJECTOR_*
3455
basepython=python3.12 # TODO: Upgrade to version 3.13 is blocked by coveralls 4.0.1 not supporting Python 3.13

0 commit comments

Comments
 (0)