5454
5555export DEFER_PYDANTIC_BUILD=false
5656
57+ # Note that we need to specify the patch version here so that uv
58+ # won't use unstable (alpha, beta, rc) releases for the tests
59+ PY_VERSION_MIN=" >=3.9.0"
60+ PY_VERSION_MAX=" >=3.14.0"
61+
5762function run_tests() {
5863 echo " ==> Running tests with Pydantic v2"
5964 uv run --isolated --all-extras pytest " $@ "
6065
61- # Pydantic v1 does not support Python 3.14, skip these tests
62- if [[ " $UV_PYTHON " != " 3.14 " ]]; then
66+ # Skip Pydantic v1 tests on latest Python (not supported)
67+ if [[ " $UV_PYTHON " != " $PY_VERSION_MAX " ]]; then
6368 echo " ==> Running tests with Pydantic v1"
6469 uv run --isolated --all-extras --group=pydantic-v1 pytest " $@ "
6570 fi
@@ -71,9 +76,9 @@ if [[ -n "$UV_PYTHON" ]]; then
7176else
7277 # If UV_PYTHON is not set, run the command for min and max versions
7378
74- echo " ==> Running tests for Python 3.9 "
75- UV_PYTHON=3.9 run_tests " $@ "
79+ echo " ==> Running tests for Python $PY_VERSION_MIN "
80+ UV_PYTHON=" $PY_VERSION_MIN " run_tests " $@ "
7681
77- echo " ==> Running tests for Python 3.14 "
78- UV_PYTHON=3.14 run_tests " $@ "
82+ echo " ==> Running tests for Python $PY_VERSION_MAX "
83+ UV_PYTHON=" $PY_VERSION_MAX " run_tests " $@ "
7984fi
0 commit comments