Setup Hatch matrix to support Pydantic V1 and V2

This commit is contained in:
François Voron
2023-07-12 09:55:47 +02:00
parent 69f96c1f49
commit d2a633d2f5

View File

@ -73,6 +73,15 @@ dependencies = [
"ruff", "ruff",
] ]
[[tool.hatch.envs.default.matrix]]
pydantic = ["v1", "v2"]
[tool.hatch.envs.default.overrides]
matrix.pydantic.extra-dependencies = [
{value = "pydantic<2.0", if = ["v1"]},
{value = "pydantic>=2.0", if = ["v2"]},
]
[tool.hatch.envs.default.scripts] [tool.hatch.envs.default.scripts]
test = "pytest --cov=fastapi_users/ --cov-report=term-missing --cov-fail-under=100" test = "pytest --cov=fastapi_users/ --cov-report=term-missing --cov-fail-under=100"
test-cov-xml = "pytest --cov=fastapi_users/ --cov-report=xml --cov-fail-under=100" test-cov-xml = "pytest --cov=fastapi_users/ --cov-report=xml --cov-fail-under=100"