Skip to content

Commit 58b5ba9

Browse files
committed
tests: add testing for Python 3.15
1 parent 06c1f05 commit 58b5ba9

53 files changed

Lines changed: 134 additions & 29 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/unittest.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix: ${{ steps.set-matrix.outputs.matrix }}
3030
is_full_run: ${{ steps.check-label.outputs.is_full_run }}
3131
env:
32-
MAX_SHARDS: 16
32+
MAX_SHARDS: 20
3333
# Define weights for long-running unit tests to balance shard execution time
3434
# Each weight is roughly 1 minute of expected execution time
3535
# Default for unset packages is 1
@@ -81,9 +81,8 @@ jobs:
8181
if: needs.initialize.outputs.matrix != '[]' && needs.initialize.outputs.matrix != ''
8282
runs-on: ubuntu-22.04
8383
strategy:
84-
fail-fast: true
8584
matrix:
86-
python: ['3.10', "3.11", "3.12", "3.13", "3.14"]
85+
python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
8786
package_shard: ${{ fromJson(needs.initialize.outputs.matrix) }}
8887
name: ${{ matrix.package_shard.is_sharded && format('unit ({0}, {1})', matrix.python, matrix.package_shard.name) || format('unit ({0})', matrix.python) }}
8988
steps:
@@ -100,10 +99,43 @@ jobs:
10099
with:
101100
python-version: ${{ matrix.python }}
102101
cache: 'pip'
102+
allow-prereleases: true
103+
- name: Setup uv
104+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
105+
with:
106+
enable-cache: true
107+
cache-dependency-glob: 'packages/**/testing/constraints*.txt'
103108
- name: Install nox
104109
run: |
105110
python -m pip install --upgrade setuptools pip wheel
106111
python -m pip install nox uv
112+
- name: Run unit tests
113+
run: |
114+
uv pip install --system nox nox-uv
115+
# Caches local wheels for Python 3.15+ to avoid repeatedly downloading or building heavy libraries.
116+
# Follow https://github.com/grpc/grpc/issues/41010 for updates.
117+
- name: Cache Built Python 3.15 Wheels
118+
if: matrix.python == '3.15'
119+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
120+
with:
121+
path: .uv-wheel-cache
122+
key: ${{ runner.os }}-uv-wheels-3.15-${{ hashFiles('packages/**/testing/constraints*.txt') }}
123+
restore-keys: |
124+
${{ runner.os }}-uv-wheels-3.15-
125+
# TODO: Remove this step once official Python 3.15 wheels for grpcio are published to PyPI.
126+
# See https://github.com/grpc/grpc/issues/41010#issuecomment-4848264910 for details.
127+
- name: Install grpcio wheel for Python 3.15
128+
if: matrix.python == '3.15'
129+
run: |
130+
mkdir -p .uv-wheel-cache
131+
WHEEL_FILE=".uv-wheel-cache/grpcio-1.83.0.dev0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl"
132+
if [ ! -f "$WHEEL_FILE" ]; then
133+
curl -L "https://packages.grpc.io/archive/2026/06/5ccdab32010f762634e1082d19be53cf60458456-b37e49c7-5e62-4cbe-870a-c599bb907b04/python/grpcio/grpcio-1.83.0.dev0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl" -o "$WHEEL_FILE"
134+
fi
135+
echo "d7706633cd5d97a8b8d3c6ed36c5940722a9b5cbb47f0d10bc433ee27af36ff0 $WHEEL_FILE" | sha256sum -c
136+
uv pip install --system "$WHEEL_FILE"
137+
echo "UV_FIND_LINKS=${{ github.workspace }}/.uv-wheel-cache" >> $GITHUB_ENV
138+
echo "UV_CACHE_DIR=${{ github.workspace }}/.uv-wheel-cache" >> $GITHUB_ENV
107139
- name: Run unit tests for ${{ matrix.package_shard.description }}
108140
env:
109141
BUILD_TYPE: presubmit

ci/get_package_shards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def group_packages(packages_map):
165165

166166
# Dynamically determine target weight to balance across max shards.
167167
max_shards = int(os.environ.get("MAX_SHARDS", 16))
168-
target_weight = max(10, math.ceil(total_weight / max_shards))
168+
target_weight = max(6, math.ceil(total_weight / max_shards))
169169

170170
shards_list = []
171171
current_shard_items = []

ci/run_single_test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ case ${TEST_TYPE} in
9090
nox -s unit-3.14
9191
retval=$?
9292
;;
93+
"3.15")
94+
# This is needed to speed up builds
95+
nox --force-venv-backend uv -s unit-3.15
96+
retval=$?
97+
;;
9398
*)
9499
echo "unsupported PY_VERSION"
95100
exit 1

packages/bigframes/bigframes/_magics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
)
3838
def _cell_magic(line, cell):
3939
ipython = get_ipython()
40+
if ipython is None:
41+
return
42+
4043
args = magic_arguments.parse_argstring(_cell_magic, line)
4144
if not cell:
4245
print("Query is missing.")

packages/bigframes/noxfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
DEFAULT_PYTHON_VERSION = "3.14"
6262

63-
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"]
63+
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
6464
UNIT_TEST_STANDARD_DEPENDENCIES = [
6565
"mock",
6666
PYTEST_VERSION,
@@ -283,6 +283,10 @@ def run_unit(session, install_test_extra):
283283
@nox.session(python=ALL_PYTHON)
284284
@nox.parametrize("test_extra", [True, False])
285285
def unit(session, test_extra):
286+
if session.python == "3.15":
287+
session.skip(
288+
"Skipping 3.15 until wheels are available for pyarrow. Also pyproj wheels are needed for dependency geopandas."
289+
)
286290
if test_extra:
287291
run_unit(session, install_test_extra=test_extra)
288292
else:

packages/bigquery-magics/noxfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"3.12",
4242
"3.13",
4343
"3.14",
44+
"3.15",
4445
]
4546

4647
UNIT_TEST_STANDARD_DEPENDENCIES = [
@@ -237,6 +238,10 @@ def install_unittest_dependencies(session, *constraints):
237238
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
238239
def unit(session):
239240
# Install all test dependencies, then install this package in-place.
241+
if session.python == "3.15":
242+
session.skip(
243+
"Skipping 3.15 until wheels are available for pyproj needed for dependency geopandas"
244+
)
240245

241246
constraints_path = str(
242247
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"

packages/bigquery-magics/testing/constraints-3.15.txt

Whitespace-only changes.

packages/db-dtypes/noxfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"3.12",
4343
"3.13",
4444
"3.14",
45+
"3.15",
4546
]
4647

4748
UNIT_TEST_STANDARD_DEPENDENCIES = [
@@ -302,6 +303,8 @@ def prerelease(session, tests_path):
302303
@nox.parametrize("test_type", ["unit", "compliance"])
303304
def unit(session, test_type):
304305
"""Run the unit test suite."""
306+
if session.python == "3.15":
307+
session.skip("Skipping 3.15 until wheels are available for pyarrow.")
305308

306309
# Compliance tests only run on the latest Python version
307310
if test_type == "compliance" and session.python != DEFAULT_PYTHON_VERSION:

packages/db-dtypes/testing/constraints-3.15.txt

Whitespace-only changes.

packages/django-google-spanner/noxfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"3.12",
3535
"3.13",
3636
"3.14",
37+
"3.15",
3738
]
3839
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
3940

0 commit comments

Comments
 (0)