Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python: ['3.10', "3.11", "3.12", "3.13", "3.14"]
python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
package_shard: ${{ fromJson(needs.initialize.outputs.matrix) }}
name: ${{ matrix.package_shard.is_sharded && format('unit ({0}, {1})', matrix.python, matrix.package_shard.name) || format('unit ({0})', matrix.python) }}
steps:
Expand All @@ -100,10 +100,38 @@ jobs:
with:
python-version: ${{ matrix.python }}
cache: 'pip'
allow-prereleases: true
- name: Setup uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
enable-cache: true
cache-dependency-glob: 'packages/**/testing/constraints*.txt'
- name: Install nox
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install nox uv
python -m pip install nox
- name: Run unit tests
uv pip install --system nox nox-uv
# Caches compiled wheels locally to prevent building heavy libraries
# such as grpcio, which we build from scratch on every run for Python 3.15+.
# Follow https://github.com/grpc/grpc/issues/41010 for updates.
- name: Cache Built Python 3.15 Wheels
if: matrix.python == '3.15'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .uv-wheel-cache
key: ${{ runner.os }}-uv-wheels-3.15-${{ hashFiles('packages/**/testing/constraints*.txt') }}
restore-keys: |
${{ runner.os }}-uv-wheels-3.15-
# Pre-cache heavy dependencies sequentially before running parallel tests
- name: Pre-cache heavy dependencies (grpcio)
if: matrix.python == '3.15'
run: |
# Create the directory so uv doesn't crash if there is a `cache miss`
mkdir -p .uv-wheel-cache
# Download and compile grpcio sequentially so that parallel test workers
# immediately hit the warm cache instead of deadlocking on compilation.
uv pip install --system grpcio --find-links .uv-wheel-cache
- name: Run unit tests for ${{ matrix.package_shard.description }}
env:
BUILD_TYPE: presubmit
Expand Down
2 changes: 2 additions & 0 deletions .kokoro/presubmit/system.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ env_vars: {
key: "BIGFRAMES_TEST_PROJECT"
value: "bigframes-testing"
}

timeout_mins: 360
81 changes: 81 additions & 0 deletions ci/get_batches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/usr/bin/env python3
Comment thread
parthea marked this conversation as resolved.
import os
import glob
import math
import json
import sys

BATCH_SIZE = 10

# Packages that take significantly longer to run tests.
# These will always be assigned to their own dedicated runner.
ISOLATED_PACKAGES = [
"google-cloud-compute",
"google-cloud-compute-v1beta",
"google-cloud-dialogflow",
"google-cloud-dialogflow-cx",
"google-cloud-retail",
]

def get_batches():
"""Splits packages into dedicated isolated batches and evenly chunked standard batches."""
raw_paths = sorted(glob.glob("packages/*"))
package_paths = [p for p in raw_paths if os.path.isdir(p)]

batches = []
standard_packages = []

for path in package_paths:
pkg_name = os.path.basename(path)

if pkg_name in ISOLATED_PACKAGES:
# Put heavy packages into their own standalone batches immediately
batches.append([path])
else:
standard_packages.append(path)

# Chunk the remaining standard packages by BATCH_SIZE
num_standard_packages = len(standard_packages)
num_standard_batches = math.ceil(num_standard_packages / BATCH_SIZE)

if num_standard_batches == 0 and not batches:
num_standard_batches = 1

for i in range(num_standard_batches):
start_idx = i * BATCH_SIZE
chunk = standard_packages[start_idx : start_idx + BATCH_SIZE]
if chunk:
batches.append(chunk)

return batches

def get_batch_indices():
"""Returns a JSON string of the array of batch indices for GitHub Actions matrix."""
batches = get_batches()
return json.dumps(list(range(len(batches))))

def get_batch_slice(batch_index):
"""Returns a space-separated string of unique package paths for a specific batch index."""
batches = get_batches()
if batch_index < 0 or batch_index >= len(batches):
return ""
return " ".join(batches[batch_index])

if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "--count":
print(get_batch_indices())
elif len(sys.argv) > 2 and sys.argv[1] == "--slice":
print(get_batch_slice(int(sys.argv[2])))
5 changes: 5 additions & 0 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ case ${TEST_TYPE} in
nox -s unit-3.14
retval=$?
;;
"3.15")
# This is needed to speed up builds
nox --force-venv-backend uv -s unit-3.15
retval=$?
;;
*)
echo "unsupported PY_VERSION"
exit 1
Expand Down
49 changes: 0 additions & 49 deletions packages/bigframes/mypy.ini

This file was deleted.

6 changes: 5 additions & 1 deletion packages/bigframes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

