From c1c1ab1f31a8b69a1308b5423d66684f5415b9a7 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:06:02 -0400 Subject: [PATCH 01/21] feat(api-core): update pyproject.toml to require Python 3.10+ --- packages/google-api-core/pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-api-core/pyproject.toml b/packages/google-api-core/pyproject.toml index c81667215d45..698454cbeac3 100644 --- a/packages/google-api-core/pyproject.toml +++ b/packages/google-api-core/pyproject.toml @@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta" name = "google-api-core" authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }] license = { text = "Apache 2.0" } -requires-python = ">=3.9" +requires-python = ">=3.10" readme = "README.rst" description = "Google API client core library" classifiers = [ @@ -34,7 +34,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", From d7b5ddc523220924d5d1f051ba14622854fe2982 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:11:34 -0400 Subject: [PATCH 02/21] docs(api-core): update README for Python 3.10+ support --- packages/google-api-core/README.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-api-core/README.rst b/packages/google-api-core/README.rst index 680556768fee..6e477cd224c4 100644 --- a/packages/google-api-core/README.rst +++ b/packages/google-api-core/README.rst @@ -16,13 +16,13 @@ common helpers used by all Google API clients. For more information, see the Supported Python Versions ------------------------- -Python >= 3.9 +Python >= 3.10 Unsupported Python Versions --------------------------- -Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, Python == 3.8. +Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, Python == 3.8, Python == 3.9. The last version of this library compatible with Python 2.7 and 3.5 is `google-api-core==1.31.1`. @@ -32,3 +32,6 @@ The last version of this library compatible with Python 3.6 is The last version of this library compatible with Python 3.7 and 3.8 is `google-api-core==2.29.0`. + +The last version of this library compatible with Python 3.9 is +`google-api-core==2.30.3`. From 0c736a6a8c36090664701b28458fbb484087e1e6 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:11:48 -0400 Subject: [PATCH 03/21] test(api-core): remove Python < 3.10 polyfills and skips --- .../google-api-core/tests/asyncio/test_bidi_async.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/google-api-core/tests/asyncio/test_bidi_async.py b/packages/google-api-core/tests/asyncio/test_bidi_async.py index add685a96c2c..10e2ce44444b 100644 --- a/packages/google-api-core/tests/asyncio/test_bidi_async.py +++ b/packages/google-api-core/tests/asyncio/test_bidi_async.py @@ -33,14 +33,6 @@ from google.api_core import bidi_async from google.api_core import exceptions -# TODO: remove this when droppping support for "Python 3.10" and below. -if sys.version_info < (3, 10): # type: ignore[operator] - - def aiter(obj): - return obj.__aiter__() - - async def anext(obj): - return await obj.__anext__() @pytest.mark.asyncio @@ -185,10 +177,6 @@ def test_done_callbacks(self): callback.assert_called_once_with(mock.sentinel.future) @pytest.mark.asyncio - @pytest.mark.skipif( - sys.version_info < (3, 8), # type: ignore[operator] - reason="Versions of Python below 3.8 don't provide support for assert_awaited_once", - ) async def test_metadata(self): rpc, call = make_async_rpc() bidi_rpc = bidi_async.AsyncBidiRpc(rpc, metadata=mock.sentinel.A) From 821322bd0b8b7e55cc7f50ca34eaa7611877d099 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:11:55 -0400 Subject: [PATCH 04/21] docs(api-core): update docstring in grpc_helpers_async.py for Python 3.10+ --- packages/google-api-core/google/api_core/grpc_helpers_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-api-core/google/api_core/grpc_helpers_async.py b/packages/google-api-core/google/api_core/grpc_helpers_async.py index 9e1ad1105d45..b615d8a13252 100644 --- a/packages/google-api-core/google/api_core/grpc_helpers_async.py +++ b/packages/google-api-core/google/api_core/grpc_helpers_async.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""AsyncIO helpers for :mod:`grpc` supporting 3.7+. +"""AsyncIO helpers for :mod:`grpc` supporting 3.10+. Please combine more detailed docstring in grpc_helpers.py to use following functions. This module is implementing the same surface with AsyncIO semantics. From 87e885e0003f48d4b2d44b368815911a60abaa16 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:12:04 -0400 Subject: [PATCH 05/21] chore(api-core): remove Python 3.9 from Nox sessions --- packages/google-api-core/noxfile.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-api-core/noxfile.py b/packages/google-api-core/noxfile.py index 3ae96e416736..9de6a9fc28d2 100644 --- a/packages/google-api-core/noxfile.py +++ b/packages/google-api-core/noxfile.py @@ -14,7 +14,7 @@ # Helpful notes for local usage: # unset PYENV_VERSION -# pyenv local 3.14.1 3.13.10 3.12.11 3.11.4 3.10.12 3.9.17 +# pyenv local 3.14.1 3.13.10 3.12.11 3.11.4 3.10.12 # PIP_INDEX_URL=https://pypi.org/simple nox from __future__ import absolute_import @@ -34,8 +34,8 @@ # 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.9", "3.10", "3.11", "3.12", "3.13", "3.14"] -SUPPORTED_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] +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"] DEFAULT_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -303,7 +303,7 @@ def default( ( True, False, - ["3.9", "3.10", "3.11"], + ["3.10", "3.11"], 4, ), # Run proto4 tests with grpcio/grpcio-gcp installed ], @@ -325,8 +325,7 @@ def unit( session.log(f"Skipping session for Python {session.python}") session.skip() - # TODO: consider converting the following into a `match` statement once - # we drop Python 3.9 support. + # consider converting the following into a `match` statement. if legacy_proto: if legacy_proto == 4: # Pin protobuf to a 4.x version to ensure coverage for the legacy code path. From 283a60e5a6f8e667b1369c3a0ec843ad39468732 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:12:21 -0400 Subject: [PATCH 06/21] docs(api-core): update CONTRIBUTING.rst examples to use Python 3.10 --- packages/google-api-core/CONTRIBUTING.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/google-api-core/CONTRIBUTING.rst b/packages/google-api-core/CONTRIBUTING.rst index bb3f5f55b166..d6250b839447 100644 --- a/packages/google-api-core/CONTRIBUTING.rst +++ b/packages/google-api-core/CONTRIBUTING.rst @@ -21,7 +21,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. + 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -171,11 +171,11 @@ configure them just like the System Tests. # Run all tests in a folder $ cd samples/snippets - $ nox -s py-3.8 + $ nox -s py-3.10 # Run a single sample test $ cd samples/snippets - $ nox -s py-3.8 -- -k + $ nox -s py-3.10 -- -k ******************************************** Note About ``README`` as it pertains to PyPI @@ -197,14 +197,12 @@ Supported Python Versions We support: -- `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ - `Python 3.12`_ - `Python 3.13`_ - `Python 3.14`_ -.. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ .. _Python 3.12: https://docs.python.org/3.12/ From c62b6458004854281d7b02f57b0446d18ba472cf Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:23:45 -0400 Subject: [PATCH 07/21] chore(api-core): use match statement in noxfile.py --- packages/google-api-core/noxfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/google-api-core/noxfile.py b/packages/google-api-core/noxfile.py index 9de6a9fc28d2..1cb54f80dbb2 100644 --- a/packages/google-api-core/noxfile.py +++ b/packages/google-api-core/noxfile.py @@ -325,12 +325,13 @@ def unit( session.log(f"Skipping session for Python {session.python}") session.skip() - # consider converting the following into a `match` statement. - if legacy_proto: - if legacy_proto == 4: + match legacy_proto: + case 4: # Pin protobuf to a 4.x version to ensure coverage for the legacy code path. session.install("protobuf>=4.25.8,<5.0.0") - else: + case None: + pass + case _: assert False, f"Unknown legacy_proto: {legacy_proto}" default( From 12c90ca029bd3110a3776f9f5ea1aa2482398df1 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:27:25 -0400 Subject: [PATCH 08/21] refactor(api-core): remove Python < 3.10 polyfill in _python_version_support.py --- .../api_core/_python_version_support.py | 55 ++++++++----------- .../testing/constraints-3.9.txt | 14 ----- .../testing/constraints-async-rest-3.9.txt | 20 ------- 3 files changed, 23 insertions(+), 66 deletions(-) delete mode 100644 packages/google-api-core/testing/constraints-3.9.txt delete mode 100644 packages/google-api-core/testing/constraints-async-rest-3.9.txt diff --git a/packages/google-api-core/google/api_core/_python_version_support.py b/packages/google-api-core/google/api_core/_python_version_support.py index 66782bfc9ea8..7d82882063df 100644 --- a/packages/google-api-core/google/api_core/_python_version_support.py +++ b/packages/google-api-core/google/api_core/_python_version_support.py @@ -140,38 +140,29 @@ def _flatten_message(text: str) -> str: return " ".join(textwrap.dedent(text).strip().split()) -# TODO(https://github.com/googleapis/python-api-core/issues/835): -# Remove once we no longer support Python 3.9. -# `importlib.metadata.packages_distributions()` is only supported in Python 3.10 and newer -# https://docs.python.org/3/library/importlib.metadata.html#importlib.metadata.packages_distributions -if sys.version_info < (3, 10): - - def _get_pypi_package_name(module_name): # pragma: NO COVER - """Determine the PyPI package name for a given module name.""" - return None - -else: - from importlib import metadata - - @functools.cache - def _cached_packages_distributions(): - return metadata.packages_distributions() - - def _get_pypi_package_name(module_name): - """Determine the PyPI package name for a given module name.""" - try: - module_to_distributions = _cached_packages_distributions() - - if module_name in module_to_distributions: # pragma: NO COVER - return module_to_distributions[module_name][0] - except Exception as e: # pragma: NO COVER - _LOGGER.info( - "An error occurred while determining PyPI package name for %s: %s", - module_name, - e, - ) - - return None +from importlib import metadata + + +@functools.cache +def _cached_packages_distributions(): + return metadata.packages_distributions() + + +def _get_pypi_package_name(module_name): + """Determine the PyPI package name for a given module name.""" + try: + module_to_distributions = _cached_packages_distributions() + + if module_name in module_to_distributions: # pragma: NO COVER + return module_to_distributions[module_name][0] + except Exception as e: # pragma: NO COVER + _LOGGER.info( + "An error occurred while determining PyPI package name for %s: %s", + module_name, + e, + ) + + return None def _get_distribution_and_import_packages(import_package: str) -> Tuple[str, Any]: diff --git a/packages/google-api-core/testing/constraints-3.9.txt b/packages/google-api-core/testing/constraints-3.9.txt deleted file mode 100644 index 98614e25b016..000000000000 --- a/packages/google-api-core/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in pyproject.toml -# List *all* library dependencies and extras in this file. -# Pin the version to the lower bound. -# -# e.g., if pyproject.toml has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -googleapis-common-protos==1.63.2 -protobuf==4.25.8 -google-auth==2.14.1 -requests==2.20.0 -grpcio==1.33.2 -grpcio-status==1.33.2 -proto-plus==1.22.3 diff --git a/packages/google-api-core/testing/constraints-async-rest-3.9.txt b/packages/google-api-core/testing/constraints-async-rest-3.9.txt deleted file mode 100644 index b2aa135cd04a..000000000000 --- a/packages/google-api-core/testing/constraints-async-rest-3.9.txt +++ /dev/null @@ -1,20 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in pyproject.toml -# List *all* library dependencies and extras in this file. -# Pin the version to the lower bound. -# -# e.g., if pyproject.toml has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -googleapis-common-protos==1.63.2 -protobuf==4.25.8 -google-auth==2.35.0 -requests==2.20.0 -grpcio==1.33.2 -grpcio-status==1.33.2 -proto-plus==1.22.3 -# Some tests import aiohttp to test async rest -# from google-auth[aiohttp] -# google-auth[aiohttp] v2.39.0 is the first release that requires aiohttp 3.6.2 -# see - change: https://github.com/googleapis/google-auth-library-python/blame/9d5c0d81e8e69719a2b4cd034bf1ed5d128fdf0a/setup.py#L35 -# - release: https://github.com/googleapis/google-auth-library-python/commits/main/?after=9d5c0d81e8e69719a2b4cd034bf1ed5d128fdf0a+104 -aiohttp==3.6.2 From ea68a46edbdebb36e2eba4d7c7c9194ecd09f330 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:27:37 -0400 Subject: [PATCH 09/21] docs(api-core): update example Python version in client_info.py --- packages/google-api-core/google/api_core/client_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-api-core/google/api_core/client_info.py b/packages/google-api-core/google/api_core/client_info.py index f0678d24ba1e..024da1e8eb2e 100644 --- a/packages/google-api-core/google/api_core/client_info.py +++ b/packages/google-api-core/google/api_core/client_info.py @@ -45,7 +45,7 @@ class ClientInfo(object): Args: python_version (str): The Python interpreter version, for example, - ``'3.9.6'``. + ``'3.10.0'``. grpc_version (Optional[str]): The gRPC library version. api_core_version (str): The google-api-core library version. gapic_version (Optional[str]): The version of gapic-generated client From a7b16638924c91bdb195586803d7c4a1d0a06d8c Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:27:44 -0400 Subject: [PATCH 10/21] refactor(api-core): remove Python 3.9 from tracked versions list --- .../google/api_core/_python_version_support.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/google-api-core/google/api_core/_python_version_support.py b/packages/google-api-core/google/api_core/_python_version_support.py index 7d82882063df..ee2288a6f35a 100644 --- a/packages/google-api-core/google/api_core/_python_version_support.py +++ b/packages/google-api-core/google/api_core/_python_version_support.py @@ -71,13 +71,6 @@ class VersionInfo(NamedTuple): PYTHON_VERSIONS: List[VersionInfo] = [ # Refer to https://devguide.python.org/versions/ and the PEPs linked therefrom. - VersionInfo( - version="3.9", - python_beta=datetime.date(2020, 5, 18), - python_start=datetime.date(2020, 10, 5), - python_eol=datetime.date(2025, 10, 5), - gapic_end=datetime.date(2025, 10, 5) + datetime.timedelta(days=90), - ), VersionInfo( version="3.10", python_beta=datetime.date(2021, 5, 3), From 0652eb3ed2c0196e2d430fa2cb759cc7c0d8d377 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:27:53 -0400 Subject: [PATCH 11/21] docs(api-core): update example Python version in gapic_v1/client_info.py --- .../google-api-core/google/api_core/gapic_v1/client_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-api-core/google/api_core/gapic_v1/client_info.py b/packages/google-api-core/google/api_core/gapic_v1/client_info.py index 4b3b56493f8a..2cf07840b39b 100644 --- a/packages/google-api-core/google/api_core/gapic_v1/client_info.py +++ b/packages/google-api-core/google/api_core/gapic_v1/client_info.py @@ -33,7 +33,7 @@ class ClientInfo(client_info.ClientInfo): Args: python_version (str): The Python interpreter version, for example, - ``'3.9.6'``. + ``'3.10.0'``. grpc_version (Optional[str]): The gRPC library version. api_core_version (str): The google-api-core library version. gapic_version (Optional[str]): The version of gapic-generated client From 2d87e660cf97ffe0971524834c5c2087141c9140 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 07:34:45 -0400 Subject: [PATCH 12/21] test(api-core): update tests to use Python 3.10 instead of 3.9 --- .../google-api-core/tests/unit/test_python_version_support.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-api-core/tests/unit/test_python_version_support.py b/packages/google-api-core/tests/unit/test_python_version_support.py index 76eb821e0205..07620934c93f 100644 --- a/packages/google-api-core/tests/unit/test_python_version_support.py +++ b/packages/google-api-core/tests/unit/test_python_version_support.py @@ -164,7 +164,7 @@ def test_all_tracked_versions_and_date_scenarios( def test_override_gapic_end_only(): """Test behavior when only gapic_end is manually overridden.""" - version_tuple = (3, 9) + version_tuple = (3, 10) original_info = PYTHON_VERSION_INFO[version_tuple] mock_py_version = VersionInfoMock(major=version_tuple[0], minor=version_tuple[1]) @@ -199,7 +199,7 @@ def test_override_gapic_end_only(): def test_override_gapic_deprecation_only(): """Test behavior when only gapic_deprecation is manually overridden.""" - version_tuple = (3, 9) + version_tuple = (3, 10) original_info = PYTHON_VERSION_INFO[version_tuple] mock_py_version = VersionInfoMock(major=version_tuple[0], minor=version_tuple[1]) From 2ccd85efda854be104d7ae63a6526551ab93a7be Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 08:21:35 -0400 Subject: [PATCH 13/21] chore(api-core): apply black formatting --- .../google/api_core/_python_version_support.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/google-api-core/google/api_core/_python_version_support.py b/packages/google-api-core/google/api_core/_python_version_support.py index ee2288a6f35a..1430fe222641 100644 --- a/packages/google-api-core/google/api_core/_python_version_support.py +++ b/packages/google-api-core/google/api_core/_python_version_support.py @@ -17,6 +17,7 @@ import datetime import enum import functools +from importlib import metadata import logging import warnings import sys @@ -133,9 +134,6 @@ def _flatten_message(text: str) -> str: return " ".join(textwrap.dedent(text).strip().split()) -from importlib import metadata - - @functools.cache def _cached_packages_distributions(): return metadata.packages_distributions() From 10181b27dfccb06d2d5bbb06f78e60014f9edf76 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 7 May 2026 08:32:05 -0400 Subject: [PATCH 14/21] chore(api-core): apply manual updates and add 3.10 constraints files --- packages/google-api-core/README.rst | 3 +-- packages/google-api-core/pyproject.toml | 4 ++-- .../google-api-core/testing/constraints-3.10.txt | 14 ++++++++++++++ .../testing/constraints-async-rest-3.10.txt | 14 ++++++++++++++ .../tests/asyncio/test_bidi_async.py | 8 ++++++++ 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 packages/google-api-core/testing/constraints-async-rest-3.10.txt diff --git a/packages/google-api-core/README.rst b/packages/google-api-core/README.rst index 6e477cd224c4..f5346b279e79 100644 --- a/packages/google-api-core/README.rst +++ b/packages/google-api-core/README.rst @@ -21,8 +21,7 @@ Python >= 3.10 Unsupported Python Versions --------------------------- - -Python == 2.7, Python == 3.5, Python == 3.6, Python == 3.7, Python == 3.8, Python == 3.9. +Python <= 3.9 The last version of this library compatible with Python 2.7 and 3.5 is `google-api-core==1.31.1`. diff --git a/packages/google-api-core/pyproject.toml b/packages/google-api-core/pyproject.toml index 698454cbeac3..3d2934b60db5 100644 --- a/packages/google-api-core/pyproject.toml +++ b/packages/google-api-core/pyproject.toml @@ -48,7 +48,7 @@ dependencies = [ "proto-plus >= 1.22.3, < 2.0.0", "proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'", "google-auth >= 2.14.1, < 3.0.0", - "requests >= 2.20.0, < 3.0.0", + "requests >= 2.33.0", ] dynamic = ["version"] @@ -60,7 +60,7 @@ Repository = "https://github.com/googleapis/google-cloud-python" [project.optional-dependencies] async_rest = ["google-auth[aiohttp] >= 2.35.0, < 3.0.0"] grpc = [ - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.80.0", "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "grpcio-status >= 1.33.2, < 2.0.0", diff --git a/packages/google-api-core/testing/constraints-3.10.txt b/packages/google-api-core/testing/constraints-3.10.txt index e69de29bb2d1..97712805206a 100644 --- a/packages/google-api-core/testing/constraints-3.10.txt +++ b/packages/google-api-core/testing/constraints-3.10.txt @@ -0,0 +1,14 @@ +# This constraints file is used to check that lower bounds +# are correct in pyproject.toml +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if pyproject.toml has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +googleapis-common-protos==1.63.2 +protobuf==4.25.8 +google-auth==2.35.0 +requests==2.33.0 +grpcio==1.80.0 +grpcio-status==1.33.2 +proto-plus==1.22.3 diff --git a/packages/google-api-core/testing/constraints-async-rest-3.10.txt b/packages/google-api-core/testing/constraints-async-rest-3.10.txt new file mode 100644 index 000000000000..97712805206a --- /dev/null +++ b/packages/google-api-core/testing/constraints-async-rest-3.10.txt @@ -0,0 +1,14 @@ +# This constraints file is used to check that lower bounds +# are correct in pyproject.toml +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if pyproject.toml has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +googleapis-common-protos==1.63.2 +protobuf==4.25.8 +google-auth==2.35.0 +requests==2.33.0 +grpcio==1.80.0 +grpcio-status==1.33.2 +proto-plus==1.22.3 diff --git a/packages/google-api-core/tests/asyncio/test_bidi_async.py b/packages/google-api-core/tests/asyncio/test_bidi_async.py index 10e2ce44444b..3999628138b8 100644 --- a/packages/google-api-core/tests/asyncio/test_bidi_async.py +++ b/packages/google-api-core/tests/asyncio/test_bidi_async.py @@ -33,6 +33,14 @@ from google.api_core import bidi_async from google.api_core import exceptions +# TODO: remove this when droppping support for "Python 3.10" and below. +if sys.version_info <= (3, 10): # type: ignore[operator] + + def aiter(obj): + return obj.__aiter__() + + async def anext(obj): + return await obj.__anext__() @pytest.mark.asyncio From fcb7965b863824fdee5af81dd8681db963812334 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 7 May 2026 11:08:55 -0400 Subject: [PATCH 15/21] Apply suggestion from @chalmerlowe --- packages/google-api-core/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-api-core/noxfile.py b/packages/google-api-core/noxfile.py index 1cb54f80dbb2..27b9b9125a0c 100644 --- a/packages/google-api-core/noxfile.py +++ b/packages/google-api-core/noxfile.py @@ -329,7 +329,7 @@ def unit( case 4: # Pin protobuf to a 4.x version to ensure coverage for the legacy code path. session.install("protobuf>=4.25.8,<5.0.0") - case None: + case None | False: pass case _: assert False, f"Unknown legacy_proto: {legacy_proto}" From 10db3bd04074685968fa157a61189d6d7399bd34 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Fri, 8 May 2026 12:22:29 -0400 Subject: [PATCH 16/21] chore: update google-auth and aiohttp dependencies --- packages/google-api-core/pyproject.toml | 4 ++-- .../google-api-core/testing/constraints-async-rest-3.10.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-api-core/pyproject.toml b/packages/google-api-core/pyproject.toml index 3d2934b60db5..08b09d1d97b3 100644 --- a/packages/google-api-core/pyproject.toml +++ b/packages/google-api-core/pyproject.toml @@ -47,7 +47,7 @@ dependencies = [ "protobuf >= 4.25.8, < 8.0.0", "proto-plus >= 1.22.3, < 2.0.0", "proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'", - "google-auth >= 2.14.1, < 3.0.0", + "google-auth >= 2.35.0, < 3.0.0", "requests >= 2.33.0", ] dynamic = ["version"] @@ -58,7 +58,7 @@ Documentation = "https://googleapis.dev/python/google-api-core/latest/" Repository = "https://github.com/googleapis/google-cloud-python" [project.optional-dependencies] -async_rest = ["google-auth[aiohttp] >= 2.35.0, < 3.0.0"] +async_rest = ["google-auth[aiohttp] >= 2.35.0, < 3.0.0", "aiohttp >= 3.9.0"] grpc = [ "grpcio >= 1.80.0", "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'", diff --git a/packages/google-api-core/testing/constraints-async-rest-3.10.txt b/packages/google-api-core/testing/constraints-async-rest-3.10.txt index 97712805206a..7afba4e21ede 100644 --- a/packages/google-api-core/testing/constraints-async-rest-3.10.txt +++ b/packages/google-api-core/testing/constraints-async-rest-3.10.txt @@ -12,3 +12,8 @@ requests==2.33.0 grpcio==1.80.0 grpcio-status==1.33.2 proto-plus==1.22.3 +# Note: We pin aiohttp to 3.9.0 to avoid deprecation warnings about '@coroutine' +# decorators which were deprecated since Python 3.8. When older versions of aiohttp +# load, because they used @coroutine deep inside their internals, the warnings +# bubble up and cause our nox session to fail. +aiohttp==3.9.0 From 09950c6cb86ae15b6bba64ace51a87b29d4d04d1 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Fri, 8 May 2026 12:22:32 -0400 Subject: [PATCH 17/21] chore: remove unnecessary polyfills for aiter/anext in tests --- .../google-api-core/tests/asyncio/test_bidi_async.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/google-api-core/tests/asyncio/test_bidi_async.py b/packages/google-api-core/tests/asyncio/test_bidi_async.py index 3999628138b8..a39982bf92aa 100644 --- a/packages/google-api-core/tests/asyncio/test_bidi_async.py +++ b/packages/google-api-core/tests/asyncio/test_bidi_async.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys + import asyncio from unittest import mock @@ -33,15 +33,6 @@ from google.api_core import bidi_async from google.api_core import exceptions -# TODO: remove this when droppping support for "Python 3.10" and below. -if sys.version_info <= (3, 10): # type: ignore[operator] - - def aiter(obj): - return obj.__aiter__() - - async def anext(obj): - return await obj.__anext__() - @pytest.mark.asyncio class Test_AsyncRequestQueueGenerator: From 29e709ac8f7a35842924a86641173e8ce84f3899 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Mon, 11 May 2026 09:40:48 -0400 Subject: [PATCH 18/21] chore(api-core): update constraints to lowest working versions for Python 3.10 --- packages/google-api-core/pyproject.toml | 10 +++++----- packages/google-api-core/testing/constraints-3.10.txt | 8 ++++---- .../testing/constraints-async-rest-3.10.txt | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/google-api-core/pyproject.toml b/packages/google-api-core/pyproject.toml index 08b09d1d97b3..ba4c42eccb1d 100644 --- a/packages/google-api-core/pyproject.toml +++ b/packages/google-api-core/pyproject.toml @@ -47,8 +47,8 @@ dependencies = [ "protobuf >= 4.25.8, < 8.0.0", "proto-plus >= 1.22.3, < 2.0.0", "proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'", - "google-auth >= 2.35.0, < 3.0.0", - "requests >= 2.33.0", + "google-auth >= 2.14.1, < 3.0.0", + "requests >= 2.24.0", ] dynamic = ["version"] @@ -58,12 +58,12 @@ Documentation = "https://googleapis.dev/python/google-api-core/latest/" Repository = "https://github.com/googleapis/google-cloud-python" [project.optional-dependencies] -async_rest = ["google-auth[aiohttp] >= 2.35.0, < 3.0.0", "aiohttp >= 3.9.0"] +async_rest = ["google-auth[aiohttp] >= 2.14.1, < 3.0.0", "aiohttp >= 3.9.0"] grpc = [ - "grpcio >= 1.80.0", + "grpcio >= 1.41.0", "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "grpcio-status >= 1.33.2, < 2.0.0", + "grpcio-status >= 1.41.0, < 2.0.0", "grpcio-status >= 1.49.1, < 2.0.0; python_version >= '3.11'", "grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'", ] diff --git a/packages/google-api-core/testing/constraints-3.10.txt b/packages/google-api-core/testing/constraints-3.10.txt index 97712805206a..444eb4f13dcf 100644 --- a/packages/google-api-core/testing/constraints-3.10.txt +++ b/packages/google-api-core/testing/constraints-3.10.txt @@ -7,8 +7,8 @@ # Then this file should have foo==1.14.0 googleapis-common-protos==1.63.2 protobuf==4.25.8 -google-auth==2.35.0 -requests==2.33.0 -grpcio==1.80.0 -grpcio-status==1.33.2 +google-auth==2.14.1 +requests==2.25.0 +grpcio==1.41.0 +grpcio-status==1.41.0 proto-plus==1.22.3 diff --git a/packages/google-api-core/testing/constraints-async-rest-3.10.txt b/packages/google-api-core/testing/constraints-async-rest-3.10.txt index 7afba4e21ede..b5bf92d008f2 100644 --- a/packages/google-api-core/testing/constraints-async-rest-3.10.txt +++ b/packages/google-api-core/testing/constraints-async-rest-3.10.txt @@ -7,10 +7,10 @@ # Then this file should have foo==1.14.0 googleapis-common-protos==1.63.2 protobuf==4.25.8 -google-auth==2.35.0 -requests==2.33.0 -grpcio==1.80.0 -grpcio-status==1.33.2 +google-auth==2.14.1 +requests==2.25.0 +grpcio==1.41.0 +grpcio-status==1.41.0 proto-plus==1.22.3 # Note: We pin aiohttp to 3.9.0 to avoid deprecation warnings about '@coroutine' # decorators which were deprecated since Python 3.8. When older versions of aiohttp From 690fee49c82b5802c487377df635be1516f76ba6 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Mon, 11 May 2026 09:58:08 -0400 Subject: [PATCH 19/21] docs(api-core): simplify docstring in grpc_helpers_async.py --- packages/google-api-core/google/api_core/grpc_helpers_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-api-core/google/api_core/grpc_helpers_async.py b/packages/google-api-core/google/api_core/grpc_helpers_async.py index b615d8a13252..826892a571f9 100644 --- a/packages/google-api-core/google/api_core/grpc_helpers_async.py +++ b/packages/google-api-core/google/api_core/grpc_helpers_async.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""AsyncIO helpers for :mod:`grpc` supporting 3.10+. +"""AsyncIO helpers for :mod:`grpc`.""" Please combine more detailed docstring in grpc_helpers.py to use following functions. This module is implementing the same surface with AsyncIO semantics. From 76e9f5760589b0e666eb992ca570804e8efb17a2 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Mon, 11 May 2026 09:59:18 -0400 Subject: [PATCH 20/21] Removes duplicative triple quote. --- packages/google-api-core/google/api_core/grpc_helpers_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-api-core/google/api_core/grpc_helpers_async.py b/packages/google-api-core/google/api_core/grpc_helpers_async.py index 826892a571f9..780788e4b565 100644 --- a/packages/google-api-core/google/api_core/grpc_helpers_async.py +++ b/packages/google-api-core/google/api_core/grpc_helpers_async.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""AsyncIO helpers for :mod:`grpc`.""" +"""AsyncIO helpers for :mod:`grpc`. Please combine more detailed docstring in grpc_helpers.py to use following functions. This module is implementing the same surface with AsyncIO semantics. From 7b8abf4b171bb6e27fecebab21f48bdf9175158c Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Mon, 11 May 2026 10:13:50 -0400 Subject: [PATCH 21/21] Updates to ensure minimum versions here match minimums in constraints files. Co-authored-by: Chalmer Lowe --- packages/google-api-core/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-api-core/pyproject.toml b/packages/google-api-core/pyproject.toml index ba4c42eccb1d..fa40c6ea7695 100644 --- a/packages/google-api-core/pyproject.toml +++ b/packages/google-api-core/pyproject.toml @@ -48,7 +48,7 @@ dependencies = [ "proto-plus >= 1.22.3, < 2.0.0", "proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'", "google-auth >= 2.14.1, < 3.0.0", - "requests >= 2.24.0", + "requests >= 2.25.0, < 3.0.0", ] dynamic = ["version"] @@ -60,7 +60,7 @@ Repository = "https://github.com/googleapis/google-cloud-python" [project.optional-dependencies] async_rest = ["google-auth[aiohttp] >= 2.14.1, < 3.0.0", "aiohttp >= 3.9.0"] grpc = [ - "grpcio >= 1.41.0", + "grpcio >= 1.41.0, < 2.0.0", "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "grpcio-status >= 1.41.0, < 2.0.0",