From 880263a78662d553c5e62e7e528b1c442a42e6db Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 12:13:39 -0400 Subject: [PATCH 1/3] feat(storage): generate library v1.32.0 and remediate lower bounds --- .../storage-integration.yaml | 33 +++++++++++-------- librarian.yaml | 2 -- packages/google-cloud-storage/docs/conf.py | 4 +-- .../google/cloud/_storage_v2/__init__.py | 25 +++----------- packages/google-cloud-storage/noxfile.py | 4 +-- packages/google-cloud-storage/setup.py | 9 +++-- .../testing/constraints-3.10.txt | 32 ++++++++++-------- .../testing/constraints-3.9.txt | 18 ---------- .../unit/gapic/_storage_v2/test_storage.py | 26 ++++----------- 9 files changed, 56 insertions(+), 97 deletions(-) delete mode 100644 packages/google-cloud-storage/testing/constraints-3.9.txt diff --git a/.librarian/generator-input/client-post-processing/storage-integration.yaml b/.librarian/generator-input/client-post-processing/storage-integration.yaml index 7d3f06551e6d..758ab3925dcb 100644 --- a/.librarian/generator-input/client-post-processing/storage-integration.yaml +++ b/.librarian/generator-input/client-post-processing/storage-integration.yaml @@ -636,23 +636,30 @@ replacements: } count: 1 - paths: [ - packages/google-cloud-storage/testing/constraints-3.10.txt, + packages/google-cloud-storage/testing/constraints-3.10.txt ] before: | - google-api-core[\s\S]* - [\s\S]*?grpc-google-iam-v1[\s\S]* + google-api-core==2.17.1 + google-auth==2.14.1 + grpcio==1.44.0 + proto-plus==1.22.3 + protobuf==4.25.8 + grpc-google-iam-v1==0.14.0 after: | - google-auth + google-auth==2.26.1 # cryptography is a direct dependency of google-auth - cryptography - google-api-core - google-cloud-core - google-resumable-media - grpcio - requests - google-crc32c - protobuf - opentelemetry-api + cryptography==38.0.0 + google-api-core==2.27.0 + google-cloud-core==2.4.2 + google-resumable-media==2.7.2 + grpcio==1.44.0 + grpcio-status==1.76.0 + proto-plus==1.22.3 + protobuf==4.25.8 + grpc-google-iam-v1==0.14.0 + opentelemetry-api==1.1.0 + requests==2.22.0 + google-crc32c==1.6.0 count: 1 - paths: [ packages/google-cloud-storage/testing/constraints-3.11.txt, diff --git a/librarian.yaml b/librarian.yaml index 51c51b3ccc83..c26a669dc273 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1938,8 +1938,6 @@ libraries: version: 3.10.1 apis: - path: google/storage/v2 - skip_generate: true - skip_release: true python: library_type: GAPIC_MANUAL opt_args_by_api: diff --git a/packages/google-cloud-storage/docs/conf.py b/packages/google-cloud-storage/docs/conf.py index 02bbbcff03ba..1a23a1f49e2e 100644 --- a/packages/google-cloud-storage/docs/conf.py +++ b/packages/google-cloud-storage/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# 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. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-storage" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py b/packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py index dbf9e32377d7..cc6a108f30b2 100644 --- a/packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py +++ b/packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# 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. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.storage import StorageAsyncClient, StorageClient from .types.storage import ( @@ -98,28 +92,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud._storage_v2" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-storage/noxfile.py b/packages/google-cloud-storage/noxfile.py index 25c24ccb8b6f..bc05724cd0b6 100644 --- a/packages/google-cloud-storage/noxfile.py +++ b/packages/google-cloud-storage/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# 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. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -494,7 +493,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-storage/setup.py b/packages/google-cloud-storage/setup.py index f81ac0eb3303..802ca894b94d 100644 --- a/packages/google-cloud-storage/setup.py +++ b/packages/google-cloud-storage/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# 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. @@ -58,7 +58,7 @@ # experimental in this SDK. More info in b/465352227 "grpc": [ "google-api-core[grpc] >= 2.27.0, < 3.0.0", - "grpcio >= 1.33.2, < 2.0.0; python_version < '3.14'", + "grpcio >= 1.44.0, < 2.0.0; python_version < '3.14'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "grpcio-status >= 1.76.0, < 2.0.0", "proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'", @@ -116,7 +116,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -124,7 +124,6 @@ "License :: OSI Approved :: Apache Software License", "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", @@ -135,7 +134,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-storage/testing/constraints-3.10.txt b/packages/google-cloud-storage/testing/constraints-3.10.txt index 0f95acc479cb..59bf402faa55 100644 --- a/packages/google-cloud-storage/testing/constraints-3.10.txt +++ b/packages/google-cloud-storage/testing/constraints-3.10.txt @@ -1,14 +1,20 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-auth +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-auth==2.26.1 # cryptography is a direct dependency of google-auth -cryptography -google-api-core -google-cloud-core -google-resumable-media -grpcio -requests -google-crc32c -protobuf -opentelemetry-api +cryptography==38.0.0 +google-api-core==2.27.0 +google-cloud-core==2.4.2 +google-resumable-media==2.7.2 +grpcio==1.44.0 +grpcio-status==1.76.0 +proto-plus==1.22.3 +protobuf==4.25.8 +grpc-google-iam-v1==0.14.0 +opentelemetry-api==1.1.0 +requests==2.22.0 +google-crc32c==1.6.0 diff --git a/packages/google-cloud-storage/testing/constraints-3.9.txt b/packages/google-cloud-storage/testing/constraints-3.9.txt deleted file mode 100644 index 472b25e99d7f..000000000000 --- a/packages/google-cloud-storage/testing/constraints-3.9.txt +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-auth==2.26.1 -# cryptography is a direct dependency of google-auth -cryptography -google-api-core==2.27.0 -google-cloud-core==2.4.2 -google-resumable-media==2.7.2 -grpcio==1.33.2 -requests==2.22.0 -google-crc32c==1.6.0 -protobuf==4.25.8 -opentelemetry-api==1.1.0 diff --git a/packages/google-cloud-storage/tests/unit/gapic/_storage_v2/test_storage.py b/packages/google-cloud-storage/tests/unit/gapic/_storage_v2/test_storage.py index ce7d8cf3e90e..7da2d8d2fa53 100644 --- a/packages/google-cloud-storage/tests/unit/gapic/_storage_v2/test_storage.py +++ b/packages/google-cloud-storage/tests/unit/gapic/_storage_v2/test_storage.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# 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. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2565,11 +2559,7 @@ async def test_list_buckets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_buckets(request={}) - ).pages: + async for page_ in (await client.list_buckets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7085,11 +7075,7 @@ async def test_list_objects_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_objects(request={}) - ).pages: + async for page_ in (await client.list_objects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token From 70d013b655b1f41ca6ba99c8c160dda8ec44e7f3 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 12:24:03 -0400 Subject: [PATCH 2/3] fix(storage): restore skip_release: true in librarian.yaml --- librarian.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/librarian.yaml b/librarian.yaml index c26a669dc273..21e00c6c48df 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1938,6 +1938,7 @@ libraries: version: 3.10.1 apis: - path: google/storage/v2 + skip_release: true python: library_type: GAPIC_MANUAL opt_args_by_api: From 6dee45f66b898499a942f86240b653242e6bcf79 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Tue, 19 May 2026 12:56:44 -0400 Subject: [PATCH 3/3] fix(storage): sync grpcio-status lower bounds with grpcio --- .../client-post-processing/storage-integration.yaml | 5 +++-- packages/google-cloud-storage/setup.py | 3 ++- packages/google-cloud-storage/testing/constraints-3.10.txt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.librarian/generator-input/client-post-processing/storage-integration.yaml b/.librarian/generator-input/client-post-processing/storage-integration.yaml index 758ab3925dcb..8d9d4244b466 100644 --- a/.librarian/generator-input/client-post-processing/storage-integration.yaml +++ b/.librarian/generator-input/client-post-processing/storage-integration.yaml @@ -599,7 +599,8 @@ replacements: "google-api-core[grpc] >= 2.27.0, < 3.0.0", "grpcio >= 1.44.0, < 2.0.0; python_version < '3.14'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "grpcio-status >= 1.76.0, < 2.0.0", + "grpcio-status >= 1.44.0, < 2.0.0; python_version < '3.14'", + "grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", "protobuf >= 4.25.8, < 8.0.0", @@ -653,7 +654,7 @@ replacements: google-cloud-core==2.4.2 google-resumable-media==2.7.2 grpcio==1.44.0 - grpcio-status==1.76.0 + grpcio-status==1.44.0 proto-plus==1.22.3 protobuf==4.25.8 grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-storage/setup.py b/packages/google-cloud-storage/setup.py index 802ca894b94d..d5c310983ab8 100644 --- a/packages/google-cloud-storage/setup.py +++ b/packages/google-cloud-storage/setup.py @@ -60,7 +60,8 @@ "google-api-core[grpc] >= 2.27.0, < 3.0.0", "grpcio >= 1.44.0, < 2.0.0; python_version < '3.14'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "grpcio-status >= 1.76.0, < 2.0.0", + "grpcio-status >= 1.44.0, < 2.0.0; python_version < '3.14'", + "grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", "protobuf >= 4.25.8, < 8.0.0", diff --git a/packages/google-cloud-storage/testing/constraints-3.10.txt b/packages/google-cloud-storage/testing/constraints-3.10.txt index 59bf402faa55..97296ecabb9a 100644 --- a/packages/google-cloud-storage/testing/constraints-3.10.txt +++ b/packages/google-cloud-storage/testing/constraints-3.10.txt @@ -11,7 +11,7 @@ google-api-core==2.27.0 google-cloud-core==2.4.2 google-resumable-media==2.7.2 grpcio==1.44.0 -grpcio-status==1.76.0 +grpcio-status==1.44.0 proto-plus==1.22.3 protobuf==4.25.8 grpc-google-iam-v1==0.14.0