Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c804a93

Browse filesBrowse files
authored
feat(storage): drop Python 3.7-3.9 support and regenerate (#17178)
Updates post processing to account for dropping support for Python 3.7, 3.8, 3.9 and the impacts that has on using 3.10 for lower bounds testing. ### Changes * updates the lower bound versions for several libraries to avoid conflicts and install issues in both `setup.py` and `constraints-3.10.txt` * updates post-processing scripts to ensure the above updates persist
1 parent 2086b34 commit c804a93
Copy full SHA for c804a93

9 files changed

+60-98Lines changed: 60 additions & 98 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.librarian/generator-input/client-post-processing/storage-integration.yaml‎

Copy file name to clipboardExpand all lines: .librarian/generator-input/client-post-processing/storage-integration.yaml
+22-14Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,8 @@ replacements:
599599
"google-api-core[grpc] >= 2.27.0, < 3.0.0",
600600
"grpcio >= 1.44.0, < 2.0.0; python_version < '3.14'",
601601
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
602-
"grpcio-status >= 1.76.0, < 2.0.0",
602+
"grpcio-status >= 1.44.0, < 2.0.0; python_version < '3.14'",
603+
"grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'",
603604
"proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'",
604605
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
605606
"protobuf >= 4.25.8, < 8.0.0",
@@ -636,23 +637,30 @@ replacements:
636637
}
637638
count: 1
638639
- paths: [
639-
packages/google-cloud-storage/testing/constraints-3.10.txt,
640+
packages/google-cloud-storage/testing/constraints-3.10.txt
640641
]
641642
before: |
642-
google-api-core[\s\S]*
643-
[\s\S]*?grpc-google-iam-v1[\s\S]*
643+
google-api-core==2.17.1
644+
google-auth==2.14.1
645+
grpcio==1.44.0
646+
proto-plus==1.22.3
647+
protobuf==4.25.8
648+
grpc-google-iam-v1==0.14.0
644649
after: |
645-
google-auth
650+
google-auth==2.26.1
646651
# cryptography is a direct dependency of google-auth
647-
cryptography
648-
google-api-core
649-
google-cloud-core
650-
google-resumable-media
651-
grpcio
652-
requests
653-
google-crc32c
654-
protobuf
655-
opentelemetry-api
652+
cryptography==38.0.0
653+
google-api-core==2.27.0
654+
google-cloud-core==2.4.2
655+
google-resumable-media==2.7.2
656+
grpcio==1.44.0
657+
grpcio-status==1.44.0
658+
proto-plus==1.22.3
659+
protobuf==4.25.8
660+
grpc-google-iam-v1==0.14.0
661+
opentelemetry-api==1.1.0
662+
requests==2.22.0
663+
google-crc32c==1.6.0
656664
count: 1
657665
- paths: [
658666
packages/google-cloud-storage/testing/constraints-3.11.txt,
Collapse file

‎librarian.yaml‎

Copy file name to clipboardExpand all lines: librarian.yaml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,6 @@ libraries:
19341934
version: 3.10.1
19351935
apis:
19361936
- path: google/storage/v2
1937-
skip_generate: true
19381937
skip_release: true
19391938
python:
19401939
library_type: GAPIC_MANUAL
Collapse file

‎packages/google-cloud-storage/docs/conf.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-storage/docs/conf.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@
8383

8484
# General information about the project.
8585
project = "google-cloud-storage"
86-
copyright = "2025, Google, LLC"
86+
copyright = "2026, Google, LLC"
8787
author = "Google APIs"
8888

8989
# The version info for the project you're documenting, acts as replacement for
Collapse file

‎packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py
+4-21Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -21,13 +21,7 @@
2121

2222
__version__ = package_version.__version__
2323

24-
if sys.version_info >= (3, 8): # pragma: NO COVER
25-
from importlib import metadata
26-
else: # pragma: NO COVER
27-
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
28-
# this code path once we drop support for Python 3.7
29-
import importlib_metadata as metadata
30-
24+
from importlib import metadata
3125

3226
from .services.storage import StorageAsyncClient, StorageClient
3327
from .types.storage import (
@@ -98,28 +92,17 @@
9892
# An older version of api_core is installed which does not define the
9993
# functions above. We do equivalent checks manually.
10094
try:
101-
import sys
10295
import warnings
10396

10497
_py_version_str = sys.version.split()[0]
10598
_package_label = "google.cloud._storage_v2"
106-
if sys.version_info < (3, 9):
99+
if sys.version_info < (3, 10):
107100
warnings.warn(
108101
"You are using a non-supported Python version "
109102
+ f"({_py_version_str}). Google will not post any further "
110103
+ f"updates to {_package_label} supporting this Python version. "
111104
+ "Please upgrade to the latest Python version, or at "
112-
+ f"least to Python 3.9, and then update {_package_label}.",
113-
FutureWarning,
114-
)
115-
if sys.version_info[:2] == (3, 9):
116-
warnings.warn(
117-
f"You are using a Python version ({_py_version_str}) "
118-
+ f"which Google will stop supporting in {_package_label} in "
119-
+ "January 2026. Please "
120-
+ "upgrade to the latest Python version, or at "
121-
+ "least to Python 3.10, before then, and "
122-
+ f"then update {_package_label}.",
105+
+ f"least to Python 3.10, and then update {_package_label}.",
123106
FutureWarning,
124107
)
125108

Collapse file

‎packages/google-cloud-storage/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-storage/noxfile.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@
3131
LINT_PATHS.append("samples")
3232

3333
ALL_PYTHON = [
34-
"3.9",
3534
"3.10",
3635
"3.11",
3736
"3.12",
@@ -494,7 +493,6 @@ def docs(session):
494493
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
495494
session.run(
496495
"sphinx-build",
497-
"-W", # warnings as errors
498496
"-T", # show full traceback on exception
499497
"-N", # no colors
500498
"-b",
Collapse file

‎packages/google-cloud-storage/setup.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-storage/setup.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -58,9 +58,10 @@
5858
# experimental in this SDK. More info in b/465352227
5959
"grpc": [
6060
"google-api-core[grpc] >= 2.27.0, < 3.0.0",
61-
"grpcio >= 1.33.2, < 2.0.0; python_version < '3.14'",
61+
"grpcio >= 1.44.0, < 2.0.0; python_version < '3.14'",
6262
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
63-
"grpcio-status >= 1.76.0, < 2.0.0",
63+
"grpcio-status >= 1.44.0, < 2.0.0; python_version < '3.14'",
64+
"grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'",
6465
"proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'",
6566
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
6667
"protobuf >= 4.25.8, < 8.0.0",
@@ -116,15 +117,14 @@
116117
long_description=readme,
117118
author="Google LLC",
118119
author_email="googleapis-packages@google.com",
119-
license="Apache 2.0",
120+
license="Apache-2.0",
120121
url=url,
121122
classifiers=[
122123
release_status,
123124
"Intended Audience :: Developers",
124125
"License :: OSI Approved :: Apache Software License",
125126
"Programming Language :: Python",
126127
"Programming Language :: Python :: 3",
127-
"Programming Language :: Python :: 3.9",
128128
"Programming Language :: Python :: 3.10",
129129
"Programming Language :: Python :: 3.11",
130130
"Programming Language :: Python :: 3.12",
@@ -135,7 +135,7 @@
135135
],
136136
platforms="Posix; MacOS X; Windows",
137137
packages=packages,
138-
python_requires=">=3.9",
138+
python_requires=">=3.10",
139139
install_requires=dependencies,
140140
extras_require=extras,
141141
include_package_data=True,
Collapse file
+19-13Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
3-
# List all library dependencies and extras in this file.
4-
google-auth
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List all library dependencies and extras in this file,
4+
# pinning their versions to their lower bounds.
5+
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
6+
# then this file should have google-cloud-foo==1.14.0
7+
google-auth==2.26.1
58
# cryptography is a direct dependency of google-auth
6-
cryptography
7-
google-api-core
8-
google-cloud-core
9-
google-resumable-media
10-
grpcio
11-
requests
12-
google-crc32c
13-
protobuf
14-
opentelemetry-api
9+
cryptography==38.0.0
10+
google-api-core==2.27.0
11+
google-cloud-core==2.4.2
12+
google-resumable-media==2.7.2
13+
grpcio==1.44.0
14+
grpcio-status==1.44.0
15+
proto-plus==1.22.3
16+
protobuf==4.25.8
17+
grpc-google-iam-v1==0.14.0
18+
opentelemetry-api==1.1.0
19+
requests==2.22.0
20+
google-crc32c==1.6.0
Collapse file

‎packages/google-cloud-storage/testing/constraints-3.9.txt‎

Copy file name to clipboardExpand all lines: packages/google-cloud-storage/testing/constraints-3.9.txt
-18Lines changed: 0 additions & 18 deletions
This file was deleted.
Collapse file

‎packages/google-cloud-storage/tests/unit/gapic/_storage_v2/test_storage.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-storage/tests/unit/gapic/_storage_v2/test_storage.py
+6-20Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -13,18 +13,12 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import os
17-
18-
# try/except added for compatibility with python < 3.8
19-
try:
20-
from unittest import mock
21-
from unittest.mock import AsyncMock # pragma: NO COVER
22-
except ImportError: # pragma: NO COVER
23-
import mock
24-
2516
import json
2617
import math
18+
import os
2719
from collections.abc import Mapping, Sequence
20+
from unittest import mock
21+
from unittest.mock import AsyncMock
2822

2923
import grpc
3024
import pytest
@@ -2565,11 +2559,7 @@ async def test_list_buckets_async_pages():
25652559
RuntimeError,
25662560
)
25672561
pages = []
2568-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
2569-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
2570-
async for page_ in ( # pragma: no branch
2571-
await client.list_buckets(request={})
2572-
).pages:
2562+
async for page_ in (await client.list_buckets(request={})).pages:
25732563
pages.append(page_)
25742564
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
25752565
assert page_.raw_page.next_page_token == token
@@ -7085,11 +7075,7 @@ async def test_list_objects_async_pages():
70857075
RuntimeError,
70867076
)
70877077
pages = []
7088-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
7089-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
7090-
async for page_ in ( # pragma: no branch
7091-
await client.list_objects(request={})
7092-
).pages:
7078+
async for page_ in (await client.list_objects(request={})).pages:
70937079
pages.append(page_)
70947080
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
70957081
assert page_.raw_page.next_page_token == token

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.