Skip to content

Commit 28fcc88

Browse files
committed
update test script (skip pydantic v1 tests on python 3.14)
1 parent ee73599 commit 28fcc88

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

scripts/test

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ fi
5454

5555
export 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+
5762
function run_tests() {
5863
echo "==> Running tests with Pydantic v2"
5964
uv run --isolated --all-extras pytest "$@"
6065

61-
echo "==> Running tests with Pydantic v1"
62-
uv run --isolated --all-extras --group=pydantic-v1 pytest "$@"
66+
# Skip Pydantic v1 tests on latest Python (not supported)
67+
if [[ "$UV_PYTHON" != "$PY_VERSION_MAX" ]]; then
68+
echo "==> Running tests with Pydantic v1"
69+
uv run --isolated --all-extras --group=pydantic-v1 pytest "$@"
70+
fi
6371
}
6472

6573
# If UV_PYTHON is already set in the environment, just run the command once
@@ -68,9 +76,9 @@ if [[ -n "$UV_PYTHON" ]]; then
6876
else
6977
# If UV_PYTHON is not set, run the command for min and max versions
7078

71-
echo "==> Running tests for Python 3.9"
72-
UV_PYTHON=3.9 run_tests "$@"
79+
echo "==> Running tests for Python $PY_VERSION_MIN"
80+
UV_PYTHON="$PY_VERSION_MIN" run_tests "$@"
7381

74-
echo "==> Running tests for Python 3.13"
75-
UV_PYTHON=3.13 run_tests "$@"
82+
echo "==> Running tests for Python $PY_VERSION_MAX"
83+
UV_PYTHON="$PY_VERSION_MAX" run_tests "$@"
7684
fi

0 commit comments

Comments
 (0)