Skip to content

Commit 201a04d

Browse files
jskeetnidhiii-27
authored andcommitted
feat: regenerate google-cloud-[o-r] packages (#17075)
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. - 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 6362bbc commit 201a04d

515 files changed

Lines changed: 2891 additions & 4932 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-cloud-optimization/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-cloud-optimization"
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-cloud-optimization/google/cloud/optimization_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.fleet_routing import FleetRoutingAsyncClient, FleetRoutingClient
3327
from .types.async_model import (
@@ -73,28 +67,17 @@
7367
# An older version of api_core is installed which does not define the
7468
# functions above. We do equivalent checks manually.
7569
try:
76-
import sys
7770
import warnings
7871

7972
_py_version_str = sys.version.split()[0]
8073
_package_label = "google.cloud.optimization_v1"
81-
if sys.version_info < (3, 9):
74+
if sys.version_info < (3, 10):
8275
warnings.warn(
8376
"You are using a non-supported Python version "
8477
+ f"({_py_version_str}). Google will not post any further "
8578
+ f"updates to {_package_label} supporting this Python version. "
8679
+ "Please upgrade to the latest Python version, or at "
87-
+ f"least to Python 3.9, and then update {_package_label}.",
88-
FutureWarning,
89-
)
90-
if sys.version_info[:2] == (3, 9):
91-
warnings.warn(
92-
f"You are using a Python version ({_py_version_str}) "
93-
+ f"which Google will stop supporting in {_package_label} in "
94-
+ "January 2026. Please "
95-
+ "upgrade to the latest Python version, or at "
96-
+ "least to Python 3.10, before then, and "
97-
+ f"then update {_package_label}.",
80+
+ f"least to Python 3.10, and then update {_package_label}.",
9881
FutureWarning,
9982
)
10083

packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py

Lines changed: 3 additions & 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.
@@ -465,11 +465,11 @@ async def sample_batch_optimize_tours():
465465
)
466466
467467
# Make the request
468-
operation = client.batch_optimize_tours(request=request)
468+
operation = await client.batch_optimize_tours(request=request)
469469
470470
print("Waiting for operation to complete...")
471471
472-
response = (await operation).result()
472+
response = await operation.result()
473473
474474
# Handle the response
475475
print(response)

packages/google-cloud-optimization/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-cloud-optimization/samples/generated_samples/cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.py

Lines changed: 3 additions & 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.
@@ -49,11 +49,11 @@ async def sample_batch_optimize_tours():
4949
)
5050

5151
# Make the request
52-
operation = client.batch_optimize_tours(request=request)
52+
operation = await client.batch_optimize_tours(request=request)
5353

5454
print("Waiting for operation to complete...")
5555

56-
response = (await operation).result()
56+
response = await operation.result()
5757

5858
# Handle the response
5959
print(response)

packages/google-cloud-optimization/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.
@@ -41,11 +41,11 @@
4141
release_status = "Development Status :: 5 - Production/Stable"
4242

4343
dependencies = [
44-
"google-api-core[grpc] >= 2.11.0, <3.0.0",
44+
"google-api-core[grpc] >= 2.17.1, <3.0.0",
4545
# Exclude incompatible versions of `google-auth`
4646
# See https://github.com/googleapis/google-cloud-python/issues/12364
4747
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
48-
"grpcio >= 1.33.2, < 2.0.0",
48+
"grpcio >= 1.44.0, < 2.0.0",
4949
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
5050
"proto-plus >= 1.22.3, <2.0.0",
5151
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
@@ -73,15 +73,14 @@
7373
long_description=readme,
7474
author="Google LLC",
7575
author_email="googleapis-packages@google.com",
76-
license="Apache 2.0",
76+
license="Apache-2.0",
7777
url=url,
7878
classifiers=[
7979
release_status,
8080
"Intended Audience :: Developers",
8181
"License :: OSI Approved :: Apache Software License",
8282
"Programming Language :: Python",
8383
"Programming Language :: Python :: 3",
84-
"Programming Language :: Python :: 3.9",
8584
"Programming Language :: Python :: 3.10",
8685
"Programming Language :: Python :: 3.11",
8786
"Programming Language :: Python :: 3.12",
@@ -92,7 +91,7 @@
9291
],
9392
platforms="Posix; MacOS X; Windows",
9493
packages=packages,
95-
python_requires=">=3.9",
94+
python_requires=">=3.10",
9695
install_requires=dependencies,
9796
extras_require=extras,
9897
include_package_data=True,
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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
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

packages/google-cloud-optimization/testing/constraints-3.9.txt

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

packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.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,19 +13,13 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import os
17-
import re
18-
19-
# try/except added for compatibility with python < 3.8
20-
try:
21-
from unittest import mock
22-
from unittest.mock import AsyncMock # pragma: NO COVER
23-
except ImportError: # pragma: NO COVER
24-
import mock
25-
2616
import json
2717
import math
18+
import os
19+
import re
2820
from collections.abc import AsyncIterable, Iterable, Mapping, Sequence
21+
from unittest import mock
22+
from unittest.mock import AsyncMock
2923

3024
import grpc
3125
import pytest
@@ -1914,7 +1908,7 @@ def test_optimize_tours_rest_required_fields(
19141908

19151909
expected_params = [("$alt", "json;enum-encoding=int")]
19161910
actual_params = req.call_args.kwargs["params"]
1917-
assert expected_params == actual_params
1911+
assert sorted(expected_params) == sorted(actual_params)
19181912

19191913

19201914
def test_optimize_tours_rest_unset_required_fields():
@@ -2040,7 +2034,7 @@ def test_batch_optimize_tours_rest_required_fields(
20402034

20412035
expected_params = [("$alt", "json;enum-encoding=int")]
20422036
actual_params = req.call_args.kwargs["params"]
2043-
assert expected_params == actual_params
2037+
assert sorted(expected_params) == sorted(actual_params)
20442038

20452039

20462040
def test_batch_optimize_tours_rest_unset_required_fields():

packages/google-cloud-oracledatabase/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-cloud-oracledatabase"
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

0 commit comments

Comments
 (0)