Skip to content

Commit 4547171

Browse files
chore(internal): avoid using unstable Python versions in tests
1 parent 1521316 commit 4547171

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

scripts/test

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ 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-
# 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
7176
else
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 "$@"
7984
fi

0 commit comments

Comments
 (0)