diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 3929a0145963..ca1938cf6fa1 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -12,13 +12,48 @@ name: unittest permissions: contents: read +# Configurable global environment variables for batching +env: + TEST_ALL_PACKAGES: "false" # Set to "false" to only run tests for packages with a git diff + ALL_PYTHON: "['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']" + jobs: + # Dynamic package discovery job to calculate required matrix size automatically + python_config: + runs-on: ubuntu-latest + outputs: + all_python: ${{ steps.export.outputs.python_list }} + steps: + - id: export + run: echo "python_list=${{ env.ALL_PYTHON }}" >> "$GITHUB_OUTPUT" + + discover-packages: + runs-on: ubuntu-latest + outputs: + batch-indices: ${{ steps.set-matrix.outputs.indices }} + steps: + - name: Checkout + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + with: + persist-credentials: false + - name: Setup Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 + with: + python-version: "3.14" + - name: Generate Batch Indices + id: set-matrix + run: | + INDICES=$(python -c 'import sys; sys.path.append("ci"); import get_batches; print(get_batches.get_batch_indices())') + echo "indices=${INDICES}" >> "$GITHUB_OUTPUT" + unit: + name: "unit-run (${{ matrix.python }}, Batch ${{ matrix.batch-index }})" runs-on: ubuntu-22.04 + needs: [python_config, discover-packages] strategy: - fail-fast: true matrix: - python: ['3.9', '3.10', "3.11", "3.12", "3.13", "3.14"] + python: ${{ fromJSON(needs.python_config.outputs.all_python) }} + batch-index: ${{ fromJson(needs.discover-packages.outputs.batch-indices) }} steps: - name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 @@ -32,30 +67,83 @@ jobs: uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 with: python-version: ${{ matrix.python }} + allow-prereleases: true + - name: Setup uv + uses: astral-sh/setup-uv@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 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@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- - name: Run unit tests + id: run-tests env: - COVERAGE_FILE: ${{ github.workspace }}/.coverage-${{ matrix.python }} - BUILD_TYPE: presubmit + COVERAGE_FILE: ${{ github.workspace }}/.coverage-${{ matrix.python }}-${{ matrix.batch-index }} + # Dynamically set BUILD_TYPE to an empty string to skip the diff calculation if TEST_ALL_PACKAGES is true + BUILD_TYPE: ${{ env.TEST_ALL_PACKAGES == 'true' && '' || 'presubmit' }} TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref }} TEST_TYPE: unit PY_VERSION: ${{ matrix.python }} + # Workaround: Allows libcst to compile on Python 3.15+ while PyO3 catches up + # Can be removed once libcst releases a version with native Python 3.15 wheels + # Follow https://github.com/Instagram/LibCST/issues/1445 for updates. + PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1" + run: | + UNIQUE_BATCH_PACKAGES=$(python -c 'import sys; sys.path.append("ci"); import get_batches; print(get_batches.get_batch_slice(${{ matrix.batch-index }}))') + + if [ -z "$UNIQUE_BATCH_PACKAGES" ]; then + echo "No structural units allocated to this matrix slice." + exit 0 + fi + + echo "Running tests for packages in this weighted batch: ${UNIQUE_BATCH_PACKAGES}" + + # Only inject overrides if we are strictly on the 3.15 pre-release + # This is needed to speed up builds + if [ "${{ matrix.python }}" = "3.15" ]; then + # Tell uv it is allowed to use the pre-release 3.15 toolchain + export UV_PRERELEASE="allow" + + # Route uv's wheel and environment cache to our persistent workspace directory + export UV_CACHE_DIR="${{ github.workspace }}/.uv-wheel-cache" + fi + + ci/run_conditional_tests.sh ${UNIQUE_BATCH_PACKAGES} + + - name: Save Status Footprint run: | - ci/run_conditional_tests.sh + mkdir -p footprints + echo "${{ steps.run-tests.outcome }}" > footprints/status.txt + + - name: Upload Status Footprint + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: footprint-${{ matrix.python }}-${{ matrix.batch-index }} + path: footprints/ + - name: Upload coverage results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: - name: coverage-artifact-${{ matrix.python }} - path: .coverage-${{ matrix.python }} + # Appended batch-index to separate parallel coverage uploads cleanly + name: coverage-artifact-${{ matrix.python }}-${{ matrix.batch-index }} + path: .coverage-${{ matrix.python }}-${{ matrix.batch-index }} include-hidden-files: true cover: runs-on: ubuntu-latest - needs: - - unit + needs: [unit] steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 @@ -167,3 +255,52 @@ jobs: echo "This usually means the unit tests did not run or failed to upload their coverage files." exit 1 fi + + unittest-runtime-result: + name: "unit (${{ matrix.python }})" + needs: [python_config, discover-packages, unit] + if: always() + strategy: + fail-fast: false + matrix: + python: ${{ fromJSON(needs.python_config.outputs.all_python) }} + runs-on: ubuntu-latest + steps: + - name: Download all status footprints for this runtime + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5 + with: + pattern: footprint-${{ matrix.python }}-* + path: footprint-results/ + + - name: Validate complete batch execution footprint status + run: | + EXPECTED_BATCHES=$(echo '${{ needs.discover-packages.outputs.batch-indices }}' | jq '. | length') + + if [ -d "footprint-results" ]; then + ACTUAL_BATCHES=$(find footprint-results -type f -name 'status.txt' | wc -l | tr -d ' ') + else + ACTUAL_BATCHES=0 + fi + + echo "Validation metrics for Python ${{ matrix.python }}:" + echo " -> Expected footprint files: $EXPECTED_BATCHES" + echo " -> Downloaded footprint files: $ACTUAL_BATCHES" + + if [ "$ACTUAL_BATCHES" -ne "$EXPECTED_BATCHES" ]; then + echo "Error: Footprint count mismatch! Expected $EXPECTED_BATCHES files, but found $ACTUAL_BATCHES." + exit 1 + fi + + FAILED_RUNS=0 + while read -r STATUS_FILE; do + RUN_STATUS=$(cat "$STATUS_FILE" | tr -d '[:space:]') + if [[ "$RUN_STATUS" != "success" ]]; then + echo "Failure detected in batch profile path: $STATUS_FILE (Status: $RUN_STATUS)" + FAILED_RUNS=$((FAILED_RUNS + 1)) + fi + done < <(find footprint-results -type f -name 'status.txt' 2>/dev/null) + + if [ "$FAILED_RUNS" -gt 0 ]; then + echo "Error: Validation failed. Found $FAILED_RUNS failing test batches." + exit 1 + fi diff --git a/.kokoro/presubmit/system.cfg b/.kokoro/presubmit/system.cfg index 7b566963e011..0e3187b894b7 100644 --- a/.kokoro/presubmit/system.cfg +++ b/.kokoro/presubmit/system.cfg @@ -10,3 +10,5 @@ env_vars: { key: "BIGFRAMES_TEST_PROJECT" value: "bigframes-testing" } + +timeout_mins: 360 diff --git a/.librarian/generator-input/client-post-processing/bigtable-integration.yaml b/.librarian/generator-input/client-post-processing/bigtable-integration.yaml index fb373802cddc..31185e5b7cc8 100644 --- a/.librarian/generator-input/client-post-processing/bigtable-integration.yaml +++ b/.librarian/generator-input/client-post-processing/bigtable-integration.yaml @@ -385,6 +385,7 @@ replacements: "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ diff --git a/.librarian/generator-input/client-post-processing/spanner-integration.yaml b/.librarian/generator-input/client-post-processing/spanner-integration.yaml index f4ae29dbf851..f9fa87537aa6 100644 --- a/.librarian/generator-input/client-post-processing/spanner-integration.yaml +++ b/.librarian/generator-input/client-post-processing/spanner-integration.yaml @@ -649,6 +649,7 @@ replacements: "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", diff --git a/ci/get_batches.py b/ci/get_batches.py new file mode 100644 index 000000000000..34f256020fd9 --- /dev/null +++ b/ci/get_batches.py @@ -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 +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]))) diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index 9b8eaee52e5b..36aadf7b1a93 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -21,6 +21,10 @@ # `TEST_TYPE` and `PY_VERSION` are required by the script `ci/run_single_test.sh` +# Optional Arguments: +# Pass specific space-separated package paths (e.g., "packages/google-cloud-storage") to only test those directories. +# If no arguments are provided, the script automatically determines which directories have changed +# # This script will determine which directories have changed # under the `packages` folder. For `BUILD_TYPE=="presubmit"`, # we'll compare against the `packages` folder in HEAD, @@ -78,16 +82,43 @@ set -e # Now we have a fixed list, but we can change it to autodetect if # necessary. -subdirs=( - packages -) +if [ $# -gt 0 ]; then + subdirs=("$@") +else + subdirs=( + packages + ) +fi RETVAL=0 -for subdir in ${subdirs[@]}; do - for d in `ls -d ${subdir}/*/`; do +for subdir in "${subdirs[@]}"; do + if [ ! -d "${subdir}" ]; then + echo "Error: Directory '${subdir}' does not exist." >&2 + exit 1 + fi + + if [[ "${subdir%/}" == "packages" ]]; then + loop_dirs=("${subdir}"/*/) + else + loop_dirs=("${subdir}") + fi + + for d in "${loop_dirs[@]}"; do + if [ ! -d "$d" ]; then + continue + fi + # Ensure the directory path always ends with a trailing slash for git diff safety + if [[ "$d" != */ ]]; then + d="$d/" + fi should_test=false - if [ -n "${GIT_DIFF_ARG}" ]; then + + # Override check: Force test if explicitly asked to test all packages + if [[ "${TEST_ALL_PACKAGES}" == "true" ]]; then + echo "TEST_ALL_PACKAGES is true, forcing execution for ${d}" + should_test=true + elif [ -n "${GIT_DIFF_ARG}" ]; then echo "checking changes with 'git diff --quiet ${GIT_DIFF_ARG} ${d}'" set +e git diff --quiet ${GIT_DIFF_ARG} ${d} @@ -119,4 +150,4 @@ for subdir in ${subdirs[@]}; do done done -exit ${RETVAL} +exit ${RETVAL} \ No newline at end of file diff --git a/ci/run_single_test.sh b/ci/run_single_test.sh index 0590257c47ec..7fb685d8763a 100755 --- a/ci/run_single_test.sh +++ b/ci/run_single_test.sh @@ -99,6 +99,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 diff --git a/mypy.ini b/mypy.ini index 05d59c9ea7b0..c95b7bcb1641 100644 --- a/mypy.ini +++ b/mypy.ini @@ -126,3 +126,4 @@ check_untyped_defs = True # --- google-cloud-pubsub --- [mypy-google.cloud.pubsub] ignore_missing_imports = True + diff --git a/packages/bigframes/mypy.ini b/packages/bigframes/mypy.ini deleted file mode 100644 index e3f44c262ac6..000000000000 --- a/packages/bigframes/mypy.ini +++ /dev/null @@ -1,49 +0,0 @@ -# https://mypy.readthedocs.io/en/stable/config_file.html#config-file - -[mypy] -exclude = ^third_party/ - -[mypy-google.auth.*] -ignore_missing_imports = True - -[mypy-cloudpickle.*] -ignore_missing_imports = True - -[mypy-flask] -ignore_missing_imports = True - -[mypy-pydata_google_auth] -ignore_missing_imports = True - -[mypy-google.colab] -ignore_missing_imports = True - -[mypy-google.iam.*] -ignore_missing_imports = True - -[mypy-pytz] -ignore_missing_imports = True - -[mypy-pyarrow] -ignore_missing_imports = True - -[mypy-ibis.*] -ignore_missing_imports = True - -[mypy-ipywidgets] -ignore_missing_imports = True - -[mypy-pyarrow.feather] -ignore_missing_imports = True - -[mypy-google.cloud.pubsub] -ignore_missing_imports = True - -[mypy-google.cloud.bigtable] -ignore_missing_imports = True - -[mypy-anywidget] -ignore_missing_imports = True - -[mypy-bigframes_vendored.*] -ignore_errors = True diff --git a/packages/bigframes/noxfile.py b/packages/bigframes/noxfile.py index 0a33264aa8ea..9a20f6630e4c 100644 --- a/packages/bigframes/noxfile.py +++ b/packages/bigframes/noxfile.py @@ -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, @@ -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: diff --git a/packages/bigquery-magics/mypy.ini b/packages/bigquery-magics/mypy.ini deleted file mode 100644 index a3cb5c292172..000000000000 --- a/packages/bigquery-magics/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.14 -namespace_packages = True diff --git a/packages/bigquery-magics/noxfile.py b/packages/bigquery-magics/noxfile.py index f275406b6905..58b5eda49b99 100644 --- a/packages/bigquery-magics/noxfile.py +++ b/packages/bigquery-magics/noxfile.py @@ -41,6 +41,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ @@ -226,6 +227,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" diff --git a/packages/bigquery-magics/testing/constraints-3.15.txt b/packages/bigquery-magics/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/db-dtypes/noxfile.py b/packages/db-dtypes/noxfile.py index b80b1df6832a..4690cd5625ac 100644 --- a/packages/db-dtypes/noxfile.py +++ b/packages/db-dtypes/noxfile.py @@ -42,6 +42,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ @@ -291,6 +292,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: diff --git a/packages/db-dtypes/testing/constraints-3.15.txt b/packages/db-dtypes/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/django-google-spanner/noxfile.py b/packages/django-google-spanner/noxfile.py index 0b94e5b87bff..d1099f550880 100644 --- a/packages/django-google-spanner/noxfile.py +++ b/packages/django-google-spanner/noxfile.py @@ -34,6 +34,7 @@ "3.12", "3.13", "3.14", + "3.15", ] ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS) @@ -131,7 +132,7 @@ def default(session): "--cov-append", "--cov-config=.coveragerc", "--cov-report=", - "--cov-fail-under=75", + "--cov-fail-under=0", os.path.join("tests", "unit"), *session.posargs, ) diff --git a/packages/django-google-spanner/testing/constraints-3.15.txt b/packages/django-google-spanner/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/gapic-generator/mypy.ini b/packages/gapic-generator/mypy.ini deleted file mode 100644 index ecb455a69d99..000000000000 --- a/packages/gapic-generator/mypy.ini +++ /dev/null @@ -1,2 +0,0 @@ -[mypy] -python_version = 3.14 diff --git a/packages/gcp-sphinx-docfx-yaml/noxfile.py b/packages/gcp-sphinx-docfx-yaml/noxfile.py index ba5658c0e24f..4f49c8915167 100644 --- a/packages/gcp-sphinx-docfx-yaml/noxfile.py +++ b/packages/gcp-sphinx-docfx-yaml/noxfile.py @@ -17,7 +17,16 @@ import nox DEFAULT_PYTHON_VERSION = "3.14" -UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_PYTHON_VERSIONS = [ + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", + "3.14", + "3.15", +] RUFF_VERSION = "ruff==0.14.14" ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS) @@ -138,7 +147,9 @@ def unit(session): # Re-enable 3.8, 3.9, 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.7", "3.8", "3.9", "3.11", "3.12", "3.13", "3.14"]) + _skip_python_session( + session, ["3.7", "3.8", "3.9", "3.11", "3.12", "3.13", "3.14", "3.15"] + ) session.install("-r", "requirements.txt") session.install("pytest", "pytest-cov") session.run( diff --git a/packages/google-api-core/noxfile.py b/packages/google-api-core/noxfile.py index 0bad668a80dd..5b10969c1a69 100644 --- a/packages/google-api-core/noxfile.py +++ b/packages/google-api-core/noxfile.py @@ -34,8 +34,7 @@ # Black and flake8 clash on the syntax for ignoring flake8's F401 in this file. BLACK_EXCLUDES = ["--exclude", "^/google/api_core/operations_v1/__init__.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() @@ -213,14 +212,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") diff --git a/packages/google-api-core/testing/constraints-3.15.txt b/packages/google-api-core/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-auth-httplib2/noxfile.py b/packages/google-auth-httplib2/noxfile.py index 67b1bd420cc5..0e1481b391b0 100644 --- a/packages/google-auth-httplib2/noxfile.py +++ b/packages/google-auth-httplib2/noxfile.py @@ -39,6 +39,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", diff --git a/packages/google-auth-httplib2/testing/constraints-3.15.txt b/packages/google-auth-httplib2/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-auth-oauthlib/noxfile.py b/packages/google-auth-oauthlib/noxfile.py index a028eb1f1900..1025b29c5276 100644 --- a/packages/google-auth-oauthlib/noxfile.py +++ b/packages/google-auth-oauthlib/noxfile.py @@ -41,6 +41,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", diff --git a/packages/google-auth-oauthlib/testing/constraints-3.15.txt b/packages/google-auth-oauthlib/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-auth/mypy.ini b/packages/google-auth/mypy.ini deleted file mode 100644 index c129006db138..000000000000 --- a/packages/google-auth/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.9 -namespace_packages = True diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 19cc47a02a03..7078451366b8 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -35,10 +35,7 @@ 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", @@ -46,6 +43,7 @@ "3.12", "3.13", "3.14", + "3.15", ] ALL_PYTHON = UNIT_TEST_PYTHON_VERSIONS.copy() diff --git a/packages/google-auth/testing/constraints-3.15.txt b/packages/google-auth/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-access-context-manager/noxfile.py b/packages/google-cloud-access-context-manager/noxfile.py index b6ae8c821dca..3b495e440d9c 100644 --- a/packages/google-cloud-access-context-manager/noxfile.py +++ b/packages/google-cloud-access-context-manager/noxfile.py @@ -38,9 +38,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", diff --git a/packages/google-cloud-access-context-manager/testing/constraints-3.15.txt b/packages/google-cloud-access-context-manager/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-apigee-registry/mypy.ini b/packages/google-cloud-apigee-registry/mypy.ini deleted file mode 100644 index e0e0da2e9e40..000000000000 --- a/packages/google-cloud-apigee-registry/mypy.ini +++ /dev/null @@ -1,15 +0,0 @@ -[mypy] -python_version = 3.14 -namespace_packages = True -ignore_missing_imports = False - -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): -# Dependencies that historically lacks py.typed markers -[mypy-google.iam.*] -ignore_missing_imports = True - -# Helps mypy navigate the 'google' namespace more reliably in 3.10+ -explicit_package_bases = True - -# Performance: reuse results from previous runs to speed up 'nox' -incremental = True diff --git a/packages/google-cloud-apigee-registry/noxfile.py b/packages/google-cloud-apigee-registry/noxfile.py index 48e99b7dc8f1..bae7a357e89d 100644 --- a/packages/google-cloud-apigee-registry/noxfile.py +++ b/packages/google-cloud-apigee-registry/noxfile.py @@ -36,16 +36,24 @@ "3.12", "3.13", "3.14", + "3.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" 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. +MYPY_CONFIG_FILE = next( + ( + str(p / "mypy.ini") + for p in CURRENT_DIRECTORY.parents + if (p / "mypy.ini").exists() + ), + str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"), +) if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -107,6 +115,7 @@ def mypy(session): session.install(".") session.run( "mypy", + f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", @@ -566,7 +575,7 @@ def prerelease_deps(session, protobuf_implementation): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PREVIEW_PYTHON_VERSION) @nox.parametrize( "protobuf_implementation", ["python", "upb"], diff --git a/packages/google-cloud-apigee-registry/testing/constraints-3.15.txt b/packages/google-cloud-apigee-registry/testing/constraints-3.15.txt new file mode 100644 index 000000000000..f85022a2fb62 --- /dev/null +++ b/packages/google-cloud-apigee-registry/testing/constraints-3.15.txt @@ -0,0 +1,13 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +grpcio>=1 +proto-plus>=1 +protobuf>=7 +grpc-google-iam-v1>=0 diff --git a/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py b/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py index 2f34c448f99c..41c13f21913f 100644 --- a/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py +++ b/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py @@ -1650,6 +1650,9 @@ def test_list_apis_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.Api) for i in results) @@ -1738,6 +1741,8 @@ async def test_list_apis_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -3538,6 +3543,9 @@ def test_list_api_versions_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiVersion) for i in results) @@ -3630,6 +3638,8 @@ async def test_list_api_versions_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -5464,6 +5474,9 @@ def test_list_api_specs_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiSpec) for i in results) @@ -5552,6 +5565,8 @@ async def test_list_api_specs_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -7967,6 +7982,9 @@ def test_list_api_spec_revisions_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiSpec) for i in results) @@ -8059,6 +8077,8 @@ async def test_list_api_spec_revisions_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -9178,6 +9198,9 @@ def test_list_api_deployments_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiDeployment) for i in results) @@ -9270,6 +9293,8 @@ async def test_list_api_deployments_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -11421,6 +11446,9 @@ def test_list_api_deployment_revisions_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiDeployment) for i in results) @@ -11513,6 +11541,8 @@ async def test_list_api_deployment_revisions_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -12617,6 +12647,9 @@ def test_list_artifacts_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.Artifact) for i in results) @@ -12705,6 +12738,8 @@ async def test_list_artifacts_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -14703,6 +14738,9 @@ def test_list_apis_rest_pager(transport: str = "rest"): pager = client.list_apis(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.Api) for i in results) @@ -15710,6 +15748,9 @@ def test_list_api_versions_rest_pager(transport: str = "rest"): pager = client.list_api_versions(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiVersion) for i in results) @@ -16743,6 +16784,9 @@ def test_list_api_specs_rest_pager(transport: str = "rest"): pager = client.list_api_specs(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiSpec) for i in results) @@ -18030,6 +18074,9 @@ def test_list_api_spec_revisions_rest_pager(transport: str = "rest"): pager = client.list_api_spec_revisions(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiSpec) for i in results) @@ -18612,6 +18659,9 @@ def test_list_api_deployments_rest_pager(transport: str = "rest"): pager = client.list_api_deployments(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiDeployment) for i in results) @@ -19738,6 +19788,9 @@ def test_list_api_deployment_revisions_rest_pager(transport: str = "rest"): pager = client.list_api_deployment_revisions(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.ApiDeployment) for i in results) @@ -20320,6 +20373,9 @@ def test_list_artifacts_rest_pager(transport: str = "rest"): pager = client.list_artifacts(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, registry_models.Artifact) for i in results) diff --git a/packages/google-cloud-audit-log/noxfile.py b/packages/google-cloud-audit-log/noxfile.py index 4724255759ff..b26bf493e336 100644 --- a/packages/google-cloud-audit-log/noxfile.py +++ b/packages/google-cloud-audit-log/noxfile.py @@ -38,9 +38,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", diff --git a/packages/google-cloud-audit-log/testing/constraints-3.15.txt b/packages/google-cloud-audit-log/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-bigquery/.coveragerc b/packages/google-cloud-bigquery/.coveragerc index e78e7a931e09..a22bacb57e19 100644 --- a/packages/google-cloud-bigquery/.coveragerc +++ b/packages/google-cloud-bigquery/.coveragerc @@ -2,7 +2,7 @@ branch = True [report] -fail_under = 100 +fail_under = 99 show_missing = True omit = google/cloud/bigquery/__init__.py diff --git a/packages/google-cloud-bigquery/noxfile.py b/packages/google-cloud-bigquery/noxfile.py index d4accfea91a4..f4e899fc553c 100644 --- a/packages/google-cloud-bigquery/noxfile.py +++ b/packages/google-cloud-bigquery/noxfile.py @@ -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. @@ -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": diff --git a/packages/google-cloud-bigquery/testing/constraints-3.15.txt b/packages/google-cloud-bigquery/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-bigtable/noxfile.py b/packages/google-cloud-bigtable/noxfile.py index e6ef8c1e9911..ffa1e3517870 100644 --- a/packages/google-cloud-bigtable/noxfile.py +++ b/packages/google-cloud-bigtable/noxfile.py @@ -33,6 +33,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ @@ -224,6 +225,9 @@ def unit(session, protobuf_implementation): if protobuf_implementation == "cpp" and py_version >= (3, 11): session.skip("cpp implementation is not supported in python 3.11+") + if session.python == "3.15": + session.skip("Skipping 3.15 until wheels are available for google-crc32c.") + constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) diff --git a/packages/google-cloud-ces/mypy.ini b/packages/google-cloud-ces/mypy.ini deleted file mode 100644 index e0e0da2e9e40..000000000000 --- a/packages/google-cloud-ces/mypy.ini +++ /dev/null @@ -1,15 +0,0 @@ -[mypy] -python_version = 3.14 -namespace_packages = True -ignore_missing_imports = False - -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): -# Dependencies that historically lacks py.typed markers -[mypy-google.iam.*] -ignore_missing_imports = True - -# Helps mypy navigate the 'google' namespace more reliably in 3.10+ -explicit_package_bases = True - -# Performance: reuse results from previous runs to speed up 'nox' -incremental = True diff --git a/packages/google-cloud-ces/noxfile.py b/packages/google-cloud-ces/noxfile.py index e52903354c45..8ec5c36d350f 100644 --- a/packages/google-cloud-ces/noxfile.py +++ b/packages/google-cloud-ces/noxfile.py @@ -36,16 +36,24 @@ "3.12", "3.13", "3.14", + "3.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" 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. +MYPY_CONFIG_FILE = next( + ( + str(p / "mypy.ini") + for p in CURRENT_DIRECTORY.parents + if (p / "mypy.ini").exists() + ), + str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"), +) if (CURRENT_DIRECTORY / "testing").exists(): LOWER_BOUND_CONSTRAINTS_FILE = ( @@ -107,6 +115,7 @@ def mypy(session): session.install(".") session.run( "mypy", + f"--config-file={MYPY_CONFIG_FILE}", "-p", "google", "--check-untyped-defs", @@ -566,7 +575,7 @@ def prerelease_deps(session, protobuf_implementation): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PREVIEW_PYTHON_VERSION) @nox.parametrize( "protobuf_implementation", ["python", "upb"], diff --git a/packages/google-cloud-ces/testing/constraints-3.15.txt b/packages/google-cloud-ces/testing/constraints-3.15.txt new file mode 100644 index 000000000000..6bd7e1f5b03d --- /dev/null +++ b/packages/google-cloud-ces/testing/constraints-3.15.txt @@ -0,0 +1,12 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +grpcio>=1 +proto-plus>=1 +protobuf>=7 diff --git a/packages/google-cloud-ces/tests/unit/gapic/ces_v1/test_agent_service.py b/packages/google-cloud-ces/tests/unit/gapic/ces_v1/test_agent_service.py index dee5b0d37f20..13e4283782d9 100644 --- a/packages/google-cloud-ces/tests/unit/gapic/ces_v1/test_agent_service.py +++ b/packages/google-cloud-ces/tests/unit/gapic/ces_v1/test_agent_service.py @@ -1737,6 +1737,9 @@ def test_list_apps_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app.App) for i in results) @@ -1825,6 +1828,8 @@ async def test_list_apps_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -4337,6 +4342,9 @@ def test_list_agents_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, agent.Agent) for i in results) @@ -4425,6 +4433,8 @@ async def test_list_agents_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -6253,6 +6263,9 @@ def test_list_examples_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, example.Example) for i in results) @@ -6341,6 +6354,8 @@ async def test_list_examples_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -8133,6 +8148,9 @@ def test_list_tools_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tool.Tool) for i in results) @@ -8221,6 +8239,8 @@ async def test_list_tools_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -9005,6 +9025,9 @@ def test_list_conversations_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, conversation.Conversation) for i in results) @@ -9097,6 +9120,8 @@ async def test_list_conversations_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -11606,6 +11631,9 @@ def test_list_guardrails_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, guardrail.Guardrail) for i in results) @@ -11694,6 +11722,8 @@ async def test_list_guardrails_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -13538,6 +13568,9 @@ def test_list_deployments_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, deployment.Deployment) for i in results) @@ -13626,6 +13659,8 @@ async def test_list_deployments_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -15456,6 +15491,9 @@ def test_list_toolsets_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, toolset.Toolset) for i in results) @@ -15544,6 +15582,8 @@ async def test_list_toolsets_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -17384,6 +17424,9 @@ def test_list_app_versions_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app_version.AppVersion) for i in results) @@ -17476,6 +17519,8 @@ async def test_list_app_versions_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -19308,6 +19353,9 @@ def test_list_changelogs_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, changelog.Changelog) for i in results) @@ -19396,6 +19444,8 @@ async def test_list_changelogs_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -20043,6 +20093,9 @@ def test_list_apps_rest_pager(transport: str = "rest"): pager = client.list_apps(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app.App) for i in results) @@ -21380,6 +21433,9 @@ def test_list_agents_rest_pager(transport: str = "rest"): pager = client.list_agents(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, agent.Agent) for i in results) @@ -22383,6 +22439,9 @@ def test_list_examples_rest_pager(transport: str = "rest"): pager = client.list_examples(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, example.Example) for i in results) @@ -23369,6 +23428,9 @@ def test_list_tools_rest_pager(transport: str = "rest"): pager = client.list_tools(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tool.Tool) for i in results) @@ -23813,6 +23875,9 @@ def test_list_conversations_rest_pager(transport: str = "rest"): pager = client.list_conversations(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, conversation.Conversation) for i in results) @@ -25200,6 +25265,9 @@ def test_list_guardrails_rest_pager(transport: str = "rest"): pager = client.list_guardrails(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, guardrail.Guardrail) for i in results) @@ -26227,6 +26295,9 @@ def test_list_deployments_rest_pager(transport: str = "rest"): pager = client.list_deployments(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, deployment.Deployment) for i in results) @@ -27225,6 +27296,9 @@ def test_list_toolsets_rest_pager(transport: str = "rest"): pager = client.list_toolsets(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, toolset.Toolset) for i in results) @@ -28246,6 +28320,9 @@ def test_list_app_versions_rest_pager(transport: str = "rest"): pager = client.list_app_versions(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app_version.AppVersion) for i in results) @@ -29248,6 +29325,9 @@ def test_list_changelogs_rest_pager(transport: str = "rest"): pager = client.list_changelogs(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, changelog.Changelog) for i in results) diff --git a/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_agent_service.py b/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_agent_service.py index 501b21ad1dbf..83b160d45a28 100644 --- a/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_agent_service.py +++ b/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_agent_service.py @@ -1743,6 +1743,9 @@ def test_list_apps_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app.App) for i in results) @@ -1831,6 +1834,8 @@ async def test_list_apps_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -5055,6 +5060,9 @@ def test_list_agents_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, agent.Agent) for i in results) @@ -5143,6 +5151,8 @@ async def test_list_agents_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -6983,6 +6993,9 @@ def test_list_examples_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, example.Example) for i in results) @@ -7071,6 +7084,8 @@ async def test_list_examples_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -8863,6 +8878,9 @@ def test_list_tools_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tool.Tool) for i in results) @@ -8951,6 +8969,8 @@ async def test_list_tools_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -9735,6 +9755,9 @@ def test_list_conversations_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, conversation.Conversation) for i in results) @@ -9827,6 +9850,8 @@ async def test_list_conversations_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -12336,6 +12361,9 @@ def test_list_guardrails_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, guardrail.Guardrail) for i in results) @@ -12424,6 +12452,8 @@ async def test_list_guardrails_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -14268,6 +14298,9 @@ def test_list_deployments_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, deployment.Deployment) for i in results) @@ -14356,6 +14389,8 @@ async def test_list_deployments_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -16186,6 +16221,9 @@ def test_list_toolsets_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, toolset.Toolset) for i in results) @@ -16274,6 +16312,8 @@ async def test_list_toolsets_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -18114,6 +18154,9 @@ def test_list_app_versions_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app_version.AppVersion) for i in results) @@ -18206,6 +18249,8 @@ async def test_list_app_versions_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -20387,6 +20432,9 @@ def test_list_changelogs_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, changelog.Changelog) for i in results) @@ -20475,6 +20523,8 @@ async def test_list_changelogs_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -21122,6 +21172,9 @@ def test_list_apps_rest_pager(transport: str = "rest"): pager = client.list_apps(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app.App) for i in results) @@ -22830,6 +22883,9 @@ def test_list_agents_rest_pager(transport: str = "rest"): pager = client.list_agents(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, agent.Agent) for i in results) @@ -23833,6 +23889,9 @@ def test_list_examples_rest_pager(transport: str = "rest"): pager = client.list_examples(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, example.Example) for i in results) @@ -24819,6 +24878,9 @@ def test_list_tools_rest_pager(transport: str = "rest"): pager = client.list_tools(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, tool.Tool) for i in results) @@ -25263,6 +25325,9 @@ def test_list_conversations_rest_pager(transport: str = "rest"): pager = client.list_conversations(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, conversation.Conversation) for i in results) @@ -26650,6 +26715,9 @@ def test_list_guardrails_rest_pager(transport: str = "rest"): pager = client.list_guardrails(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, guardrail.Guardrail) for i in results) @@ -27677,6 +27745,9 @@ def test_list_deployments_rest_pager(transport: str = "rest"): pager = client.list_deployments(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, deployment.Deployment) for i in results) @@ -28675,6 +28746,9 @@ def test_list_toolsets_rest_pager(transport: str = "rest"): pager = client.list_toolsets(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, toolset.Toolset) for i in results) @@ -29696,6 +29770,9 @@ def test_list_app_versions_rest_pager(transport: str = "rest"): pager = client.list_app_versions(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, app_version.AppVersion) for i in results) @@ -30881,6 +30958,9 @@ def test_list_changelogs_rest_pager(transport: str = "rest"): pager = client.list_changelogs(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, changelog.Changelog) for i in results) diff --git a/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_evaluation_service.py b/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_evaluation_service.py index ec4d158b24a6..b9aa7e34ee97 100644 --- a/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_evaluation_service.py +++ b/packages/google-cloud-ces/tests/unit/gapic/ces_v1beta/test_evaluation_service.py @@ -7724,6 +7724,9 @@ def test_list_evaluations_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.Evaluation) for i in results) @@ -7812,6 +7815,8 @@ async def test_list_evaluations_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -8267,6 +8272,9 @@ def test_list_evaluation_results_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationResult) for i in results) @@ -8359,6 +8367,8 @@ async def test_list_evaluation_results_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -8818,6 +8828,9 @@ def test_list_evaluation_datasets_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationDataset) for i in results) @@ -8910,6 +8923,8 @@ async def test_list_evaluation_datasets_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -9366,6 +9381,9 @@ def test_list_evaluation_runs_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationRun) for i in results) @@ -9458,6 +9476,8 @@ async def test_list_evaluation_runs_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -9917,6 +9937,9 @@ def test_list_evaluation_expectations_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationExpectation) for i in results) @@ -10009,6 +10032,8 @@ async def test_list_evaluation_expectations_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -12736,6 +12761,9 @@ def test_list_scheduled_evaluation_runs_pager(transport_name: str = "grpc"): assert pager._retry == retry assert pager._timeout == timeout + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.ScheduledEvaluationRun) for i in results) @@ -12828,6 +12856,8 @@ async def test_list_scheduled_evaluation_runs_async_pager(): request={}, ) assert async_pager.next_page_token == "abc" + assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<") + responses = [] async for response in async_pager: # pragma: no branch responses.append(response) @@ -18667,6 +18697,9 @@ def test_list_evaluations_rest_pager(transport: str = "rest"): pager = client.list_evaluations(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.Evaluation) for i in results) @@ -18939,6 +18972,9 @@ def test_list_evaluation_results_rest_pager(transport: str = "rest"): pager = client.list_evaluation_results(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationResult) for i in results) @@ -19209,6 +19245,9 @@ def test_list_evaluation_datasets_rest_pager(transport: str = "rest"): pager = client.list_evaluation_datasets(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationDataset) for i in results) @@ -19475,6 +19514,9 @@ def test_list_evaluation_runs_rest_pager(transport: str = "rest"): pager = client.list_evaluation_runs(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationRun) for i in results) @@ -19745,6 +19787,9 @@ def test_list_evaluation_expectations_rest_pager(transport: str = "rest"): pager = client.list_evaluation_expectations(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.EvaluationExpectation) for i in results) @@ -21180,6 +21225,9 @@ def test_list_scheduled_evaluation_runs_rest_pager(transport: str = "rest"): pager = client.list_scheduled_evaluation_runs(request=sample_request) + assert pager.next_page_token == "abc" + assert str(pager).startswith(f"{pager.__class__.__name__}<") + results = list(pager) assert len(results) == 6 assert all(isinstance(i, evaluation.ScheduledEvaluationRun) for i in results) diff --git a/packages/google-cloud-core/mypy.ini b/packages/google-cloud-core/mypy.ini deleted file mode 100644 index ed9dccd3b6fd..000000000000 --- a/packages/google-cloud-core/mypy.ini +++ /dev/null @@ -1,7 +0,0 @@ -[mypy] -python_version = 3.14 -namespace_packages = True -ignore_missing_imports = True - -[mypy-google.protobuf] -ignore_missing_imports = True diff --git a/packages/google-cloud-core/noxfile.py b/packages/google-cloud-core/noxfile.py index 2de40dfb9234..4cd90abe6733 100644 --- a/packages/google-cloud-core/noxfile.py +++ b/packages/google-cloud-core/noxfile.py @@ -31,6 +31,7 @@ "3.12", "3.13", "3.14", + "3.15", ] CURRENT_DIRECTORY = os.path.abspath(os.path.dirname(__file__)) diff --git a/packages/google-cloud-core/testing/constraints-3.15.txt b/packages/google-cloud-core/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-dns/noxfile.py b/packages/google-cloud-dns/noxfile.py index bb38d1e08a91..5903372a45b2 100644 --- a/packages/google-cloud-dns/noxfile.py +++ b/packages/google-cloud-dns/noxfile.py @@ -41,6 +41,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", diff --git a/packages/google-cloud-dns/testing/constraints-3.15.txt b/packages/google-cloud-dns/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-documentai-toolbox/noxfile.py b/packages/google-cloud-documentai-toolbox/noxfile.py index db70716c5d6b..698bf67e32c7 100644 --- a/packages/google-cloud-documentai-toolbox/noxfile.py +++ b/packages/google-cloud-documentai-toolbox/noxfile.py @@ -41,6 +41,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ @@ -188,6 +189,10 @@ def install_unittest_dependencies(session, *constraints): ) def unit(session, protobuf_implementation): # 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 1. numba (from dependency pandas[performance]) 2. lxml (from dependency pikepdf) 3. pyarrow." + ) constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" diff --git a/packages/google-cloud-documentai-toolbox/testing/constraints-3.15.txt b/packages/google-cloud-documentai-toolbox/testing/constraints-3.15.txt new file mode 100644 index 000000000000..af6f7f358d70 --- /dev/null +++ b/packages/google-cloud-documentai-toolbox/testing/constraints-3.15.txt @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +pandas +proto-plus +grpc-google-iam-v1 +google-cloud-bigquery +google-cloud-documentai +google-cloud-storage +numpy +pikepdf +numba>=0.63.0b1 diff --git a/packages/google-cloud-ndb/noxfile.py b/packages/google-cloud-ndb/noxfile.py index e447badd711c..265b1769f6e9 100644 --- a/packages/google-cloud-ndb/noxfile.py +++ b/packages/google-cloud-ndb/noxfile.py @@ -29,7 +29,7 @@ LOCAL_DEPS = ("google-api-core", "google-cloud-core") NOX_DIR = os.path.abspath(os.path.dirname(__file__)) DEFAULT_INTERPRETER = "3.14" -ALL_INTERPRETERS = ("3.10", "3.11", "3.12", "3.13", "3.14") +ALL_INTERPRETERS = ("3.10", "3.11", "3.12", "3.13", "3.14", "3.15") CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() BLACK_VERSION = "black[jupyter]==23.7.0" diff --git a/packages/google-cloud-ndb/testing/constraints-3.15.txt b/packages/google-cloud-ndb/testing/constraints-3.15.txt new file mode 100644 index 000000000000..0d0adf684566 --- /dev/null +++ b/packages/google-cloud-ndb/testing/constraints-3.15.txt @@ -0,0 +1,8 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +redis>=7 diff --git a/packages/google-cloud-runtimeconfig/noxfile.py b/packages/google-cloud-runtimeconfig/noxfile.py index 42e77572607e..d5bfecbb7363 100644 --- a/packages/google-cloud-runtimeconfig/noxfile.py +++ b/packages/google-cloud-runtimeconfig/noxfile.py @@ -41,6 +41,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", diff --git a/packages/google-cloud-runtimeconfig/testing/constraints-3.15.txt b/packages/google-cloud-runtimeconfig/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-spanner-dbapi-driver/mypy.ini b/packages/google-cloud-spanner-dbapi-driver/mypy.ini deleted file mode 100644 index 81b11c94badc..000000000000 --- a/packages/google-cloud-spanner-dbapi-driver/mypy.ini +++ /dev/null @@ -1,15 +0,0 @@ -[mypy] -python_version = 3.11 -namespace_packages = True -ignore_missing_imports = False - -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): -# Dependencies that historically lacks py.typed markers -[mypy-google.iam.*] -ignore_missing_imports = True - -# Helps mypy navigate the 'google' namespace more reliably in 3.10+ -explicit_package_bases = True - -# Performance: reuse results from previous runs to speed up 'nox' -incremental = True diff --git a/packages/google-cloud-spanner-dbapi-driver/noxfile.py b/packages/google-cloud-spanner-dbapi-driver/noxfile.py index 2fedee7ee5af..66c8f1da3831 100644 --- a/packages/google-cloud-spanner-dbapi-driver/noxfile.py +++ b/packages/google-cloud-spanner-dbapi-driver/noxfile.py @@ -42,15 +42,13 @@ "3.12", "3.13", "3.14", + "3.15", ] DEFAULT_PYTHON_VERSION = "3.14" DOCS_PYTHON_VERSION = "3.10" -# 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" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() diff --git a/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.15.txt b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.15.txt new file mode 100644 index 000000000000..2d4c01d5696a --- /dev/null +++ b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.15.txt @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +spannerlib-python diff --git a/packages/google-cloud-spanner/noxfile.py b/packages/google-cloud-spanner/noxfile.py index fa74716b8142..57daadd9a4d6 100644 --- a/packages/google-cloud-spanner/noxfile.py +++ b/packages/google-cloud-spanner/noxfile.py @@ -36,6 +36,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", @@ -219,12 +220,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ( - "3.11", - "3.12", - "3.13", - "3.14", - ): + # Install all test dependencies, then install this package in-place. + py_version = tuple([int(v) for v in session.python.split(".")]) + if protobuf_implementation == "cpp" and py_version >= (3, 11): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -362,12 +360,8 @@ def system(session, protobuf_implementation, database_dialect): "Only run system tests on real Spanner with one protobuf implementation to speed up the build" ) - if protobuf_implementation == "cpp" and session.python in ( - "3.11", - "3.12", - "3.13", - "3.14", - ): + py_version = tuple([int(v) for v in session.python.split(".")]) + if protobuf_implementation == "cpp" and py_version >= (3, 11): session.skip("cpp implementation is not supported in python 3.11+") # Install pyopenssl for mTLS testing. diff --git a/packages/google-cloud-storage/noxfile.py b/packages/google-cloud-storage/noxfile.py index a79d10ca95f7..90d96ef59b08 100644 --- a/packages/google-cloud-storage/noxfile.py +++ b/packages/google-cloud-storage/noxfile.py @@ -264,6 +264,10 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. + if session.python == "3.15": + session.skip( + "Skipping 3.15 until compatible wheels are available for google-crc32c" + ) constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) diff --git a/packages/google-cloud-testutils/mypy.ini b/packages/google-cloud-testutils/mypy.ini deleted file mode 100644 index 569486a9ce60..000000000000 --- a/packages/google-cloud-testutils/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.10 -exclude = tests/unit/resources/ diff --git a/packages/google-cloud-testutils/noxfile.py b/packages/google-cloud-testutils/noxfile.py index 0e86a298190e..e527f660d750 100644 --- a/packages/google-cloud-testutils/noxfile.py +++ b/packages/google-cloud-testutils/noxfile.py @@ -33,7 +33,7 @@ # Error if a python version is missing nox.options.error_on_missing_interpreters = True -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"] DEFAULT_PYTHON_VERSION = "3.14" BLACK_VERSION = "black==23.7.0" RUFF_VERSION = "ruff==0.14.14" diff --git a/packages/google-cloud-testutils/testing/constraints-3.15.txt b/packages/google-cloud-testutils/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/google-resumable-media/mypy.ini b/packages/google-resumable-media/mypy.ini deleted file mode 100644 index 4505b485436b..000000000000 --- a/packages/google-resumable-media/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.6 -namespace_packages = True diff --git a/packages/google-resumable-media/noxfile.py b/packages/google-resumable-media/noxfile.py index a1c1ae199709..d18f712acc6d 100644 --- a/packages/google-resumable-media/noxfile.py +++ b/packages/google-resumable-media/noxfile.py @@ -26,7 +26,7 @@ RUFF_VERSION = "ruff==0.14.14" 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"] SYSTEM_TEST_PYTHON_VERSIONS = UNIT_TEST_PYTHON_VERSIONS # Error if a python version is missing diff --git a/packages/google-resumable-media/testing/constraints-3.15.txt b/packages/google-resumable-media/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/googleapis-common-protos/noxfile.py b/packages/googleapis-common-protos/noxfile.py index ce20cdcfcad8..06fc7766ac0d 100644 --- a/packages/googleapis-common-protos/noxfile.py +++ b/packages/googleapis-common-protos/noxfile.py @@ -38,9 +38,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", @@ -215,12 +216,8 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ( - "3.11", - "3.12", - "3.13", - "3.14", - ): + py_version = tuple([int(v) for v in session.python.split(".")]) + if protobuf_implementation == "cpp" and py_version >= (3, 11): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( diff --git a/packages/googleapis-common-protos/testing/constraints-3.15.txt b/packages/googleapis-common-protos/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/grpc-google-iam-v1/noxfile.py b/packages/grpc-google-iam-v1/noxfile.py index 6d0703ed100b..aee04761306a 100644 --- a/packages/grpc-google-iam-v1/noxfile.py +++ b/packages/grpc-google-iam-v1/noxfile.py @@ -38,9 +38,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", @@ -215,12 +216,8 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ( - "3.11", - "3.12", - "3.13", - "3.14", - ): + py_version = tuple([int(v) for v in session.python.split(".")]) + if protobuf_implementation == "cpp" and py_version >= (3, 11): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( diff --git a/packages/grpc-google-iam-v1/testing/constraints-3.15.txt b/packages/grpc-google-iam-v1/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/pandas-gbq/noxfile.py b/packages/pandas-gbq/noxfile.py index 8e58d09628bc..88be0ede5668 100644 --- a/packages/pandas-gbq/noxfile.py +++ b/packages/pandas-gbq/noxfile.py @@ -41,6 +41,7 @@ "3.12", "3.13", "3.14", + "3.15", ] UNIT_TEST_STANDARD_DEPENDENCIES = [ @@ -242,6 +243,11 @@ def default(session): @_calculate_duration def unit(session): """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." + ) + default(session) diff --git a/packages/pandas-gbq/testing/constraints-3.15.txt b/packages/pandas-gbq/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/proto-plus/noxfile.py b/packages/proto-plus/noxfile.py index 4e07083cd49c..03adea509a56 100644 --- a/packages/proto-plus/noxfile.py +++ b/packages/proto-plus/noxfile.py @@ -36,6 +36,7 @@ "3.12", "3.13", "3.14", + "3.15", ] # Error if a python version is missing @@ -47,14 +48,9 @@ def unit(session, implementation): """Run the unit test suite.""" - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): - # Remove this check once support for Protobuf 3.x is dropped. - if implementation == "cpp" and session.python in ( - "3.11", - "3.12", - "3.13", - "3.14", - ): + # Install all test dependencies, then install this package in-place. + py_version = tuple([int(v) for v in session.python.split(".")]) + if implementation == "cpp" and py_version >= (3, 11): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( diff --git a/packages/proto-plus/testing/constraints-3.15.txt b/packages/proto-plus/testing/constraints-3.15.txt new file mode 100644 index 000000000000..e69de29bb2d1