DEFAULT_PYTHON_VERSION = "3.14"

ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"]
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
PYTEST_VERSION,
Expand Down Expand Up @@ -283,6 +283,10 @@ def run_unit(session, install_test_extra):
@nox.session(python=ALL_PYTHON)
@nox.parametrize("test_extra", [True, False])
def unit(session, test_extra):
if session.python == "3.15":
session.skip(
"Skipping 3.15 until wheels are available for pyarrow. Also pyproj wheels are needed for dependency geopandas."
)
if test_extra:
run_unit(session, install_test_extra=test_extra)
else:
Expand Down
5 changes: 5 additions & 0 deletions packages/bigquery-magics/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

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

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions packages/db-dtypes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

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

# Compliance tests only run on the latest Python version
if test_type == "compliance" and session.python != DEFAULT_PYTHON_VERSION:
Expand Down
Empty file.
1 change: 1 addition & 0 deletions packages/django-google-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"3.12",
"3.13",
"3.14",
"3.15",
]
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions packages/gcp-sphinx-docfx-yaml/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import nox

DEFAULT_PYTHON_VERSION = "3.14"
UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
# Path to the centralized mypy configuration file at the repository root.
# Search upwards to support running nox from both monorepo packages and integration test goldens.
Expand Down Expand Up @@ -166,7 +166,7 @@ def unit(session):
# Re-enable 3.11, 3.12, and 3.13 after environment verification.
# TODO(https://github.com/googleapis/google-cloud-python/issues/16176):
# Track 3.14 compatibility as upstream dependencies stabilize.
_skip_python_session(session, ["3.11", "3.12", "3.13", "3.14"])
_skip_python_session(session, ["3.11", "3.12", "3.13", "3.14", "3.15"])
session.install("-r", "requirements.txt")
session.install("pytest", "pytest-cov")
session.run(
Expand Down
7 changes: 3 additions & 4 deletions packages/google-api-core/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
RUFF_VERSION = "ruff==0.14.14"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"]
SUPPORTED_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]

DEFAULT_PYTHON_VERSION = "3.14"
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand Down Expand Up @@ -231,14 +230,14 @@ def default(
if prerelease:
install_prerelease_dependencies(
session,
f"{constraints_dir}/constraints-{constraints_type}{SUPPORTED_PYTHON_VERSIONS[0]}.txt",
f"{constraints_dir}/constraints-{constraints_type}{ALL_PYTHON[0]}.txt",
)
# This *must* be the last install command to get the package from source.
session.install("-e", lib_with_extras, "--no-deps")
elif install_deps_from_source:
install_core_deps_dependencies(
session,
f"{constraints_dir}/constraints-{constraints_type}{SUPPORTED_PYTHON_VERSIONS[0]}.txt",
f"{constraints_dir}/constraints-{constraints_type}{ALL_PYTHON[0]}.txt",
)
# This *must* be the last install command to get the package from source.
session.install("-e", lib_with_extras, "--no-deps")
Expand Down
Empty file.
1 change: 1 addition & 0 deletions packages/google-auth-httplib2/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"3.12",
"3.13",
"3.14",
"3.15",
]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down
Empty file.
1 change: 1 addition & 0 deletions packages/google-auth-oauthlib/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"3.12",
"3.13",
"3.14",
"3.15",
]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down
Empty file.
6 changes: 2 additions & 4 deletions packages/google-auth/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

UNIT_TEST_PYTHON_VERSIONS = [
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
"3.15",
]
ALL_PYTHON = UNIT_TEST_PYTHON_VERSIONS.copy()

Expand Down
Empty file.
3 changes: 2 additions & 1 deletion packages/google-cloud-access-context-manager/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = UNIT_TEST_PYTHON_VERSIONS[-1]
DEFAULT_PYTHON_VERSION = "3.14"

UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down
3 changes: 2 additions & 1 deletion packages/google-cloud-audit-log/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = UNIT_TEST_PYTHON_VERSIONS[-1]
DEFAULT_PYTHON_VERSION = "3.14"

UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion packages/google-cloud-bigquery/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
branch = True

[report]
fail_under = 100
fail_under = 99
show_missing = True
omit =
google/cloud/bigquery/__init__.py
Expand Down
6 changes: 5 additions & 1 deletion packages/google-cloud-bigquery/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
)

DEFAULT_PYTHON_VERSION = "3.14"
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"]
ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
UNIT_TEST_PYTHON_VERSIONS = ALL_PYTHON
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
# Path to the centralized mypy configuration file at the repository root.
Expand Down Expand Up @@ -180,6 +180,10 @@ def default(session, install_extras=True):
@_calculate_duration
def unit(session, test_type):
"""Run the unit test suite."""
if session.python == "3.15":
session.skip(
"Skipping 3.15 until wheels are available for pyarrow. Also pyproj wheels are needed for dependency geopandas."
)

install_extras = True
if test_type == "unit_noextras":
Expand Down
Empty file.
Loading
Loading