Skip to content

Commit 2904f05

Browse files
authored
feat: regenerate google-shopping packages (#17072)
This Pull Request drops support for Python <=3.9 in generated packages. This is part of our ongoing effort to modernize the Cloud Python SDK libraries and remove support for End-of-Life (EOL) Python versions. ## Changes - Removed Python <=3.9 from testing, configuration, and constraints files. - Resolved dependency conflicts arising from dropping Python <=3.9 support. - Cleaned up obsolete code related to Python <=3.9 support. - Updated select copyright dates - Updated some autogenerated headings - Updated some tests to resolve issues discovered during this migration.
1 parent a5fb6cf commit 2904f05

218 files changed

Lines changed: 1158 additions & 2622 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-shopping-css/docs/conf.py

Lines 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-shopping-css"
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

packages/google-shopping-css/google/shopping/css_v1/__init__.py

Lines 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.account_labels_service import (
3327
AccountLabelsServiceAsyncClient,
@@ -97,28 +91,17 @@
9791
# An older version of api_core is installed which does not define the
9892
# functions above. We do equivalent checks manually.
9993
try:
100-
import sys
10194
import warnings
10295

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

packages/google-shopping-css/noxfile.py

Lines 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",
@@ -390,7 +389,6 @@ def docs(session):
390389
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
391390
session.run(
392391
"sphinx-build",
393-
"-W", # warnings as errors
394392
"-T", # show full traceback on exception
395393
"-N", # no colors
396394
"-b",

packages/google-shopping-css/setup.py

Lines changed: 5 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.
@@ -39,11 +39,11 @@
3939
release_status = "Development Status :: 5 - Production/Stable"
4040

4141
dependencies = [
42-
"google-api-core[grpc] >= 2.11.0, <3.0.0",
42+
"google-api-core[grpc] >= 2.17.1, <3.0.0",
4343
# Exclude incompatible versions of `google-auth`
4444
# See https://github.com/googleapis/google-cloud-python/issues/12364
4545
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
46-
"grpcio >= 1.33.2, < 2.0.0",
46+
"grpcio >= 1.44.0, < 2.0.0",
4747
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
4848
"proto-plus >= 1.22.3, <2.0.0",
4949
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
@@ -72,15 +72,14 @@
7272
long_description=readme,
7373
author="Google LLC",
7474
author_email="googleapis-packages@google.com",
75-
license="Apache 2.0",
75+
license="Apache-2.0",
7676
url=url,
7777
classifiers=[
7878
release_status,
7979
"Intended Audience :: Developers",
8080
"License :: OSI Approved :: Apache Software License",
8181
"Programming Language :: Python",
8282
"Programming Language :: Python :: 3",
83-
"Programming Language :: Python :: 3.9",
8483
"Programming Language :: Python :: 3.10",
8584
"Programming Language :: Python :: 3.11",
8685
"Programming Language :: Python :: 3.12",
@@ -91,7 +90,7 @@
9190
],
9291
platforms="Posix; MacOS X; Windows",
9392
packages=packages,
94-
python_requires=">=3.9",
93+
python_requires=">=3.10",
9594
install_requires=dependencies,
9695
extras_require=extras,
9796
include_package_data=True,
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
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-api-core
5-
google-auth
6-
grpcio
7-
proto-plus
8-
protobuf
9-
# cryptography is a direct dependency of google-auth
10-
cryptography
11-
google-shopping-type
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-api-core==2.17.1
8+
google-auth==2.14.1
9+
grpcio==1.44.0
10+
proto-plus==1.22.3
11+
protobuf==4.25.8
12+
google-shopping-type==1.0.0

packages/google-shopping-css/testing/constraints-3.9.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/google-shopping-css/tests/unit/gapic/css_v1/test_account_labels_service.py

Lines changed: 9 additions & 19 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 AsyncIterable, Iterable, Mapping, Sequence
20+
from unittest import mock
21+
from unittest.mock import AsyncMock
2822

2923
import grpc
3024
import pytest
@@ -1909,11 +1903,7 @@ async def test_list_account_labels_async_pages():
19091903
RuntimeError,
19101904
)
19111905
pages = []
1912-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1913-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1914-
async for page_ in ( # pragma: no branch
1915-
await client.list_account_labels(request={})
1916-
).pages:
1906+
async for page_ in (await client.list_account_labels(request={})).pages:
19171907
pages.append(page_)
19181908
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
19191909
assert page_.raw_page.next_page_token == token
@@ -3098,7 +3088,7 @@ def test_list_account_labels_rest_required_fields(
30983088

30993089
expected_params = [("$alt", "json;enum-encoding=int")]
31003090
actual_params = req.call_args.kwargs["params"]
3101-
assert expected_params == actual_params
3091+
assert sorted(expected_params) == sorted(actual_params)
31023092

31033093

31043094
def test_list_account_labels_rest_unset_required_fields():
@@ -3350,7 +3340,7 @@ def test_create_account_label_rest_required_fields(
33503340

33513341
expected_params = [("$alt", "json;enum-encoding=int")]
33523342
actual_params = req.call_args.kwargs["params"]
3353-
assert expected_params == actual_params
3343+
assert sorted(expected_params) == sorted(actual_params)
33543344

33553345

33563346
def test_create_account_label_rest_unset_required_fields():
@@ -3536,7 +3526,7 @@ def test_update_account_label_rest_required_fields(
35363526

35373527
expected_params = [("$alt", "json;enum-encoding=int")]
35383528
actual_params = req.call_args.kwargs["params"]
3539-
assert expected_params == actual_params
3529+
assert sorted(expected_params) == sorted(actual_params)
35403530

35413531

35423532
def test_update_account_label_rest_unset_required_fields():
@@ -3714,7 +3704,7 @@ def test_delete_account_label_rest_required_fields(
37143704

37153705
expected_params = [("$alt", "json;enum-encoding=int")]
37163706
actual_params = req.call_args.kwargs["params"]
3717-
assert expected_params == actual_params
3707+
assert sorted(expected_params) == sorted(actual_params)
37183708

37193709

37203710
def test_delete_account_label_rest_unset_required_fields():

packages/google-shopping-css/tests/unit/gapic/css_v1/test_accounts_service.py

Lines changed: 8 additions & 18 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 AsyncIterable, Iterable, Mapping, Sequence
20+
from unittest import mock
21+
from unittest.mock import AsyncMock
2822

2923
import grpc
3024
import pytest
@@ -1874,11 +1868,7 @@ async def test_list_child_accounts_async_pages():
18741868
RuntimeError,
18751869
)
18761870
pages = []
1877-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1878-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1879-
async for page_ in ( # pragma: no branch
1880-
await client.list_child_accounts(request={})
1881-
).pages:
1871+
async for page_ in (await client.list_child_accounts(request={})).pages:
18821872
pages.append(page_)
18831873
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
18841874
assert page_.raw_page.next_page_token == token
@@ -2703,7 +2693,7 @@ def test_list_child_accounts_rest_required_fields(
27032693

27042694
expected_params = [("$alt", "json;enum-encoding=int")]
27052695
actual_params = req.call_args.kwargs["params"]
2706-
assert expected_params == actual_params
2696+
assert sorted(expected_params) == sorted(actual_params)
27072697

27082698

27092699
def test_list_child_accounts_rest_unset_required_fields():
@@ -2953,7 +2943,7 @@ def test_get_account_rest_required_fields(request_type=accounts.GetAccountReques
29532943

29542944
expected_params = [("$alt", "json;enum-encoding=int")]
29552945
actual_params = req.call_args.kwargs["params"]
2956-
assert expected_params == actual_params
2946+
assert sorted(expected_params) == sorted(actual_params)
29572947

29582948

29592949
def test_get_account_rest_unset_required_fields():
@@ -3130,7 +3120,7 @@ def test_update_labels_rest_required_fields(
31303120

31313121
expected_params = [("$alt", "json;enum-encoding=int")]
31323122
actual_params = req.call_args.kwargs["params"]
3133-
assert expected_params == actual_params
3123+
assert sorted(expected_params) == sorted(actual_params)
31343124

31353125

31363126
def test_update_labels_rest_unset_required_fields():

packages/google-shopping-css/tests/unit/gapic/css_v1/test_css_product_inputs_service.py

Lines changed: 7 additions & 13 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 AsyncIterable, Iterable, Mapping, Sequence
20+
from unittest import mock
21+
from unittest.mock import AsyncMock
2822

2923
import grpc
3024
import pytest
@@ -2466,7 +2460,7 @@ def test_insert_css_product_input_rest_required_fields(
24662460

24672461
expected_params = [("$alt", "json;enum-encoding=int")]
24682462
actual_params = req.call_args.kwargs["params"]
2469-
assert expected_params == actual_params
2463+
assert sorted(expected_params) == sorted(actual_params)
24702464

24712465

24722466
def test_insert_css_product_input_rest_unset_required_fields():
@@ -2597,7 +2591,7 @@ def test_update_css_product_input_rest_required_fields(
25972591

25982592
expected_params = [("$alt", "json;enum-encoding=int")]
25992593
actual_params = req.call_args.kwargs["params"]
2600-
assert expected_params == actual_params
2594+
assert sorted(expected_params) == sorted(actual_params)
26012595

26022596

26032597
def test_update_css_product_input_rest_unset_required_fields():
@@ -2783,7 +2777,7 @@ def test_delete_css_product_input_rest_required_fields(
27832777

27842778
expected_params = [("$alt", "json;enum-encoding=int")]
27852779
actual_params = req.call_args.kwargs["params"]
2786-
assert expected_params == actual_params
2780+
assert sorted(expected_params) == sorted(actual_params)
27872781

27882782

27892783
def test_delete_css_product_input_rest_unset_required_fields():

0 commit comments

Comments
 (0)