diff --git a/packages/google-cloud-optimization/docs/conf.py b/packages/google-cloud-optimization/docs/conf.py index 4426a4e9128c..defd2a253db9 100644 --- a/packages/google-cloud-optimization/docs/conf.py +++ b/packages/google-cloud-optimization/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-optimization" -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-optimization/google/cloud/optimization_v1/__init__.py b/packages/google-cloud-optimization/google/cloud/optimization_v1/__init__.py index aa9a78ba8b02..3af18a4c0156 100644 --- a/packages/google-cloud-optimization/google/cloud/optimization_v1/__init__.py +++ b/packages/google-cloud-optimization/google/cloud/optimization_v1/__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.fleet_routing import FleetRoutingAsyncClient, FleetRoutingClient from .types.async_model import ( @@ -73,28 +67,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.optimization_v1" - 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-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py b/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py index 86aabaa9d9c3..3c8f070a2d12 100644 --- a/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py +++ b/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.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. @@ -465,11 +465,11 @@ async def sample_batch_optimize_tours(): ) # Make the request - operation = client.batch_optimize_tours(request=request) + operation = await client.batch_optimize_tours(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-optimization/noxfile.py b/packages/google-cloud-optimization/noxfile.py index ad11b9be0c15..90a4ead68fa8 100644 --- a/packages/google-cloud-optimization/noxfile.py +++ b/packages/google-cloud-optimization/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", @@ -390,7 +389,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-optimization/samples/generated_samples/cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.py b/packages/google-cloud-optimization/samples/generated_samples/cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.py index ae1374e5b7df..a06db9f8d632 100644 --- a/packages/google-cloud-optimization/samples/generated_samples/cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.py +++ b/packages/google-cloud-optimization/samples/generated_samples/cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.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. @@ -49,11 +49,11 @@ async def sample_batch_optimize_tours(): ) # Make the request - operation = client.batch_optimize_tours(request=request) + operation = await client.batch_optimize_tours(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-optimization/setup.py b/packages/google-cloud-optimization/setup.py index 8fe6eee1585b..2ef4b82fa156 100644 --- a/packages/google-cloud-optimization/setup.py +++ b/packages/google-cloud-optimization/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-optimization/testing/constraints-3.10.txt b/packages/google-cloud-optimization/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-optimization/testing/constraints-3.10.txt +++ b/packages/google-cloud-optimization/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-optimization/testing/constraints-3.9.txt b/packages/google-cloud-optimization/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-optimization/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py b/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py index aa140cc42e53..bcaa3d77f900 100644 --- a/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py +++ b/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1914,7 +1908,7 @@ def test_optimize_tours_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_optimize_tours_rest_unset_required_fields(): @@ -2040,7 +2034,7 @@ def test_batch_optimize_tours_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_optimize_tours_rest_unset_required_fields(): diff --git a/packages/google-cloud-oracledatabase/docs/conf.py b/packages/google-cloud-oracledatabase/docs/conf.py index de2933eb24db..188ac385b29f 100644 --- a/packages/google-cloud-oracledatabase/docs/conf.py +++ b/packages/google-cloud-oracledatabase/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-oracledatabase" -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-oracledatabase/google/cloud/oracledatabase_v1/__init__.py b/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/__init__.py index 637cdc486fda..6d7061680f24 100644 --- a/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/__init__.py +++ b/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/__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.oracle_database import OracleDatabaseAsyncClient, OracleDatabaseClient from .types.autonomous_database import ( @@ -220,28 +214,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.oracledatabase_v1" - 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-oracledatabase/google/cloud/oracledatabase_v1/services/oracle_database/async_client.py b/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/services/oracle_database/async_client.py index 9e7cc56a96e4..04b8ccf3ce01 100644 --- a/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/services/oracle_database/async_client.py +++ b/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/services/oracle_database/async_client.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. @@ -711,11 +711,11 @@ async def sample_create_cloud_exadata_infrastructure(): ) # Make the request - operation = client.create_cloud_exadata_infrastructure(request=request) + operation = await client.create_cloud_exadata_infrastructure(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -866,11 +866,11 @@ async def sample_delete_cloud_exadata_infrastructure(): ) # Make the request - operation = client.delete_cloud_exadata_infrastructure(request=request) + operation = await client.delete_cloud_exadata_infrastructure(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1251,11 +1251,11 @@ async def sample_create_cloud_vm_cluster(): ) # Make the request - operation = client.create_cloud_vm_cluster(request=request) + operation = await client.create_cloud_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1397,11 +1397,11 @@ async def sample_delete_cloud_vm_cluster(): ) # Make the request - operation = client.delete_cloud_vm_cluster(request=request) + operation = await client.delete_cloud_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2538,11 +2538,11 @@ async def sample_create_autonomous_database(): ) # Make the request - operation = client.create_autonomous_database(request=request) + operation = await client.create_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2689,11 +2689,11 @@ async def sample_update_autonomous_database(): ) # Make the request - operation = client.update_autonomous_database(request=request) + operation = await client.update_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2828,11 +2828,11 @@ async def sample_delete_autonomous_database(): ) # Make the request - operation = client.delete_autonomous_database(request=request) + operation = await client.delete_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2964,11 +2964,11 @@ async def sample_restore_autonomous_database(): ) # Make the request - operation = client.restore_autonomous_database(request=request) + operation = await client.restore_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3638,11 +3638,11 @@ async def sample_stop_autonomous_database(): ) # Make the request - operation = client.stop_autonomous_database(request=request) + operation = await client.stop_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3765,11 +3765,11 @@ async def sample_start_autonomous_database(): ) # Make the request - operation = client.start_autonomous_database(request=request) + operation = await client.start_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3892,11 +3892,11 @@ async def sample_restart_autonomous_database(): ) # Make the request - operation = client.restart_autonomous_database(request=request) + operation = await client.restart_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4022,11 +4022,11 @@ async def sample_switchover_autonomous_database(): ) # Make the request - operation = client.switchover_autonomous_database(request=request) + operation = await client.switchover_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4162,11 +4162,11 @@ async def sample_failover_autonomous_database(): ) # Make the request - operation = client.failover_autonomous_database(request=request) + operation = await client.failover_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4540,11 +4540,11 @@ async def sample_create_odb_network(): ) # Make the request - operation = client.create_odb_network(request=request) + operation = await client.create_odb_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4687,11 +4687,11 @@ async def sample_delete_odb_network(): ) # Make the request - operation = client.delete_odb_network(request=request) + operation = await client.delete_odb_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5062,11 +5062,11 @@ async def sample_create_odb_subnet(): ) # Make the request - operation = client.create_odb_subnet(request=request) + operation = await client.create_odb_subnet(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5209,11 +5209,11 @@ async def sample_delete_odb_subnet(): ) # Make the request - operation = client.delete_odb_subnet(request=request) + operation = await client.delete_odb_subnet(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5602,11 +5602,11 @@ async def sample_create_exadb_vm_cluster(): ) # Make the request - operation = client.create_exadb_vm_cluster(request=request) + operation = await client.create_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5749,11 +5749,11 @@ async def sample_delete_exadb_vm_cluster(): ) # Make the request - operation = client.delete_exadb_vm_cluster(request=request) + operation = await client.delete_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5900,11 +5900,11 @@ async def sample_update_exadb_vm_cluster(): ) # Make the request - operation = client.update_exadb_vm_cluster(request=request) + operation = await client.update_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6046,11 +6046,11 @@ async def sample_remove_virtual_machine_exadb_vm_cluster(): ) # Make the request - operation = client.remove_virtual_machine_exadb_vm_cluster(request=request) + operation = await client.remove_virtual_machine_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6449,11 +6449,11 @@ async def sample_create_exascale_db_storage_vault(): ) # Make the request - operation = client.create_exascale_db_storage_vault(request=request) + operation = await client.create_exascale_db_storage_vault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6604,11 +6604,11 @@ async def sample_delete_exascale_db_storage_vault(): ) # Make the request - operation = client.delete_exascale_db_storage_vault(request=request) + operation = await client.delete_exascale_db_storage_vault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7607,11 +7607,11 @@ async def sample_create_db_system(): ) # Make the request - operation = client.create_db_system(request=request) + operation = await client.create_db_system(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7751,11 +7751,11 @@ async def sample_delete_db_system(): ) # Make the request - operation = client.delete_db_system(request=request) + operation = await client.delete_db_system(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/types/exadata_infra.py b/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/types/exadata_infra.py index a5b6393cb382..5dcebed9df19 100644 --- a/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/types/exadata_infra.py +++ b/packages/google-cloud-oracledatabase/google/cloud/oracledatabase_v1/types/exadata_infra.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. @@ -389,12 +389,12 @@ class MaintenanceWindow(proto.Message): when maintenance should be performed. The window is a 4 hour slot. Valid values are: - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + 0 - represents time slot 0:00 - 3:59 UTC + 4 - represents time slot 4:00 - 7:59 UTC + 8 - represents time slot 8:00 - 11:59 UTC + 12 - represents time slot 12:00 - 15:59 UTC + 16 - represents time slot 16:00 - 19:59 UTC 20 + - represents time slot 20:00 - 23:59 UTC lead_time_week (int): Optional. Lead time window allows user to set a lead time to prepare for a down time. The lead diff --git a/packages/google-cloud-oracledatabase/noxfile.py b/packages/google-cloud-oracledatabase/noxfile.py index 57ad10caa0e2..d14a7ecb7797 100644 --- a/packages/google-cloud-oracledatabase/noxfile.py +++ b/packages/google-cloud-oracledatabase/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", @@ -390,7 +389,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-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_autonomous_database_async.py index dbfbb576b03a..bc705abe9267 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_autonomous_database_async.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. @@ -45,11 +45,11 @@ async def sample_create_autonomous_database(): ) # Make the request - operation = client.create_autonomous_database(request=request) + operation = await client.create_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_exadata_infrastructure_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_exadata_infrastructure_async.py index 773c9fbad988..23b930f4eb81 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_exadata_infrastructure_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_exadata_infrastructure_async.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. @@ -45,11 +45,11 @@ async def sample_create_cloud_exadata_infrastructure(): ) # Make the request - operation = client.create_cloud_exadata_infrastructure(request=request) + operation = await client.create_cloud_exadata_infrastructure(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_vm_cluster_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_vm_cluster_async.py index 2d5edd7c1bb5..5842c8b2f664 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_vm_cluster_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_cloud_vm_cluster_async.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. @@ -49,11 +49,11 @@ async def sample_create_cloud_vm_cluster(): ) # Make the request - operation = client.create_cloud_vm_cluster(request=request) + operation = await client.create_cloud_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_db_system_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_db_system_async.py index 82229f6ab278..3398b84f904d 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_db_system_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_db_system_async.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. @@ -50,11 +50,11 @@ async def sample_create_db_system(): ) # Make the request - operation = client.create_db_system(request=request) + operation = await client.create_db_system(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exadb_vm_cluster_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exadb_vm_cluster_async.py index 4675d2ccc997..2b54441e5419 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exadb_vm_cluster_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exadb_vm_cluster_async.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. @@ -64,11 +64,11 @@ async def sample_create_exadb_vm_cluster(): ) # Make the request - operation = client.create_exadb_vm_cluster(request=request) + operation = await client.create_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exascale_db_storage_vault_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exascale_db_storage_vault_async.py index 1f4ed05e960a..afdf8dcff663 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exascale_db_storage_vault_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_exascale_db_storage_vault_async.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. @@ -52,11 +52,11 @@ async def sample_create_exascale_db_storage_vault(): ) # Make the request - operation = client.create_exascale_db_storage_vault(request=request) + operation = await client.create_exascale_db_storage_vault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_network_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_network_async.py index 40cc4b7f9df9..30c80ed325de 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_network_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_network_async.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. @@ -49,11 +49,11 @@ async def sample_create_odb_network(): ) # Make the request - operation = client.create_odb_network(request=request) + operation = await client.create_odb_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_subnet_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_subnet_async.py index 0b9a7de2c1e2..256d74fd5c1d 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_subnet_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_create_odb_subnet_async.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. @@ -50,11 +50,11 @@ async def sample_create_odb_subnet(): ) # Make the request - operation = client.create_odb_subnet(request=request) + operation = await client.create_odb_subnet(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_autonomous_database_async.py index 2350ab5e74b8..04f17547cf20 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_autonomous_database_async.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. @@ -44,11 +44,11 @@ async def sample_delete_autonomous_database(): ) # Make the request - operation = client.delete_autonomous_database(request=request) + operation = await client.delete_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_exadata_infrastructure_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_exadata_infrastructure_async.py index a2d169a0ec40..904914504acf 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_exadata_infrastructure_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_exadata_infrastructure_async.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. @@ -44,11 +44,11 @@ async def sample_delete_cloud_exadata_infrastructure(): ) # Make the request - operation = client.delete_cloud_exadata_infrastructure(request=request) + operation = await client.delete_cloud_exadata_infrastructure(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_vm_cluster_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_vm_cluster_async.py index 137d43852760..e93b9db28f06 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_vm_cluster_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_cloud_vm_cluster_async.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. @@ -44,11 +44,11 @@ async def sample_delete_cloud_vm_cluster(): ) # Make the request - operation = client.delete_cloud_vm_cluster(request=request) + operation = await client.delete_cloud_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_db_system_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_db_system_async.py index 9e2fbadb2ed1..afb62c327108 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_db_system_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_db_system_async.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. @@ -44,11 +44,11 @@ async def sample_delete_db_system(): ) # Make the request - operation = client.delete_db_system(request=request) + operation = await client.delete_db_system(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exadb_vm_cluster_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exadb_vm_cluster_async.py index dc0f485e4ab6..10d5a2f59737 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exadb_vm_cluster_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exadb_vm_cluster_async.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. @@ -44,11 +44,11 @@ async def sample_delete_exadb_vm_cluster(): ) # Make the request - operation = client.delete_exadb_vm_cluster(request=request) + operation = await client.delete_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exascale_db_storage_vault_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exascale_db_storage_vault_async.py index 67e140b31490..a29998ac1de9 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exascale_db_storage_vault_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_exascale_db_storage_vault_async.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. @@ -44,11 +44,11 @@ async def sample_delete_exascale_db_storage_vault(): ) # Make the request - operation = client.delete_exascale_db_storage_vault(request=request) + operation = await client.delete_exascale_db_storage_vault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_network_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_network_async.py index 52ef6b2bd971..a8c5d1a348af 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_network_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_network_async.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. @@ -44,11 +44,11 @@ async def sample_delete_odb_network(): ) # Make the request - operation = client.delete_odb_network(request=request) + operation = await client.delete_odb_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_subnet_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_subnet_async.py index 9050199af8ed..8011fb5ec543 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_subnet_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_delete_odb_subnet_async.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. @@ -44,11 +44,11 @@ async def sample_delete_odb_subnet(): ) # Make the request - operation = client.delete_odb_subnet(request=request) + operation = await client.delete_odb_subnet(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_failover_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_failover_autonomous_database_async.py index 2612d51d2ec8..6e3e8691f557 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_failover_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_failover_autonomous_database_async.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. @@ -45,11 +45,11 @@ async def sample_failover_autonomous_database(): ) # Make the request - operation = client.failover_autonomous_database(request=request) + operation = await client.failover_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_remove_virtual_machine_exadb_vm_cluster_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_remove_virtual_machine_exadb_vm_cluster_async.py index b0a29835fd86..92687daab138 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_remove_virtual_machine_exadb_vm_cluster_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_remove_virtual_machine_exadb_vm_cluster_async.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. @@ -45,11 +45,11 @@ async def sample_remove_virtual_machine_exadb_vm_cluster(): ) # Make the request - operation = client.remove_virtual_machine_exadb_vm_cluster(request=request) + operation = await client.remove_virtual_machine_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restart_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restart_autonomous_database_async.py index 3406ef54f2b4..e29b0e7e871b 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restart_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restart_autonomous_database_async.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. @@ -44,11 +44,11 @@ async def sample_restart_autonomous_database(): ) # Make the request - operation = client.restart_autonomous_database(request=request) + operation = await client.restart_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restore_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restore_autonomous_database_async.py index fe083c7d5e57..13693bc8d497 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restore_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_restore_autonomous_database_async.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. @@ -44,11 +44,11 @@ async def sample_restore_autonomous_database(): ) # Make the request - operation = client.restore_autonomous_database(request=request) + operation = await client.restore_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_start_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_start_autonomous_database_async.py index 85e091f08c8a..98559cb181ef 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_start_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_start_autonomous_database_async.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. @@ -44,11 +44,11 @@ async def sample_start_autonomous_database(): ) # Make the request - operation = client.start_autonomous_database(request=request) + operation = await client.start_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_stop_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_stop_autonomous_database_async.py index 4d0601fd5877..bf8b5dde56b6 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_stop_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_stop_autonomous_database_async.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. @@ -44,11 +44,11 @@ async def sample_stop_autonomous_database(): ) # Make the request - operation = client.stop_autonomous_database(request=request) + operation = await client.stop_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_switchover_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_switchover_autonomous_database_async.py index 2137e4a20ca6..26945f1620cc 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_switchover_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_switchover_autonomous_database_async.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. @@ -45,11 +45,11 @@ async def sample_switchover_autonomous_database(): ) # Make the request - operation = client.switchover_autonomous_database(request=request) + operation = await client.switchover_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_autonomous_database_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_autonomous_database_async.py index 16d758c5b858..3adaef8e87f5 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_autonomous_database_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_autonomous_database_async.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. @@ -42,11 +42,11 @@ async def sample_update_autonomous_database(): request = oracledatabase_v1.UpdateAutonomousDatabaseRequest() # Make the request - operation = client.update_autonomous_database(request=request) + operation = await client.update_autonomous_database(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_exadb_vm_cluster_async.py b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_exadb_vm_cluster_async.py index 3022b1093870..dfd99498944e 100644 --- a/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_exadb_vm_cluster_async.py +++ b/packages/google-cloud-oracledatabase/samples/generated_samples/oracledatabase_v1_generated_oracle_database_update_exadb_vm_cluster_async.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. @@ -62,11 +62,11 @@ async def sample_update_exadb_vm_cluster(): ) # Make the request - operation = client.update_exadb_vm_cluster(request=request) + operation = await client.update_exadb_vm_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-oracledatabase/setup.py b/packages/google-cloud-oracledatabase/setup.py index 20453d22a1a2..456dc4ccbacd 100644 --- a/packages/google-cloud-oracledatabase/setup.py +++ b/packages/google-cloud-oracledatabase/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-oracledatabase/testing/constraints-3.10.txt b/packages/google-cloud-oracledatabase/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-oracledatabase/testing/constraints-3.10.txt +++ b/packages/google-cloud-oracledatabase/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-oracledatabase/testing/constraints-3.9.txt b/packages/google-cloud-oracledatabase/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-oracledatabase/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-oracledatabase/tests/unit/gapic/oracledatabase_v1/test_oracle_database.py b/packages/google-cloud-oracledatabase/tests/unit/gapic/oracledatabase_v1/test_oracle_database.py index 875b73e255e9..282aa49c87b6 100644 --- a/packages/google-cloud-oracledatabase/tests/unit/gapic/oracledatabase_v1/test_oracle_database.py +++ b/packages/google-cloud-oracledatabase/tests/unit/gapic/oracledatabase_v1/test_oracle_database.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1911,9 +1905,7 @@ async def test_list_cloud_exadata_infrastructures_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 + async for page_ in ( await client.list_cloud_exadata_infrastructures(request={}) ).pages: pages.append(page_) @@ -3539,11 +3531,7 @@ async def test_list_cloud_vm_clusters_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_cloud_vm_clusters(request={}) - ).pages: + async for page_ in (await client.list_cloud_vm_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5176,11 +5164,7 @@ async def test_list_entitlements_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_entitlements(request={}) - ).pages: + async for page_ in (await client.list_entitlements(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5695,11 +5679,7 @@ async def test_list_db_servers_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_db_servers(request={}) - ).pages: + async for page_ in (await client.list_db_servers(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6214,11 +6194,7 @@ async def test_list_db_nodes_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_db_nodes(request={}) - ).pages: + async for page_ in (await client.list_db_nodes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6737,11 +6713,7 @@ async def test_list_gi_versions_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_gi_versions(request={}) - ).pages: + async for page_ in (await client.list_gi_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7284,11 +7256,7 @@ async def test_list_minor_versions_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_minor_versions(request={}) - ).pages: + async for page_ in (await client.list_minor_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7833,11 +7801,7 @@ async def test_list_db_system_shapes_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_db_system_shapes(request={}) - ).pages: + async for page_ in (await client.list_db_system_shapes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8390,11 +8354,7 @@ async def test_list_autonomous_databases_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_autonomous_databases(request={}) - ).pages: + async for page_ in (await client.list_autonomous_databases(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11151,11 +11111,7 @@ async def test_list_autonomous_db_versions_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_autonomous_db_versions(request={}) - ).pages: + async for page_ in (await client.list_autonomous_db_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11712,9 +11668,7 @@ async def test_list_autonomous_database_character_sets_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 + async for page_ in ( await client.list_autonomous_database_character_sets(request={}) ).pages: pages.append(page_) @@ -12269,9 +12223,7 @@ async def test_list_autonomous_database_backups_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 + async for page_ in ( await client.list_autonomous_database_backups(request={}) ).pages: pages.append(page_) @@ -14579,11 +14531,7 @@ async def test_list_odb_networks_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_odb_networks(request={}) - ).pages: + async for page_ in (await client.list_odb_networks(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -16160,11 +16108,7 @@ async def test_list_odb_subnets_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_odb_subnets(request={}) - ).pages: + async for page_ in (await client.list_odb_subnets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -17754,11 +17698,7 @@ async def test_list_exadb_vm_clusters_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_exadb_vm_clusters(request={}) - ).pages: + async for page_ in (await client.list_exadb_vm_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -20113,9 +20053,7 @@ async def test_list_exascale_db_storage_vaults_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 + async for page_ in ( await client.list_exascale_db_storage_vaults(request={}) ).pages: pages.append(page_) @@ -21767,9 +21705,7 @@ async def test_list_db_system_initial_storage_sizes_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 + async for page_ in ( await client.list_db_system_initial_storage_sizes(request={}) ).pages: pages.append(page_) @@ -22288,11 +22224,7 @@ async def test_list_databases_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_databases(request={}) - ).pages: + async for page_ in (await client.list_databases(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -23210,11 +23142,7 @@ async def test_list_pluggable_databases_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_pluggable_databases(request={}) - ).pages: + async for page_ in (await client.list_pluggable_databases(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -24080,11 +24008,7 @@ async def test_list_db_systems_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_db_systems(request={}) - ).pages: + async for page_ in (await client.list_db_systems(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -25626,11 +25550,7 @@ async def test_list_db_versions_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_db_versions(request={}) - ).pages: + async for page_ in (await client.list_db_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -26182,9 +26102,7 @@ async def test_list_database_character_sets_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 + async for page_ in ( await client.list_database_character_sets(request={}) ).pages: pages.append(page_) @@ -26316,7 +26234,7 @@ def test_list_cloud_exadata_infrastructures_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_cloud_exadata_infrastructures_rest_unset_required_fields(): @@ -26583,7 +26501,7 @@ def test_get_cloud_exadata_infrastructure_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cloud_exadata_infrastructure_rest_unset_required_fields(): @@ -26800,7 +26718,7 @@ def test_create_cloud_exadata_infrastructure_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cloud_exadata_infrastructure_rest_unset_required_fields(): @@ -27015,7 +26933,7 @@ def test_delete_cloud_exadata_infrastructure_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cloud_exadata_infrastructure_rest_unset_required_fields(): @@ -27218,7 +27136,7 @@ def test_list_cloud_vm_clusters_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_cloud_vm_clusters_rest_unset_required_fields(): @@ -27472,7 +27390,7 @@ def test_get_cloud_vm_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cloud_vm_cluster_rest_unset_required_fields(): @@ -27679,7 +27597,7 @@ def test_create_cloud_vm_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cloud_vm_cluster_rest_unset_required_fields(): @@ -27886,7 +27804,7 @@ def test_delete_cloud_vm_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cloud_vm_cluster_rest_unset_required_fields(): @@ -28081,7 +27999,7 @@ def test_list_entitlements_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_entitlements_rest_unset_required_fields(): @@ -28337,7 +28255,7 @@ def test_list_db_servers_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_db_servers_rest_unset_required_fields(): @@ -28597,7 +28515,7 @@ def test_list_db_nodes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_db_nodes_rest_unset_required_fields(): @@ -28860,7 +28778,7 @@ def test_list_gi_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_gi_versions_rest_unset_required_fields(): @@ -29121,7 +29039,7 @@ def test_list_minor_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_minor_versions_rest_unset_required_fields(): @@ -29388,7 +29306,7 @@ def test_list_db_system_shapes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_db_system_shapes_rest_unset_required_fields(): @@ -29654,7 +29572,7 @@ def test_list_autonomous_databases_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_autonomous_databases_rest_unset_required_fields(): @@ -29912,7 +29830,7 @@ def test_get_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_autonomous_database_rest_unset_required_fields(): @@ -30122,7 +30040,7 @@ def test_create_autonomous_database_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_autonomous_database_rest_unset_required_fields(): @@ -30329,7 +30247,7 @@ def test_update_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_autonomous_database_rest_unset_required_fields(): @@ -30531,7 +30449,7 @@ def test_delete_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_autonomous_database_rest_unset_required_fields(): @@ -30716,7 +30634,7 @@ def test_restore_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_autonomous_database_rest_unset_required_fields(): @@ -30916,7 +30834,7 @@ def test_generate_autonomous_database_wallet_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_generate_autonomous_database_wallet_rest_unset_required_fields(): @@ -31130,7 +31048,7 @@ def test_list_autonomous_db_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_autonomous_db_versions_rest_unset_required_fields(): @@ -31402,7 +31320,7 @@ def test_list_autonomous_database_character_sets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_autonomous_database_character_sets_rest_unset_required_fields(): @@ -31681,7 +31599,7 @@ def test_list_autonomous_database_backups_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_autonomous_database_backups_rest_unset_required_fields(): @@ -31948,7 +31866,7 @@ def test_stop_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_stop_autonomous_database_rest_unset_required_fields(): @@ -32133,7 +32051,7 @@ def test_start_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_start_autonomous_database_rest_unset_required_fields(): @@ -32318,7 +32236,7 @@ def test_restart_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restart_autonomous_database_rest_unset_required_fields(): @@ -32509,7 +32427,7 @@ def test_switchover_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_switchover_autonomous_database_rest_unset_required_fields(): @@ -32712,7 +32630,7 @@ def test_failover_autonomous_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_failover_autonomous_database_rest_unset_required_fields(): @@ -32911,7 +32829,7 @@ def test_list_odb_networks_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_odb_networks_rest_unset_required_fields(): @@ -33162,7 +33080,7 @@ def test_get_odb_network_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_odb_network_rest_unset_required_fields(): @@ -33368,7 +33286,7 @@ def test_create_odb_network_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_odb_network_rest_unset_required_fields(): @@ -33569,7 +33487,7 @@ def test_delete_odb_network_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_odb_network_rest_unset_required_fields(): @@ -33758,7 +33676,7 @@ def test_list_odb_subnets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_odb_subnets_rest_unset_required_fields(): @@ -34011,7 +33929,7 @@ def test_get_odb_subnet_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_odb_subnet_rest_unset_required_fields(): @@ -34215,7 +34133,7 @@ def test_create_odb_subnet_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_odb_subnet_rest_unset_required_fields(): @@ -34416,7 +34334,7 @@ def test_delete_odb_subnet_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_odb_subnet_rest_unset_required_fields(): @@ -34608,7 +34526,7 @@ def test_list_exadb_vm_clusters_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_exadb_vm_clusters_rest_unset_required_fields(): @@ -34863,7 +34781,7 @@ def test_get_exadb_vm_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_exadb_vm_cluster_rest_unset_required_fields(): @@ -35070,7 +34988,7 @@ def test_create_exadb_vm_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_exadb_vm_cluster_rest_unset_required_fields(): @@ -35272,7 +35190,7 @@ def test_delete_exadb_vm_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_exadb_vm_cluster_rest_unset_required_fields(): @@ -35459,7 +35377,7 @@ def test_update_exadb_vm_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_exadb_vm_cluster_rest_unset_required_fields(): @@ -35664,7 +35582,7 @@ def test_remove_virtual_machine_exadb_vm_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_virtual_machine_exadb_vm_cluster_rest_unset_required_fields(): @@ -35874,7 +35792,7 @@ def test_list_exascale_db_storage_vaults_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_exascale_db_storage_vaults_rest_unset_required_fields(): @@ -36142,7 +36060,7 @@ def test_get_exascale_db_storage_vault_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_exascale_db_storage_vault_rest_unset_required_fields(): @@ -36357,7 +36275,7 @@ def test_create_exascale_db_storage_vault_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_exascale_db_storage_vault_rest_unset_required_fields(): @@ -36565,7 +36483,7 @@ def test_delete_exascale_db_storage_vault_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_exascale_db_storage_vault_rest_unset_required_fields(): @@ -36761,7 +36679,7 @@ def test_list_db_system_initial_storage_sizes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_db_system_initial_storage_sizes_rest_unset_required_fields(): @@ -37036,7 +36954,7 @@ def test_list_databases_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_databases_rest_unset_required_fields(): @@ -37281,7 +37199,7 @@ def test_get_database_rest_required_fields(request_type=database.GetDatabaseRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_database_rest_unset_required_fields(): @@ -37475,7 +37393,7 @@ def test_list_pluggable_databases_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_pluggable_databases_rest_unset_required_fields(): @@ -37733,7 +37651,7 @@ def test_get_pluggable_database_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_pluggable_database_rest_unset_required_fields(): @@ -37922,7 +37840,7 @@ def test_list_db_systems_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_db_systems_rest_unset_required_fields(): @@ -38168,7 +38086,7 @@ def test_get_db_system_rest_required_fields(request_type=db_system.GetDbSystemRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_db_system_rest_unset_required_fields(): @@ -38371,7 +38289,7 @@ def test_create_db_system_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_db_system_rest_unset_required_fields(): @@ -38569,7 +38487,7 @@ def test_delete_db_system_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_db_system_rest_unset_required_fields(): @@ -38756,7 +38674,7 @@ def test_list_db_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_db_versions_rest_unset_required_fields(): @@ -39018,7 +38936,7 @@ def test_list_database_character_sets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_database_character_sets_rest_unset_required_fields(): diff --git a/packages/google-cloud-orchestration-airflow/docs/conf.py b/packages/google-cloud-orchestration-airflow/docs/conf.py index 86e8b2bc94f1..a8cea9b847a4 100644 --- a/packages/google-cloud-orchestration-airflow/docs/conf.py +++ b/packages/google-cloud-orchestration-airflow/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-orchestration-airflow" -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-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/__init__.py b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/__init__.py index edf78e6a61c3..3ab93ea509a1 100644 --- a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/__init__.py +++ b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/__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. @@ -23,13 +23,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.environments import EnvironmentsAsyncClient, EnvironmentsClient from .services.image_versions import ImageVersionsAsyncClient, ImageVersionsClient @@ -111,28 +105,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.orchestration.airflow.service_v1" - 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-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py index 3cf30b7797f4..100ef1f0ffbc 100644 --- a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py +++ b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.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. @@ -342,11 +342,11 @@ async def sample_create_environment(): ) # Make the request - operation = client.create_environment(request=request) + operation = await client.create_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -711,11 +711,11 @@ async def sample_update_environment(): ) # Make the request - operation = client.update_environment(request=request) + operation = await client.update_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1027,11 +1027,11 @@ async def sample_delete_environment(): ) # Make the request - operation = client.delete_environment(request=request) + operation = await client.delete_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1553,11 +1553,11 @@ async def sample_check_upgrade(): ) # Make the request - operation = client.check_upgrade(request=request) + operation = await client.check_upgrade(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2860,11 +2860,11 @@ async def sample_save_snapshot(): ) # Make the request - operation = client.save_snapshot(request=request) + operation = await client.save_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2966,11 +2966,11 @@ async def sample_load_snapshot(): ) # Make the request - operation = client.load_snapshot(request=request) + operation = await client.load_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3069,11 +3069,11 @@ async def sample_database_failover(): ) # Make the request - operation = client.database_failover(request=request) + operation = await client.database_failover(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/types/environments.py b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/types/environments.py index ef82552c7761..09d6890f0100 100644 --- a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/types/environments.py +++ b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/types/environments.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. @@ -864,13 +864,10 @@ class UserWorkloadsSecret(proto.Message): Example: - .. code-block:: json - - { - "example": "ZXhhbXBsZV92YWx1ZQ==", - "another-example": "YW5vdGhlcl9leGFtcGxlX3ZhbHVl" - } - + { + "example": "ZXhhbXBsZV92YWx1ZQ==", + "another-example": + "YW5vdGhlcl9leGFtcGxlX3ZhbHVl" } """ name: str = proto.Field( diff --git a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/__init__.py b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/__init__.py index 8f30761936d0..c9c12c473dc2 100644 --- a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/__init__.py +++ b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/__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. @@ -23,13 +23,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.environments import EnvironmentsAsyncClient, EnvironmentsClient from .services.image_versions import ImageVersionsAsyncClient, ImageVersionsClient @@ -114,28 +108,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.orchestration.airflow.service_v1beta1" - 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-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py index 38714d2c2452..e35dda9dde97 100644 --- a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py +++ b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.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. @@ -347,11 +347,11 @@ async def sample_create_environment(): ) # Make the request - operation = client.create_environment(request=request) + operation = await client.create_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -716,11 +716,11 @@ async def sample_update_environment(): ) # Make the request - operation = client.update_environment(request=request) + operation = await client.update_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1067,11 +1067,11 @@ async def sample_delete_environment(): ) # Make the request - operation = client.delete_environment(request=request) + operation = await client.delete_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1198,11 +1198,11 @@ async def sample_restart_web_server(): ) # Make the request - operation = client.restart_web_server(request=request) + operation = await client.restart_web_server(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1300,11 +1300,11 @@ async def sample_check_upgrade(): ) # Make the request - operation = client.check_upgrade(request=request) + operation = await client.check_upgrade(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2998,11 +2998,11 @@ async def sample_save_snapshot(): ) # Make the request - operation = client.save_snapshot(request=request) + operation = await client.save_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3104,11 +3104,11 @@ async def sample_load_snapshot(): ) # Make the request - operation = client.load_snapshot(request=request) + operation = await client.load_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3207,11 +3207,11 @@ async def sample_database_failover(): ) # Make the request - operation = client.database_failover(request=request) + operation = await client.database_failover(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/types/environments.py b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/types/environments.py index 433e9626fd99..3d744da4e6e1 100644 --- a/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/types/environments.py +++ b/packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1beta1/types/environments.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. @@ -916,13 +916,10 @@ class UserWorkloadsSecret(proto.Message): Example: - .. code-block:: json - - { - "example": "ZXhhbXBsZV92YWx1ZQ==", - "another-example": "YW5vdGhlcl9leGFtcGxlX3ZhbHVl" - } - + { + "example": "ZXhhbXBsZV92YWx1ZQ==", + "another-example": + "YW5vdGhlcl9leGFtcGxlX3ZhbHVl" } """ name: str = proto.Field( diff --git a/packages/google-cloud-orchestration-airflow/noxfile.py b/packages/google-cloud-orchestration-airflow/noxfile.py index cbdfd79f5f5e..84efea4af9e5 100644 --- a/packages/google-cloud-orchestration-airflow/noxfile.py +++ b/packages/google-cloud-orchestration-airflow/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", @@ -390,7 +389,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-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_check_upgrade_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_check_upgrade_async.py index c2a3b41878e5..7d425094f5f7 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_check_upgrade_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_check_upgrade_async.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. @@ -44,11 +44,11 @@ async def sample_check_upgrade(): ) # Make the request - operation = client.check_upgrade(request=request) + operation = await client.check_upgrade(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py index 9aa25df1b7dc..6f32a359a076 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_create_environment_async.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. @@ -42,11 +42,11 @@ async def sample_create_environment(): request = service_v1.CreateEnvironmentRequest() # Make the request - operation = client.create_environment(request=request) + operation = await client.create_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_database_failover_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_database_failover_async.py index 006b757e9bc5..3226a4b3b485 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_database_failover_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_database_failover_async.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. @@ -42,11 +42,11 @@ async def sample_database_failover(): request = service_v1.DatabaseFailoverRequest() # Make the request - operation = client.database_failover(request=request) + operation = await client.database_failover(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py index a2aefe3770fe..f1b667937772 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.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. @@ -42,11 +42,11 @@ async def sample_delete_environment(): request = service_v1.DeleteEnvironmentRequest() # Make the request - operation = client.delete_environment(request=request) + operation = await client.delete_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py index 1fdb72a84075..d26d89cd6f02 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.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. @@ -42,11 +42,11 @@ async def sample_load_snapshot(): request = service_v1.LoadSnapshotRequest() # Make the request - operation = client.load_snapshot(request=request) + operation = await client.load_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py index 4a3b5a375370..de156d942ec5 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.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. @@ -42,11 +42,11 @@ async def sample_save_snapshot(): request = service_v1.SaveSnapshotRequest() # Make the request - operation = client.save_snapshot(request=request) + operation = await client.save_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py index 85aef2ebe6cb..5361e788904d 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1_generated_environments_update_environment_async.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. @@ -42,11 +42,11 @@ async def sample_update_environment(): request = service_v1.UpdateEnvironmentRequest() # Make the request - operation = client.update_environment(request=request) + operation = await client.update_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py index 0d18f157e5c0..18415ebcf2fc 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.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. @@ -42,11 +42,11 @@ async def sample_check_upgrade(): request = service_v1beta1.CheckUpgradeRequest() # Make the request - operation = client.check_upgrade(request=request) + operation = await client.check_upgrade(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py index a06ba73b633b..80cac62ed7a0 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.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. @@ -42,11 +42,11 @@ async def sample_create_environment(): request = service_v1beta1.CreateEnvironmentRequest() # Make the request - operation = client.create_environment(request=request) + operation = await client.create_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_database_failover_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_database_failover_async.py index 16a14aa81673..98659e8d5a69 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_database_failover_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_database_failover_async.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. @@ -42,11 +42,11 @@ async def sample_database_failover(): request = service_v1beta1.DatabaseFailoverRequest() # Make the request - operation = client.database_failover(request=request) + operation = await client.database_failover(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py index 9b931e754b7d..4af66eb7c53f 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.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. @@ -42,11 +42,11 @@ async def sample_delete_environment(): request = service_v1beta1.DeleteEnvironmentRequest() # Make the request - operation = client.delete_environment(request=request) + operation = await client.delete_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py index a802e4ca202d..c9b11d381721 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.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. @@ -42,11 +42,11 @@ async def sample_load_snapshot(): request = service_v1beta1.LoadSnapshotRequest() # Make the request - operation = client.load_snapshot(request=request) + operation = await client.load_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py index 36c28844c3fe..8c466fb835a6 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.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. @@ -42,11 +42,11 @@ async def sample_restart_web_server(): request = service_v1beta1.RestartWebServerRequest() # Make the request - operation = client.restart_web_server(request=request) + operation = await client.restart_web_server(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py index 30b59f1ffb85..c05f9dd10a38 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.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. @@ -42,11 +42,11 @@ async def sample_save_snapshot(): request = service_v1beta1.SaveSnapshotRequest() # Make the request - operation = client.save_snapshot(request=request) + operation = await client.save_snapshot(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py index 014385362ace..7595dc6e3d83 100644 --- a/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py +++ b/packages/google-cloud-orchestration-airflow/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.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. @@ -42,11 +42,11 @@ async def sample_update_environment(): request = service_v1beta1.UpdateEnvironmentRequest() # Make the request - operation = client.update_environment(request=request) + operation = await client.update_environment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-orchestration-airflow/setup.py b/packages/google-cloud-orchestration-airflow/setup.py index ec873f2838e7..0bed24c62919 100644 --- a/packages/google-cloud-orchestration-airflow/setup.py +++ b/packages/google-cloud-orchestration-airflow/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. @@ -43,11 +43,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -75,7 +75,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, @@ -83,7 +83,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", @@ -94,7 +93,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-orchestration-airflow/testing/constraints-3.10.txt b/packages/google-cloud-orchestration-airflow/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-orchestration-airflow/testing/constraints-3.10.txt +++ b/packages/google-cloud-orchestration-airflow/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-orchestration-airflow/testing/constraints-3.9.txt b/packages/google-cloud-orchestration-airflow/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-orchestration-airflow/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_environments.py b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_environments.py index cf0d445f87d8..8c09f93b4ee4 100644 --- a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_environments.py +++ b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_environments.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2525,11 +2519,7 @@ async def test_list_environments_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_environments(request={}) - ).pages: + async for page_ in (await client.list_environments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4561,11 +4551,7 @@ async def test_list_workloads_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_workloads(request={}) - ).pages: + async for page_ in (await client.list_workloads(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6053,11 +6039,7 @@ async def test_list_user_workloads_secrets_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_user_workloads_secrets(request={}) - ).pages: + async for page_ in (await client.list_user_workloads_secrets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7978,9 +7960,7 @@ async def test_list_user_workloads_config_maps_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 + async for page_ in ( await client.list_user_workloads_config_maps(request={}) ).pages: pages.append(page_) @@ -10484,7 +10464,7 @@ def test_list_workloads_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_workloads_rest_unset_required_fields(): @@ -10743,7 +10723,7 @@ def test_check_upgrade_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_check_upgrade_rest_unset_required_fields(): @@ -10869,7 +10849,7 @@ def test_create_user_workloads_secret_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_workloads_secret_rest_unset_required_fields(): @@ -11064,7 +11044,7 @@ def test_get_user_workloads_secret_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_workloads_secret_rest_unset_required_fields(): @@ -11258,7 +11238,7 @@ def test_list_user_workloads_secrets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_user_workloads_secrets_rest_unset_required_fields(): @@ -11616,7 +11596,7 @@ def test_delete_user_workloads_secret_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_workloads_secret_rest_unset_required_fields(): @@ -11800,7 +11780,7 @@ def test_create_user_workloads_config_map_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_workloads_config_map_rest_unset_required_fields(): @@ -12001,7 +11981,7 @@ def test_get_user_workloads_config_map_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_workloads_config_map_rest_unset_required_fields(): @@ -12197,7 +12177,7 @@ def test_list_user_workloads_config_maps_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_user_workloads_config_maps_rest_unset_required_fields(): @@ -12564,7 +12544,7 @@ def test_delete_user_workloads_config_map_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_workloads_config_map_rest_unset_required_fields(): @@ -12871,7 +12851,7 @@ def test_fetch_database_properties_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_fetch_database_properties_rest_unset_required_fields(): diff --git a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_image_versions.py b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_image_versions.py index 9b637f9a37ea..12fc0c8aa761 100644 --- a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_image_versions.py +++ b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1/test_image_versions.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1846,11 +1840,7 @@ async def test_list_image_versions_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_image_versions(request={}) - ).pages: + async for page_ in (await client.list_image_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_environments.py b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_environments.py index 4c6a8e63d1b9..938564b6e3e6 100644 --- a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_environments.py +++ b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_environments.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2528,11 +2522,7 @@ async def test_list_environments_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_environments(request={}) - ).pages: + async for page_ in (await client.list_environments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5070,11 +5060,7 @@ async def test_list_workloads_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_workloads(request={}) - ).pages: + async for page_ in (await client.list_workloads(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6315,11 +6301,7 @@ async def test_list_user_workloads_secrets_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_user_workloads_secrets(request={}) - ).pages: + async for page_ in (await client.list_user_workloads_secrets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8240,9 +8222,7 @@ async def test_list_user_workloads_config_maps_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 + async for page_ in ( await client.list_user_workloads_config_maps(request={}) ).pages: pages.append(page_) @@ -10412,7 +10392,7 @@ def test_update_environment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_environment_rest_unset_required_fields(): @@ -10909,7 +10889,7 @@ def test_list_workloads_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_workloads_rest_unset_required_fields(): @@ -11172,7 +11152,7 @@ def test_create_user_workloads_secret_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_workloads_secret_rest_unset_required_fields(): @@ -11367,7 +11347,7 @@ def test_get_user_workloads_secret_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_workloads_secret_rest_unset_required_fields(): @@ -11561,7 +11541,7 @@ def test_list_user_workloads_secrets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_user_workloads_secrets_rest_unset_required_fields(): @@ -11919,7 +11899,7 @@ def test_delete_user_workloads_secret_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_workloads_secret_rest_unset_required_fields(): @@ -12103,7 +12083,7 @@ def test_create_user_workloads_config_map_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_workloads_config_map_rest_unset_required_fields(): @@ -12304,7 +12284,7 @@ def test_get_user_workloads_config_map_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_workloads_config_map_rest_unset_required_fields(): @@ -12500,7 +12480,7 @@ def test_list_user_workloads_config_maps_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_user_workloads_config_maps_rest_unset_required_fields(): @@ -12867,7 +12847,7 @@ def test_delete_user_workloads_config_map_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_workloads_config_map_rest_unset_required_fields(): @@ -13174,7 +13154,7 @@ def test_fetch_database_properties_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_fetch_database_properties_rest_unset_required_fields(): diff --git a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_image_versions.py b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_image_versions.py index 2f8631afb66c..e79e7c090809 100644 --- a/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_image_versions.py +++ b/packages/google-cloud-orchestration-airflow/tests/unit/gapic/service_v1beta1/test_image_versions.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1846,11 +1840,7 @@ async def test_list_image_versions_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_image_versions(request={}) - ).pages: + async for page_ in (await client.list_image_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-org-policy/docs/conf.py b/packages/google-cloud-org-policy/docs/conf.py index 83e9691506ca..d1ef1a7f7a2d 100644 --- a/packages/google-cloud-org-policy/docs/conf.py +++ b/packages/google-cloud-org-policy/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-org-policy" -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-org-policy/google/cloud/orgpolicy_v2/__init__.py b/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/__init__.py index 756b3bf983db..ee3ed8b4ed24 100644 --- a/packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/__init__.py +++ b/packages/google-cloud-org-policy/google/cloud/orgpolicy_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.org_policy import OrgPolicyAsyncClient, OrgPolicyClient from .types.constraint import Constraint, CustomConstraint @@ -61,28 +55,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.orgpolicy_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-org-policy/noxfile.py b/packages/google-cloud-org-policy/noxfile.py index 8afd34103100..a5fb2f43b0e9 100644 --- a/packages/google-cloud-org-policy/noxfile.py +++ b/packages/google-cloud-org-policy/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", @@ -390,7 +389,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-org-policy/setup.py b/packages/google-cloud-org-policy/setup.py index bb0b23938087..9b947ac38359 100644 --- a/packages/google-cloud-org-policy/setup.py +++ b/packages/google-cloud-org-policy/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. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,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, @@ -79,7 +79,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", @@ -90,7 +89,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-org-policy/testing/constraints-3.10.txt b/packages/google-cloud-org-policy/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-org-policy/testing/constraints-3.10.txt +++ b/packages/google-cloud-org-policy/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-org-policy/testing/constraints-3.9.txt b/packages/google-cloud-org-policy/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-org-policy/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-org-policy/tests/unit/gapic/orgpolicy_v2/test_org_policy.py b/packages/google-cloud-org-policy/tests/unit/gapic/orgpolicy_v2/test_org_policy.py index d765594ee776..9dcbd3a88ec7 100644 --- a/packages/google-cloud-org-policy/tests/unit/gapic/orgpolicy_v2/test_org_policy.py +++ b/packages/google-cloud-org-policy/tests/unit/gapic/orgpolicy_v2/test_org_policy.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1784,11 +1778,7 @@ async def test_list_constraints_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_constraints(request={}) - ).pages: + async for page_ in (await client.list_constraints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2303,11 +2293,7 @@ async def test_list_policies_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_policies(request={}) - ).pages: + async for page_ in (await client.list_policies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5582,11 +5568,7 @@ async def test_list_custom_constraints_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_custom_constraints(request={}) - ).pages: + async for page_ in (await client.list_custom_constraints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6040,7 +6022,7 @@ def test_list_constraints_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_constraints_rest_unset_required_fields(): @@ -6290,7 +6272,7 @@ def test_list_policies_rest_required_fields(request_type=orgpolicy.ListPoliciesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_policies_rest_unset_required_fields(): @@ -6533,7 +6515,7 @@ def test_get_policy_rest_required_fields(request_type=orgpolicy.GetPolicyRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_policy_rest_unset_required_fields(): @@ -6713,7 +6695,7 @@ def test_get_effective_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_effective_policy_rest_unset_required_fields(): @@ -6890,7 +6872,7 @@ def test_create_policy_rest_required_fields(request_type=orgpolicy.CreatePolicyR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_policy_rest_unset_required_fields(): @@ -7072,7 +7054,7 @@ def test_update_policy_rest_required_fields(request_type=orgpolicy.UpdatePolicyR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_policy_rest_unset_required_fields(): @@ -7246,7 +7228,7 @@ def test_delete_policy_rest_required_fields(request_type=orgpolicy.DeletePolicyR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_policy_rest_unset_required_fields(): @@ -7426,7 +7408,7 @@ def test_create_custom_constraint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_custom_constraint_rest_unset_required_fields(): @@ -7614,7 +7596,7 @@ def test_update_custom_constraint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_custom_constraint_rest_unset_required_fields(): @@ -7801,7 +7783,7 @@ def test_get_custom_constraint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_custom_constraint_rest_unset_required_fields(): @@ -7990,7 +7972,7 @@ def test_list_custom_constraints_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_custom_constraints_rest_unset_required_fields(): @@ -8240,7 +8222,7 @@ def test_delete_custom_constraint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_custom_constraint_rest_unset_required_fields(): diff --git a/packages/google-cloud-os-config/docs/conf.py b/packages/google-cloud-os-config/docs/conf.py index a4e9f0998e9a..775db0b9fcb9 100644 --- a/packages/google-cloud-os-config/docs/conf.py +++ b/packages/google-cloud-os-config/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-os-config" -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-os-config/google/cloud/osconfig_v1/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/__init__.py index 6b19961d3493..f424f56097a1 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/__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.os_config_service import ( OsConfigServiceAsyncClient, @@ -120,28 +114,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.osconfig_v1" - 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-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py index 7ecbdc5836c5..fb553a8df42d 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.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. @@ -398,11 +398,11 @@ async def sample_create_os_policy_assignment(): ) # Make the request - operation = client.create_os_policy_assignment(request=request) + operation = await client.create_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -581,11 +581,11 @@ async def sample_update_os_policy_assignment(): ) # Make the request - operation = client.update_os_policy_assignment(request=request) + operation = await client.update_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1137,11 +1137,11 @@ async def sample_delete_os_policy_assignment(): ) # Make the request - operation = client.delete_os_policy_assignment(request=request) + operation = await client.delete_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py index b4d277d3d51f..a3fb0b49b4a6 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__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.os_config_zonal_service import ( OsConfigZonalServiceAsyncClient, @@ -88,28 +82,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.osconfig_v1alpha" - 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-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py index 05e3fd4daa06..df62f97bdb50 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.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. @@ -407,11 +407,11 @@ async def sample_create_os_policy_assignment(): ) # Make the request - operation = client.create_os_policy_assignment(request=request) + operation = await client.create_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -590,11 +590,11 @@ async def sample_update_os_policy_assignment(): ) # Make the request - operation = client.update_os_policy_assignment(request=request) + operation = await client.update_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1146,11 +1146,11 @@ async def sample_delete_os_policy_assignment(): ) # Make the request - operation = client.delete_os_policy_assignment(request=request) + operation = await client.delete_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/noxfile.py b/packages/google-cloud-os-config/noxfile.py index 6c6b02e6d5e2..a770b6a19a30 100644 --- a/packages/google-cloud-os-config/noxfile.py +++ b/packages/google-cloud-os-config/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", @@ -390,7 +389,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-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py index f3361ae7d976..c14535fbfe47 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.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,11 +58,11 @@ async def sample_create_os_policy_assignment(): ) # Make the request - operation = client.create_os_policy_assignment(request=request) + operation = await client.create_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py index 3986c1e68f57..9d42fbac42cb 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.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. @@ -44,11 +44,11 @@ async def sample_delete_os_policy_assignment(): ) # Make the request - operation = client.delete_os_policy_assignment(request=request) + operation = await client.delete_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py index 99c1714b2e7e..fce617b76500 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.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. @@ -56,11 +56,11 @@ async def sample_update_os_policy_assignment(): ) # Make the request - operation = client.update_os_policy_assignment(request=request) + operation = await client.update_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py index 6698baa11180..d5c3d6501862 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.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,11 +58,11 @@ async def sample_create_os_policy_assignment(): ) # Make the request - operation = client.create_os_policy_assignment(request=request) + operation = await client.create_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py index b9f0a30e7910..10f18bc9c5df 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.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. @@ -44,11 +44,11 @@ async def sample_delete_os_policy_assignment(): ) # Make the request - operation = client.delete_os_policy_assignment(request=request) + operation = await client.delete_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py index 5bfc5563835c..ffaadca6d20a 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.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. @@ -56,11 +56,11 @@ async def sample_update_os_policy_assignment(): ) # Make the request - operation = client.update_os_policy_assignment(request=request) + operation = await client.update_os_policy_assignment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-os-config/setup.py b/packages/google-cloud-os-config/setup.py index dac80c47202f..45956481bb8b 100644 --- a/packages/google-cloud-os-config/setup.py +++ b/packages/google-cloud-os-config/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. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,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, @@ -79,7 +79,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", @@ -90,7 +89,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-os-config/testing/constraints-3.10.txt b/packages/google-cloud-os-config/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-os-config/testing/constraints-3.10.txt +++ b/packages/google-cloud-os-config/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-os-config/testing/constraints-3.9.txt b/packages/google-cloud-os-config/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-os-config/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py index 2a0a5a9def7a..a386ddc4cef7 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2757,11 +2751,7 @@ async def test_list_patch_jobs_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_patch_jobs(request={}) - ).pages: + async for page_ in (await client.list_patch_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3308,9 +3298,7 @@ async def test_list_patch_job_instance_details_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 + async for page_ in ( await client.list_patch_job_instance_details(request={}) ).pages: pages.append(page_) @@ -4578,11 +4566,7 @@ async def test_list_patch_deployments_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_patch_deployments(request={}) - ).pages: + async for page_ in (await client.list_patch_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6089,7 +6073,7 @@ def test_execute_patch_job_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_execute_patch_job_rest_unset_required_fields(): @@ -6215,7 +6199,7 @@ def test_get_patch_job_rest_required_fields(request_type=patch_jobs.GetPatchJobR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_patch_job_rest_unset_required_fields(): @@ -6394,7 +6378,7 @@ def test_cancel_patch_job_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_cancel_patch_job_rest_unset_required_fields(): @@ -6522,7 +6506,7 @@ def test_list_patch_jobs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_patch_jobs_rest_unset_required_fields(): @@ -6783,7 +6767,7 @@ def test_list_patch_job_instance_details_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_patch_job_instance_details_rest_unset_required_fields(): @@ -7058,7 +7042,7 @@ def test_create_patch_deployment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_patch_deployment_rest_unset_required_fields(): @@ -7252,7 +7236,7 @@ def test_get_patch_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_patch_deployment_rest_unset_required_fields(): @@ -7443,7 +7427,7 @@ def test_list_patch_deployments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_patch_deployments_rest_unset_required_fields(): @@ -7693,7 +7677,7 @@ def test_delete_patch_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_patch_deployment_rest_unset_required_fields(): @@ -7871,7 +7855,7 @@ def test_update_patch_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_patch_deployment_rest_unset_required_fields(): @@ -8059,7 +8043,7 @@ def test_pause_patch_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_pause_patch_deployment_rest_unset_required_fields(): @@ -8242,7 +8226,7 @@ def test_resume_patch_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_resume_patch_deployment_rest_unset_required_fields(): diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py index 3a7e8c7b3381..f4a163b42587 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3051,11 +3045,7 @@ async def test_list_os_policy_assignments_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_os_policy_assignments(request={}) - ).pages: + async for page_ in (await client.list_os_policy_assignments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3612,9 +3602,7 @@ async def test_list_os_policy_assignment_revisions_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 + async for page_ in ( await client.list_os_policy_assignment_revisions(request={}) ).pages: pages.append(page_) @@ -4883,9 +4871,7 @@ async def test_list_os_policy_assignment_reports_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 + async for page_ in ( await client.list_os_policy_assignment_reports(request={}) ).pages: pages.append(page_) @@ -5725,11 +5711,7 @@ async def test_list_inventories_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_inventories(request={}) - ).pages: + async for page_ in (await client.list_inventories(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6629,11 +6611,7 @@ async def test_list_vulnerability_reports_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_vulnerability_reports(request={}) - ).pages: + async for page_ in (await client.list_vulnerability_reports(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6772,7 +6750,7 @@ def test_create_os_policy_assignment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_os_policy_assignment_rest_unset_required_fields(): @@ -6969,7 +6947,7 @@ def test_update_os_policy_assignment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_os_policy_assignment_rest_unset_required_fields(): @@ -7160,7 +7138,7 @@ def test_get_os_policy_assignment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_os_policy_assignment_rest_unset_required_fields(): @@ -7354,7 +7332,7 @@ def test_list_os_policy_assignments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_os_policy_assignments_rest_unset_required_fields(): @@ -7624,7 +7602,7 @@ def test_list_os_policy_assignment_revisions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_os_policy_assignment_revisions_rest_unset_required_fields(): @@ -7894,7 +7872,7 @@ def test_delete_os_policy_assignment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_os_policy_assignment_rest_unset_required_fields(): @@ -8079,7 +8057,7 @@ def test_get_os_policy_assignment_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_os_policy_assignment_report_rest_unset_required_fields(): @@ -8280,7 +8258,7 @@ def test_list_os_policy_assignment_reports_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_os_policy_assignment_reports_rest_unset_required_fields(): @@ -8552,7 +8530,7 @@ def test_get_inventory_rest_required_fields(request_type=inventory.GetInventoryR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_inventory_rest_unset_required_fields(): @@ -8743,7 +8721,7 @@ def test_list_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_inventories_rest_unset_required_fields(): @@ -9001,7 +8979,7 @@ def test_get_vulnerability_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_vulnerability_report_rest_unset_required_fields(): @@ -9196,7 +9174,7 @@ def test_list_vulnerability_reports_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_vulnerability_reports_rest_unset_required_fields(): diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py index a06ec639e6d2..4800cc0c6146 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3053,11 +3047,7 @@ async def test_list_os_policy_assignments_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_os_policy_assignments(request={}) - ).pages: + async for page_ in (await client.list_os_policy_assignments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3614,9 +3604,7 @@ async def test_list_os_policy_assignment_revisions_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 + async for page_ in ( await client.list_os_policy_assignment_revisions(request={}) ).pages: pages.append(page_) @@ -4913,9 +4901,7 @@ async def test_list_instance_os_policies_compliances_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 + async for page_ in ( await client.list_instance_os_policies_compliances(request={}) ).pages: pages.append(page_) @@ -5837,9 +5823,7 @@ async def test_list_os_policy_assignment_reports_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 + async for page_ in ( await client.list_os_policy_assignment_reports(request={}) ).pages: pages.append(page_) @@ -6679,11 +6663,7 @@ async def test_list_inventories_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_inventories(request={}) - ).pages: + async for page_ in (await client.list_inventories(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7573,11 +7553,7 @@ async def test_list_vulnerability_reports_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_vulnerability_reports(request={}) - ).pages: + async for page_ in (await client.list_vulnerability_reports(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7716,7 +7692,7 @@ def test_create_os_policy_assignment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_os_policy_assignment_rest_unset_required_fields(): @@ -7913,7 +7889,7 @@ def test_update_os_policy_assignment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_os_policy_assignment_rest_unset_required_fields(): @@ -8104,7 +8080,7 @@ def test_get_os_policy_assignment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_os_policy_assignment_rest_unset_required_fields(): @@ -8298,7 +8274,7 @@ def test_list_os_policy_assignments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_os_policy_assignments_rest_unset_required_fields(): @@ -8568,7 +8544,7 @@ def test_list_os_policy_assignment_revisions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_os_policy_assignment_revisions_rest_unset_required_fields(): @@ -8838,7 +8814,7 @@ def test_delete_os_policy_assignment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_os_policy_assignment_rest_unset_required_fields(): @@ -9025,7 +9001,7 @@ def test_get_instance_os_policies_compliance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_os_policies_compliance_rest_unset_required_fields(): @@ -9232,7 +9208,7 @@ def test_list_instance_os_policies_compliances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instance_os_policies_compliances_rest_unset_required_fields(): @@ -9505,7 +9481,7 @@ def test_get_os_policy_assignment_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_os_policy_assignment_report_rest_unset_required_fields(): @@ -9706,7 +9682,7 @@ def test_list_os_policy_assignment_reports_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_os_policy_assignment_reports_rest_unset_required_fields(): @@ -9978,7 +9954,7 @@ def test_get_inventory_rest_required_fields(request_type=inventory.GetInventoryR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_inventory_rest_unset_required_fields(): @@ -10169,7 +10145,7 @@ def test_list_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_inventories_rest_unset_required_fields(): @@ -10427,7 +10403,7 @@ def test_get_vulnerability_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_vulnerability_report_rest_unset_required_fields(): @@ -10622,7 +10598,7 @@ def test_list_vulnerability_reports_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_vulnerability_reports_rest_unset_required_fields(): diff --git a/packages/google-cloud-os-login/docs/conf.py b/packages/google-cloud-os-login/docs/conf.py index 15ef5ab843ba..aa5f00ce4c85 100644 --- a/packages/google-cloud-os-login/docs/conf.py +++ b/packages/google-cloud-os-login/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-os-login" -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-os-login/google/cloud/oslogin_v1/__init__.py b/packages/google-cloud-os-login/google/cloud/oslogin_v1/__init__.py index ffca22fbc5c7..5d0a9a28e8a3 100644 --- a/packages/google-cloud-os-login/google/cloud/oslogin_v1/__init__.py +++ b/packages/google-cloud-os-login/google/cloud/oslogin_v1/__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.os_login_service import OsLoginServiceAsyncClient, OsLoginServiceClient from .types.oslogin import ( @@ -51,28 +45,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.oslogin_v1" - 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-os-login/noxfile.py b/packages/google-cloud-os-login/noxfile.py index f42daa9efda7..1571d448bdeb 100644 --- a/packages/google-cloud-os-login/noxfile.py +++ b/packages/google-cloud-os-login/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", @@ -390,7 +389,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-os-login/setup.py b/packages/google-cloud-os-login/setup.py index e0422b5c6e3e..188ecca9e3ac 100644 --- a/packages/google-cloud-os-login/setup.py +++ b/packages/google-cloud-os-login/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. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,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, @@ -79,7 +79,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", @@ -90,7 +89,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-os-login/testing/constraints-3.10.txt b/packages/google-cloud-os-login/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-os-login/testing/constraints-3.10.txt +++ b/packages/google-cloud-os-login/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-os-login/testing/constraints-3.9.txt b/packages/google-cloud-os-login/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-os-login/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-os-login/tests/unit/gapic/oslogin_v1/test_os_login_service.py b/packages/google-cloud-os-login/tests/unit/gapic/oslogin_v1/test_os_login_service.py index 2aa92b2c69b8..a18dd9bd4b2d 100644 --- a/packages/google-cloud-os-login/tests/unit/gapic/oslogin_v1/test_os_login_service.py +++ b/packages/google-cloud-os-login/tests/unit/gapic/oslogin_v1/test_os_login_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3882,7 +3876,7 @@ def test_create_ssh_public_key_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_ssh_public_key_rest_unset_required_fields(): @@ -4069,7 +4063,7 @@ def test_delete_posix_account_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_posix_account_rest_unset_required_fields(): @@ -4245,7 +4239,7 @@ def test_delete_ssh_public_key_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_ssh_public_key_rest_unset_required_fields(): @@ -4428,7 +4422,7 @@ def test_get_login_profile_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_login_profile_rest_unset_required_fields(): @@ -4616,7 +4610,7 @@ def test_get_ssh_public_key_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_ssh_public_key_rest_unset_required_fields(): @@ -4805,7 +4799,7 @@ def test_import_ssh_public_key_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_ssh_public_key_rest_unset_required_fields(): @@ -5002,7 +4996,7 @@ def test_update_ssh_public_key_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_ssh_public_key_rest_unset_required_fields(): diff --git a/packages/google-cloud-parallelstore/docs/conf.py b/packages/google-cloud-parallelstore/docs/conf.py index d1b1c6b6674f..6798d660e059 100644 --- a/packages/google-cloud-parallelstore/docs/conf.py +++ b/packages/google-cloud-parallelstore/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-parallelstore" -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-parallelstore/google/cloud/parallelstore_v1/__init__.py b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1/__init__.py index 68aeb32b5454..48484f52d23a 100644 --- a/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1/__init__.py +++ b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1/__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.parallelstore import ParallelstoreAsyncClient, ParallelstoreClient from .types.parallelstore import ( @@ -69,28 +63,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.parallelstore_v1" - 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-parallelstore/google/cloud/parallelstore_v1/services/parallelstore/async_client.py b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1/services/parallelstore/async_client.py index 9979f7576c5a..c8e521e4f791 100644 --- a/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1/services/parallelstore/async_client.py +++ b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1/services/parallelstore/async_client.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. @@ -607,11 +607,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -760,11 +760,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -898,11 +898,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1031,11 +1031,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1137,11 +1137,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/__init__.py b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/__init__.py index e9c4db31b52c..b3ecc0ef887e 100644 --- a/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/__init__.py +++ b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/__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.parallelstore import ParallelstoreAsyncClient, ParallelstoreClient from .types.parallelstore import ( @@ -69,28 +63,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.parallelstore_v1beta" - 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-parallelstore/google/cloud/parallelstore_v1beta/services/parallelstore/async_client.py b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/services/parallelstore/async_client.py index 600aef64978b..6500e74bf561 100644 --- a/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/services/parallelstore/async_client.py +++ b/packages/google-cloud-parallelstore/google/cloud/parallelstore_v1beta/services/parallelstore/async_client.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. @@ -607,11 +607,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -760,11 +760,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -898,11 +898,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1031,11 +1031,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1137,11 +1137,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/noxfile.py b/packages/google-cloud-parallelstore/noxfile.py index e674b4465a20..d4e606bf65de 100644 --- a/packages/google-cloud-parallelstore/noxfile.py +++ b/packages/google-cloud-parallelstore/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", @@ -390,7 +389,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-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_create_instance_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_create_instance_async.py index 21ffc326aadb..6ef7852df70c 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_create_instance_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_create_instance_async.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. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_delete_instance_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_delete_instance_async.py index 5996dd6fd75e..996ee9cf3f8e 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_delete_instance_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_delete_instance_async.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. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_export_data_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_export_data_async.py index 58113de9cf88..644ef8f05aff 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_export_data_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_export_data_async.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. @@ -48,11 +48,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_import_data_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_import_data_async.py index 3af0f6bcf5cf..5f08336dd153 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_import_data_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_import_data_async.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. @@ -48,11 +48,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_update_instance_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_update_instance_async.py index 03f7dd244d52..aefb3ca8f002 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_update_instance_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1_generated_parallelstore_update_instance_async.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. @@ -47,11 +47,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_create_instance_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_create_instance_async.py index ef485a11b356..ac4163cfb323 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_create_instance_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_create_instance_async.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. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_delete_instance_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_delete_instance_async.py index 00fd2f7b8073..8fa19959dfe3 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_delete_instance_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_delete_instance_async.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. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_export_data_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_export_data_async.py index 592c817bc93e..573259b5d0cf 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_export_data_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_export_data_async.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. @@ -48,11 +48,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_import_data_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_import_data_async.py index 28c7bf8abdd3..45a1f38b1610 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_import_data_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_import_data_async.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. @@ -48,11 +48,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_update_instance_async.py b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_update_instance_async.py index 89d8276f86e8..6c470ec4d676 100644 --- a/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_update_instance_async.py +++ b/packages/google-cloud-parallelstore/samples/generated_samples/parallelstore_v1beta_generated_parallelstore_update_instance_async.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. @@ -47,11 +47,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-parallelstore/setup.py b/packages/google-cloud-parallelstore/setup.py index 297187013127..aaefe74f8778 100644 --- a/packages/google-cloud-parallelstore/setup.py +++ b/packages/google-cloud-parallelstore/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-parallelstore/testing/constraints-3.10.txt b/packages/google-cloud-parallelstore/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-parallelstore/testing/constraints-3.10.txt +++ b/packages/google-cloud-parallelstore/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-parallelstore/testing/constraints-3.9.txt b/packages/google-cloud-parallelstore/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-parallelstore/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1/test_parallelstore.py b/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1/test_parallelstore.py index 1baab3ebf0c6..9d733cf54d82 100644 --- a/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1/test_parallelstore.py +++ b/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1/test_parallelstore.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1835,11 +1829,7 @@ async def test_list_instances_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_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3852,7 +3842,7 @@ def test_list_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -4102,7 +4092,7 @@ def test_get_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -4303,7 +4293,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -4500,7 +4490,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -4696,7 +4686,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -4873,7 +4863,7 @@ def test_import_data_rest_required_fields(request_type=parallelstore.ImportDataR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_data_rest_unset_required_fields(): @@ -4993,7 +4983,7 @@ def test_export_data_rest_required_fields(request_type=parallelstore.ExportDataR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_data_rest_unset_required_fields(): diff --git a/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1beta/test_parallelstore.py b/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1beta/test_parallelstore.py index 40e2c5426705..8997900909e5 100644 --- a/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1beta/test_parallelstore.py +++ b/packages/google-cloud-parallelstore/tests/unit/gapic/parallelstore_v1beta/test_parallelstore.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1835,11 +1829,7 @@ async def test_list_instances_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_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3852,7 +3842,7 @@ def test_list_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -4103,7 +4093,7 @@ def test_get_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -4305,7 +4295,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -4503,7 +4493,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -4699,7 +4689,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -4877,7 +4867,7 @@ def test_import_data_rest_required_fields(request_type=parallelstore.ImportDataR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_data_rest_unset_required_fields(): @@ -4997,7 +4987,7 @@ def test_export_data_rest_required_fields(request_type=parallelstore.ExportDataR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_data_rest_unset_required_fields(): diff --git a/packages/google-cloud-parametermanager/docs/conf.py b/packages/google-cloud-parametermanager/docs/conf.py index 3222a66e4773..554a4a4738d2 100644 --- a/packages/google-cloud-parametermanager/docs/conf.py +++ b/packages/google-cloud-parametermanager/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-parametermanager" -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-parametermanager/google/cloud/parametermanager_v1/__init__.py b/packages/google-cloud-parametermanager/google/cloud/parametermanager_v1/__init__.py index 57bdd5d81faa..0b52a17d3b34 100644 --- a/packages/google-cloud-parametermanager/google/cloud/parametermanager_v1/__init__.py +++ b/packages/google-cloud-parametermanager/google/cloud/parametermanager_v1/__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.parameter_manager import ( ParameterManagerAsyncClient, @@ -64,28 +58,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.parametermanager_v1" - 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-parametermanager/noxfile.py b/packages/google-cloud-parametermanager/noxfile.py index 1c1ba6092777..024e5cfe215a 100644 --- a/packages/google-cloud-parametermanager/noxfile.py +++ b/packages/google-cloud-parametermanager/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", @@ -390,7 +389,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-parametermanager/setup.py b/packages/google-cloud-parametermanager/setup.py index 95c17c53d242..9c0edc013487 100644 --- a/packages/google-cloud-parametermanager/setup.py +++ b/packages/google-cloud-parametermanager/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +74,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, @@ -82,7 +82,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", @@ -93,7 +92,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-parametermanager/testing/constraints-3.10.txt b/packages/google-cloud-parametermanager/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-parametermanager/testing/constraints-3.10.txt +++ b/packages/google-cloud-parametermanager/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# 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-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 diff --git a/packages/google-cloud-parametermanager/testing/constraints-3.9.txt b/packages/google-cloud-parametermanager/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-parametermanager/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-parametermanager/tests/unit/gapic/parametermanager_v1/test_parameter_manager.py b/packages/google-cloud-parametermanager/tests/unit/gapic/parametermanager_v1/test_parameter_manager.py index 4dad16d6db45..12b5ca3b6645 100644 --- a/packages/google-cloud-parametermanager/tests/unit/gapic/parametermanager_v1/test_parameter_manager.py +++ b/packages/google-cloud-parametermanager/tests/unit/gapic/parametermanager_v1/test_parameter_manager.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1864,11 +1858,7 @@ async def test_list_parameters_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_parameters(request={}) - ).pages: + async for page_ in (await client.list_parameters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3744,11 +3734,7 @@ async def test_list_parameter_versions_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_parameter_versions(request={}) - ).pages: + async for page_ in (await client.list_parameter_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5625,7 +5611,7 @@ def test_list_parameters_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_parameters_rest_unset_required_fields(): @@ -5871,7 +5857,7 @@ def test_get_parameter_rest_required_fields(request_type=service.GetParameterReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_parameter_rest_unset_required_fields(): @@ -6073,7 +6059,7 @@ def test_create_parameter_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_parameter_rest_unset_required_fields(): @@ -6273,7 +6259,7 @@ def test_update_parameter_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_parameter_rest_unset_required_fields(): @@ -6466,7 +6452,7 @@ def test_delete_parameter_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_parameter_rest_unset_required_fields(): @@ -6657,7 +6643,7 @@ def test_list_parameter_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_parameter_versions_rest_unset_required_fields(): @@ -6919,7 +6905,7 @@ def test_get_parameter_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_parameter_version_rest_unset_required_fields(): @@ -7104,7 +7090,7 @@ def test_render_parameter_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_render_parameter_version_rest_unset_required_fields(): @@ -7312,7 +7298,7 @@ def test_create_parameter_version_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_parameter_version_rest_unset_required_fields(): @@ -7518,7 +7504,7 @@ def test_update_parameter_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_parameter_version_rest_unset_required_fields(): @@ -7714,7 +7700,7 @@ def test_delete_parameter_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_parameter_version_rest_unset_required_fields(): diff --git a/packages/google-cloud-phishing-protection/docs/conf.py b/packages/google-cloud-phishing-protection/docs/conf.py index 15f47b649a78..6eed212531fb 100644 --- a/packages/google-cloud-phishing-protection/docs/conf.py +++ b/packages/google-cloud-phishing-protection/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-phishing-protection" -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-phishing-protection/google/cloud/phishingprotection_v1beta1/__init__.py b/packages/google-cloud-phishing-protection/google/cloud/phishingprotection_v1beta1/__init__.py index 24f653a491a3..1a57f91a69b1 100644 --- a/packages/google-cloud-phishing-protection/google/cloud/phishingprotection_v1beta1/__init__.py +++ b/packages/google-cloud-phishing-protection/google/cloud/phishingprotection_v1beta1/__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.phishing_protection_service_v1_beta1 import ( PhishingProtectionServiceV1Beta1AsyncClient, @@ -44,28 +38,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.phishingprotection_v1beta1" - 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-phishing-protection/noxfile.py b/packages/google-cloud-phishing-protection/noxfile.py index 0a2f735c3382..92bc6dadd00b 100644 --- a/packages/google-cloud-phishing-protection/noxfile.py +++ b/packages/google-cloud-phishing-protection/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", @@ -390,7 +389,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-phishing-protection/setup.py b/packages/google-cloud-phishing-protection/setup.py index e67a79b1e64d..82ba88eec4c5 100644 --- a/packages/google-cloud-phishing-protection/setup.py +++ b/packages/google-cloud-phishing-protection/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-phishing-protection/testing/constraints-3.10.txt b/packages/google-cloud-phishing-protection/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-phishing-protection/testing/constraints-3.10.txt +++ b/packages/google-cloud-phishing-protection/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-phishing-protection/testing/constraints-3.9.txt b/packages/google-cloud-phishing-protection/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-phishing-protection/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-phishing-protection/tests/unit/gapic/phishingprotection_v1beta1/test_phishing_protection_service_v1_beta1.py b/packages/google-cloud-phishing-protection/tests/unit/gapic/phishingprotection_v1beta1/test_phishing_protection_service_v1_beta1.py index d9c3ea802cf1..044b9fa34d7e 100644 --- a/packages/google-cloud-phishing-protection/tests/unit/gapic/phishingprotection_v1beta1/test_phishing_protection_service_v1_beta1.py +++ b/packages/google-cloud-phishing-protection/tests/unit/gapic/phishingprotection_v1beta1/test_phishing_protection_service_v1_beta1.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1895,7 +1889,7 @@ def test_report_phishing_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_report_phishing_rest_unset_required_fields(): diff --git a/packages/google-cloud-policy-troubleshooter/docs/conf.py b/packages/google-cloud-policy-troubleshooter/docs/conf.py index 6c29f21cab06..b92d22ca5646 100644 --- a/packages/google-cloud-policy-troubleshooter/docs/conf.py +++ b/packages/google-cloud-policy-troubleshooter/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-policy-troubleshooter" -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-policy-troubleshooter/google/cloud/policytroubleshooter_v1/__init__.py b/packages/google-cloud-policy-troubleshooter/google/cloud/policytroubleshooter_v1/__init__.py index 53bef55f2e3f..3470b5141817 100644 --- a/packages/google-cloud-policy-troubleshooter/google/cloud/policytroubleshooter_v1/__init__.py +++ b/packages/google-cloud-policy-troubleshooter/google/cloud/policytroubleshooter_v1/__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.iam_checker import IamCheckerAsyncClient, IamCheckerClient from .types.checker import TroubleshootIamPolicyRequest, TroubleshootIamPolicyResponse @@ -48,28 +42,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.policytroubleshooter_v1" - 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-policy-troubleshooter/noxfile.py b/packages/google-cloud-policy-troubleshooter/noxfile.py index 25baaea8f0eb..c0f1877905ff 100644 --- a/packages/google-cloud-policy-troubleshooter/noxfile.py +++ b/packages/google-cloud-policy-troubleshooter/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", @@ -390,7 +389,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-policy-troubleshooter/setup.py b/packages/google-cloud-policy-troubleshooter/setup.py index 8891572018b7..1db068b0e36c 100644 --- a/packages/google-cloud-policy-troubleshooter/setup.py +++ b/packages/google-cloud-policy-troubleshooter/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +74,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, @@ -82,7 +82,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", @@ -93,7 +92,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-policy-troubleshooter/testing/constraints-3.10.txt b/packages/google-cloud-policy-troubleshooter/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-policy-troubleshooter/testing/constraints-3.10.txt +++ b/packages/google-cloud-policy-troubleshooter/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# 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-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 diff --git a/packages/google-cloud-policy-troubleshooter/testing/constraints-3.9.txt b/packages/google-cloud-policy-troubleshooter/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-policy-troubleshooter/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-policy-troubleshooter/tests/unit/gapic/policytroubleshooter_v1/test_iam_checker.py b/packages/google-cloud-policy-troubleshooter/tests/unit/gapic/policytroubleshooter_v1/test_iam_checker.py index fcb1161f9e6b..1b12ee3b6095 100644 --- a/packages/google-cloud-policy-troubleshooter/tests/unit/gapic/policytroubleshooter_v1/test_iam_checker.py +++ b/packages/google-cloud-policy-troubleshooter/tests/unit/gapic/policytroubleshooter_v1/test_iam_checker.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest diff --git a/packages/google-cloud-policysimulator/docs/conf.py b/packages/google-cloud-policysimulator/docs/conf.py index dfe67163e2c2..5ccadca2f31e 100644 --- a/packages/google-cloud-policysimulator/docs/conf.py +++ b/packages/google-cloud-policysimulator/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-policysimulator" -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-policysimulator/google/cloud/policysimulator_v1/__init__.py b/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/__init__.py index e4c2fc1b9cfc..ecd207b296a7 100644 --- a/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/__init__.py +++ b/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/__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.org_policy_violations_preview_service import ( OrgPolicyViolationsPreviewServiceAsyncClient, @@ -78,28 +72,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.policysimulator_v1" - 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-policysimulator/google/cloud/policysimulator_v1/services/org_policy_violations_preview_service/async_client.py b/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/org_policy_violations_preview_service/async_client.py index 9a64b3c704cc..30c4a052b3ac 100644 --- a/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/org_policy_violations_preview_service/async_client.py +++ b/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/org_policy_violations_preview_service/async_client.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. @@ -668,11 +668,11 @@ async def sample_create_org_policy_violations_preview(): ) # Make the request - operation = client.create_org_policy_violations_preview(request=request) + operation = await client.create_org_policy_violations_preview(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/simulator/async_client.py b/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/simulator/async_client.py index 7a6b55c2f10c..44bab1e87e83 100644 --- a/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/simulator/async_client.py +++ b/packages/google-cloud-policysimulator/google/cloud/policysimulator_v1/services/simulator/async_client.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. @@ -461,11 +461,11 @@ async def sample_create_replay(): ) # Make the request - operation = client.create_replay(request=request) + operation = await client.create_replay(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-policysimulator/noxfile.py b/packages/google-cloud-policysimulator/noxfile.py index 3104273791e9..2b624a5f9adb 100644 --- a/packages/google-cloud-policysimulator/noxfile.py +++ b/packages/google-cloud-policysimulator/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", @@ -390,7 +389,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-policysimulator/samples/generated_samples/policysimulator_v1_generated_org_policy_violations_preview_service_create_org_policy_violations_preview_async.py b/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_org_policy_violations_preview_service_create_org_policy_violations_preview_async.py index 3176eff9e954..c159988a700a 100644 --- a/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_org_policy_violations_preview_service_create_org_policy_violations_preview_async.py +++ b/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_org_policy_violations_preview_service_create_org_policy_violations_preview_async.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. @@ -44,11 +44,11 @@ async def sample_create_org_policy_violations_preview(): ) # Make the request - operation = client.create_org_policy_violations_preview(request=request) + operation = await client.create_org_policy_violations_preview(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_simulator_create_replay_async.py b/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_simulator_create_replay_async.py index a949c16c7ca6..d01240162cc0 100644 --- a/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_simulator_create_replay_async.py +++ b/packages/google-cloud-policysimulator/samples/generated_samples/policysimulator_v1_generated_simulator_create_replay_async.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. @@ -44,11 +44,11 @@ async def sample_create_replay(): ) # Make the request - operation = client.create_replay(request=request) + operation = await client.create_replay(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-policysimulator/setup.py b/packages/google-cloud-policysimulator/setup.py index 87a80c88d71a..3a31955686a1 100644 --- a/packages/google-cloud-policysimulator/setup.py +++ b/packages/google-cloud-policysimulator/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. @@ -41,12 +41,12 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", "google-cloud-org-policy >= 1.11.1, <2.0.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -75,7 +75,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, @@ -83,7 +83,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", @@ -94,7 +93,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-policysimulator/testing/constraints-3.10.txt b/packages/google-cloud-policysimulator/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-policysimulator/testing/constraints-3.10.txt +++ b/packages/google-cloud-policysimulator/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# 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-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 diff --git a/packages/google-cloud-policysimulator/testing/constraints-3.9.txt b/packages/google-cloud-policysimulator/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-policysimulator/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_org_policy_violations_preview_service.py b/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_org_policy_violations_preview_service.py index ff44f64b85ea..58d1b1bc93b0 100644 --- a/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_org_policy_violations_preview_service.py +++ b/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_org_policy_violations_preview_service.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2003,9 +1997,7 @@ async def test_list_org_policy_violations_previews_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 + async for page_ in ( await client.list_org_policy_violations_previews(request={}) ).pages: pages.append(page_) @@ -3284,11 +3276,7 @@ async def test_list_org_policy_violations_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_org_policy_violations(request={}) - ).pages: + async for page_ in (await client.list_org_policy_violations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3416,7 +3404,7 @@ def test_list_org_policy_violations_previews_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_org_policy_violations_previews_rest_unset_required_fields(): @@ -3681,7 +3669,7 @@ def test_get_org_policy_violations_preview_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_org_policy_violations_preview_rest_unset_required_fields(): @@ -3874,7 +3862,7 @@ def test_create_org_policy_violations_preview_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_org_policy_violations_preview_rest_unset_required_fields(): @@ -4084,7 +4072,7 @@ def test_list_org_policy_violations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_org_policy_violations_rest_unset_required_fields(): diff --git a/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_simulator.py b/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_simulator.py index 9d7970d74e66..505bc4494e8f 100644 --- a/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_simulator.py +++ b/packages/google-cloud-policysimulator/tests/unit/gapic/policysimulator_v1/test_simulator.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2469,11 +2463,7 @@ async def test_list_replay_results_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_replay_results(request={}) - ).pages: + async for page_ in (await client.list_replay_results(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2585,7 +2575,7 @@ def test_get_replay_rest_required_fields(request_type=simulator.GetReplayRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_replay_rest_unset_required_fields(): @@ -2762,7 +2752,7 @@ def test_create_replay_rest_required_fields(request_type=simulator.CreateReplayR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_replay_rest_unset_required_fields(): @@ -2958,7 +2948,7 @@ def test_list_replay_results_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_replay_results_rest_unset_required_fields(): diff --git a/packages/google-cloud-policytroubleshooter-iam/docs/conf.py b/packages/google-cloud-policytroubleshooter-iam/docs/conf.py index 7dadc1a37ff4..0a086ec34295 100644 --- a/packages/google-cloud-policytroubleshooter-iam/docs/conf.py +++ b/packages/google-cloud-policytroubleshooter-iam/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-policytroubleshooter-iam" -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-policytroubleshooter-iam/google/cloud/policytroubleshooter_iam_v3/__init__.py b/packages/google-cloud-policytroubleshooter-iam/google/cloud/policytroubleshooter_iam_v3/__init__.py index 5d15672dc14d..0fe6b843e149 100644 --- a/packages/google-cloud-policytroubleshooter-iam/google/cloud/policytroubleshooter_iam_v3/__init__.py +++ b/packages/google-cloud-policytroubleshooter-iam/google/cloud/policytroubleshooter_iam_v3/__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.policy_troubleshooter import ( PolicyTroubleshooterAsyncClient, @@ -63,28 +57,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.policytroubleshooter_iam_v3" - 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-policytroubleshooter-iam/noxfile.py b/packages/google-cloud-policytroubleshooter-iam/noxfile.py index cfecc4c5432c..a7378bf01b48 100644 --- a/packages/google-cloud-policytroubleshooter-iam/noxfile.py +++ b/packages/google-cloud-policytroubleshooter-iam/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", @@ -390,7 +389,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-policytroubleshooter-iam/setup.py b/packages/google-cloud-policytroubleshooter-iam/setup.py index ec20675b6848..09400d541058 100644 --- a/packages/google-cloud-policytroubleshooter-iam/setup.py +++ b/packages/google-cloud-policytroubleshooter-iam/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -75,7 +75,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, @@ -83,7 +83,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", @@ -94,7 +93,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-policytroubleshooter-iam/testing/constraints-3.10.txt b/packages/google-cloud-policytroubleshooter-iam/testing/constraints-3.10.txt index 13c1469fb5e1..ab39fd722ce1 100644 --- a/packages/google-cloud-policytroubleshooter-iam/testing/constraints-3.10.txt +++ b/packages/google-cloud-policytroubleshooter-iam/testing/constraints-3.10.txt @@ -1,12 +1,13 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 -google-cloud-iam +# 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-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 +google-cloud-iam==2.12.2 diff --git a/packages/google-cloud-policytroubleshooter-iam/testing/constraints-3.9.txt b/packages/google-cloud-policytroubleshooter-iam/testing/constraints-3.9.txt deleted file mode 100644 index 2dc8c70078d8..000000000000 --- a/packages/google-cloud-policytroubleshooter-iam/testing/constraints-3.9.txt +++ /dev/null @@ -1,15 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 -google-cloud-iam==2.12.2 diff --git a/packages/google-cloud-policytroubleshooter-iam/tests/unit/gapic/policytroubleshooter_iam_v3/test_policy_troubleshooter.py b/packages/google-cloud-policytroubleshooter-iam/tests/unit/gapic/policytroubleshooter_iam_v3/test_policy_troubleshooter.py index ec93f03135a0..5457093d72ce 100644 --- a/packages/google-cloud-policytroubleshooter-iam/tests/unit/gapic/policytroubleshooter_iam_v3/test_policy_troubleshooter.py +++ b/packages/google-cloud-policytroubleshooter-iam/tests/unit/gapic/policytroubleshooter_iam_v3/test_policy_troubleshooter.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest diff --git a/packages/google-cloud-private-ca/docs/conf.py b/packages/google-cloud-private-ca/docs/conf.py index adb33f7a533c..3f044c7dd795 100644 --- a/packages/google-cloud-private-ca/docs/conf.py +++ b/packages/google-cloud-private-ca/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-private-ca" -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-private-ca/google/cloud/security/privateca_v1/__init__.py b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1/__init__.py index addf23714af5..c521c455d0f1 100644 --- a/packages/google-cloud-private-ca/google/cloud/security/privateca_v1/__init__.py +++ b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1/__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.certificate_authority_service import ( CertificateAuthorityServiceAsyncClient, @@ -106,28 +100,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.security.privateca_v1" - 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-private-ca/google/cloud/security/privateca_v1/services/certificate_authority_service/async_client.py b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1/services/certificate_authority_service/async_client.py index a2fb3be6402c..846a8c59f778 100644 --- a/packages/google-cloud-private-ca/google/cloud/security/privateca_v1/services/certificate_authority_service/async_client.py +++ b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1/services/certificate_authority_service/async_client.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. @@ -1042,11 +1042,11 @@ async def sample_activate_certificate_authority(): ) # Make the request - operation = client.activate_certificate_authority(request=request) + operation = await client.activate_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1185,11 +1185,11 @@ async def sample_create_certificate_authority(): ) # Make the request - operation = client.create_certificate_authority(request=request) + operation = await client.create_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1339,11 +1339,11 @@ async def sample_disable_certificate_authority(): ) # Make the request - operation = client.disable_certificate_authority(request=request) + operation = await client.disable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1473,11 +1473,11 @@ async def sample_enable_certificate_authority(): ) # Make the request - operation = client.enable_certificate_authority(request=request) + operation = await client.enable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1984,11 +1984,11 @@ async def sample_undelete_certificate_authority(): ) # Make the request - operation = client.undelete_certificate_authority(request=request) + operation = await client.undelete_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2118,11 +2118,11 @@ async def sample_delete_certificate_authority(): ) # Make the request - operation = client.delete_certificate_authority(request=request) + operation = await client.delete_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2257,11 +2257,11 @@ async def sample_update_certificate_authority(): ) # Make the request - operation = client.update_certificate_authority(request=request) + operation = await client.update_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2405,11 +2405,11 @@ async def sample_create_ca_pool(): ) # Make the request - operation = client.create_ca_pool(request=request) + operation = await client.create_ca_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2562,11 +2562,11 @@ async def sample_update_ca_pool(): ) # Make the request - operation = client.update_ca_pool(request=request) + operation = await client.update_ca_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2955,11 +2955,11 @@ async def sample_delete_ca_pool(): ) # Make the request - operation = client.delete_ca_pool(request=request) + operation = await client.delete_ca_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3461,11 +3461,11 @@ async def sample_update_certificate_revocation_list(): ) # Make the request - operation = client.update_certificate_revocation_list(request=request) + operation = await client.update_certificate_revocation_list(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3611,11 +3611,11 @@ async def sample_create_certificate_template(): ) # Make the request - operation = client.create_certificate_template(request=request) + operation = await client.create_certificate_template(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3760,11 +3760,11 @@ async def sample_delete_certificate_template(): ) # Make the request - operation = client.delete_certificate_template(request=request) + operation = await client.delete_certificate_template(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4142,11 +4142,11 @@ async def sample_update_certificate_template(): ) # Make the request - operation = client.update_certificate_template(request=request) + operation = await client.update_certificate_template(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/__init__.py b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/__init__.py index 81a0a4aa3ef5..daf7edfa9e4f 100644 --- a/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/__init__.py +++ b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/__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.certificate_authority_service import ( CertificateAuthorityServiceAsyncClient, @@ -89,28 +83,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.security.privateca_v1beta1" - 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-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/async_client.py b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/async_client.py index 308c1ca0c146..20e218eb8c13 100644 --- a/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/async_client.py +++ b/packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/async_client.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. @@ -1029,11 +1029,11 @@ async def sample_activate_certificate_authority(): ) # Make the request - operation = client.activate_certificate_authority(request=request) + operation = await client.activate_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1173,11 +1173,11 @@ async def sample_create_certificate_authority(): ) # Make the request - operation = client.create_certificate_authority(request=request) + operation = await client.create_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1325,11 +1325,11 @@ async def sample_disable_certificate_authority(): ) # Make the request - operation = client.disable_certificate_authority(request=request) + operation = await client.disable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1458,11 +1458,11 @@ async def sample_enable_certificate_authority(): ) # Make the request - operation = client.enable_certificate_authority(request=request) + operation = await client.enable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1966,11 +1966,11 @@ async def sample_restore_certificate_authority(): ) # Make the request - operation = client.restore_certificate_authority(request=request) + operation = await client.restore_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2100,11 +2100,11 @@ async def sample_schedule_delete_certificate_authority(): ) # Make the request - operation = client.schedule_delete_certificate_authority(request=request) + operation = await client.schedule_delete_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2240,11 +2240,11 @@ async def sample_update_certificate_authority(): ) # Make the request - operation = client.update_certificate_authority(request=request) + operation = await client.update_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2636,11 +2636,11 @@ async def sample_update_certificate_revocation_list(): ) # Make the request - operation = client.update_certificate_revocation_list(request=request) + operation = await client.update_certificate_revocation_list(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/noxfile.py b/packages/google-cloud-private-ca/noxfile.py index 928d0a09d751..16b290cd3c37 100644 --- a/packages/google-cloud-private-ca/noxfile.py +++ b/packages/google-cloud-private-ca/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", @@ -390,7 +389,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-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_activate_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_activate_certificate_authority_async.py index fc206c6be9dc..54e17385a0d0 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_activate_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_activate_certificate_authority_async.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. @@ -49,11 +49,11 @@ async def sample_activate_certificate_authority(): ) # Make the request - operation = client.activate_certificate_authority(request=request) + operation = await client.activate_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_ca_pool_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_ca_pool_async.py index cf3880e5ecf8..2dcdb95415f7 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_ca_pool_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_ca_pool_async.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. @@ -49,11 +49,11 @@ async def sample_create_ca_pool(): ) # Make the request - operation = client.create_ca_pool(request=request) + operation = await client.create_ca_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_authority_async.py index d6dcd96560a1..aa355821931a 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_authority_async.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. @@ -50,11 +50,11 @@ async def sample_create_certificate_authority(): ) # Make the request - operation = client.create_certificate_authority(request=request) + operation = await client.create_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_template_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_template_async.py index 4fc27a86566f..5a272fa4ea7d 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_template_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_create_certificate_template_async.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. @@ -45,11 +45,11 @@ async def sample_create_certificate_template(): ) # Make the request - operation = client.create_certificate_template(request=request) + operation = await client.create_certificate_template(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_ca_pool_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_ca_pool_async.py index a76b09f90ec0..773fda038519 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_ca_pool_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_ca_pool_async.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. @@ -44,11 +44,11 @@ async def sample_delete_ca_pool(): ) # Make the request - operation = client.delete_ca_pool(request=request) + operation = await client.delete_ca_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_authority_async.py index 665c10b5af3d..2c459992230c 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_delete_certificate_authority(): ) # Make the request - operation = client.delete_certificate_authority(request=request) + operation = await client.delete_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_template_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_template_async.py index 5a27f7525179..05ae39cb2ae8 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_template_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_delete_certificate_template_async.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. @@ -44,11 +44,11 @@ async def sample_delete_certificate_template(): ) # Make the request - operation = client.delete_certificate_template(request=request) + operation = await client.delete_certificate_template(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_disable_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_disable_certificate_authority_async.py index d64a758bc20f..09ba5528c09a 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_disable_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_disable_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_disable_certificate_authority(): ) # Make the request - operation = client.disable_certificate_authority(request=request) + operation = await client.disable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_enable_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_enable_certificate_authority_async.py index 7d394beb74c9..0151f18bbf33 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_enable_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_enable_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_enable_certificate_authority(): ) # Make the request - operation = client.enable_certificate_authority(request=request) + operation = await client.enable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_undelete_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_undelete_certificate_authority_async.py index 70bff4d21d07..b2769aff3fac 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_undelete_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_undelete_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_undelete_certificate_authority(): ) # Make the request - operation = client.undelete_certificate_authority(request=request) + operation = await client.undelete_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_ca_pool_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_ca_pool_async.py index cc5d9b5fe88d..d211415c4879 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_ca_pool_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_ca_pool_async.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. @@ -47,11 +47,11 @@ async def sample_update_ca_pool(): ) # Make the request - operation = client.update_ca_pool(request=request) + operation = await client.update_ca_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_authority_async.py index 905801be60c0..ceaff088d0e4 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_authority_async.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. @@ -48,11 +48,11 @@ async def sample_update_certificate_authority(): ) # Make the request - operation = client.update_certificate_authority(request=request) + operation = await client.update_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_revocation_list_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_revocation_list_async.py index b1bf02f7a73f..3172816c9530 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_revocation_list_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_revocation_list_async.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. @@ -42,11 +42,11 @@ async def sample_update_certificate_revocation_list(): request = privateca_v1.UpdateCertificateRevocationListRequest() # Make the request - operation = client.update_certificate_revocation_list(request=request) + operation = await client.update_certificate_revocation_list(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_template_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_template_async.py index 444fe77e1517..4319f1c29033 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_template_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1_generated_certificate_authority_service_update_certificate_template_async.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. @@ -42,11 +42,11 @@ async def sample_update_certificate_template(): request = privateca_v1.UpdateCertificateTemplateRequest() # Make the request - operation = client.update_certificate_template(request=request) + operation = await client.update_certificate_template(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_activate_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_activate_certificate_authority_async.py index 2ef3f8e2e0e1..4db7e60eebe3 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_activate_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_activate_certificate_authority_async.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. @@ -49,11 +49,11 @@ async def sample_activate_certificate_authority(): ) # Make the request - operation = client.activate_certificate_authority(request=request) + operation = await client.activate_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_create_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_create_certificate_authority_async.py index 669ba3fdfa12..fca32403d9f9 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_create_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_create_certificate_authority_async.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. @@ -54,11 +54,11 @@ async def sample_create_certificate_authority(): ) # Make the request - operation = client.create_certificate_authority(request=request) + operation = await client.create_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_disable_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_disable_certificate_authority_async.py index 9ebd74dc3c56..1a27579e936f 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_disable_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_disable_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_disable_certificate_authority(): ) # Make the request - operation = client.disable_certificate_authority(request=request) + operation = await client.disable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_enable_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_enable_certificate_authority_async.py index 3eca0e1657a5..912c0f3d0c21 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_enable_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_enable_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_enable_certificate_authority(): ) # Make the request - operation = client.enable_certificate_authority(request=request) + operation = await client.enable_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_restore_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_restore_certificate_authority_async.py index 195dcc41c45b..c1d93f6df285 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_restore_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_restore_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_restore_certificate_authority(): ) # Make the request - operation = client.restore_certificate_authority(request=request) + operation = await client.restore_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_schedule_delete_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_schedule_delete_certificate_authority_async.py index 45f5221eec0e..302966e23376 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_schedule_delete_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_schedule_delete_certificate_authority_async.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. @@ -44,11 +44,11 @@ async def sample_schedule_delete_certificate_authority(): ) # Make the request - operation = client.schedule_delete_certificate_authority(request=request) + operation = await client.schedule_delete_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_authority_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_authority_async.py index 44f36ec7f935..360fd96d2f73 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_authority_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_authority_async.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. @@ -52,11 +52,11 @@ async def sample_update_certificate_authority(): ) # Make the request - operation = client.update_certificate_authority(request=request) + operation = await client.update_certificate_authority(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_revocation_list_async.py b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_revocation_list_async.py index adc6460bf55e..2c206abc1c74 100644 --- a/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_revocation_list_async.py +++ b/packages/google-cloud-private-ca/samples/generated_samples/privateca_v1beta1_generated_certificate_authority_service_update_certificate_revocation_list_async.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. @@ -42,11 +42,11 @@ async def sample_update_certificate_revocation_list(): request = privateca_v1beta1.UpdateCertificateRevocationListRequest() # Make the request - operation = client.update_certificate_revocation_list(request=request) + operation = await client.update_certificate_revocation_list(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-private-ca/setup.py b/packages/google-cloud-private-ca/setup.py index b55a9c6ce100..750473e03ba4 100644 --- a/packages/google-cloud-private-ca/setup.py +++ b/packages/google-cloud-private-ca/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +74,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, @@ -82,7 +82,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", @@ -93,7 +92,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-private-ca/testing/constraints-3.10.txt b/packages/google-cloud-private-ca/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-private-ca/testing/constraints-3.10.txt +++ b/packages/google-cloud-private-ca/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# 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-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 diff --git a/packages/google-cloud-private-ca/testing/constraints-3.9.txt b/packages/google-cloud-private-ca/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-private-ca/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.py b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.py index 114e347d3f49..e03203955d96 100644 --- a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.py +++ b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2705,11 +2699,7 @@ async def test_list_certificates_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_certificates(request={}) - ).pages: + async for page_ in (await client.list_certificates(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6125,9 +6115,7 @@ async def test_list_certificate_authorities_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 + async for page_ in ( await client.list_certificate_authorities(request={}) ).pages: pages.append(page_) @@ -8704,11 +8692,7 @@ async def test_list_ca_pools_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_ca_pools(request={}) - ).pages: + async for page_ in (await client.list_ca_pools(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10272,9 +10256,7 @@ async def test_list_certificate_revocation_lists_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 + async for page_ in ( await client.list_certificate_revocation_lists(request={}) ).pages: pages.append(page_) @@ -12256,11 +12238,7 @@ async def test_list_certificate_templates_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_certificate_templates(request={}) - ).pages: + async for page_ in (await client.list_certificate_templates(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12741,7 +12719,7 @@ def test_create_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_certificate_rest_unset_required_fields(): @@ -12940,7 +12918,7 @@ def test_get_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_rest_unset_required_fields(): @@ -13131,7 +13109,7 @@ def test_list_certificates_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificates_rest_unset_required_fields(): @@ -13389,7 +13367,7 @@ def test_revoke_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_revoke_certificate_rest_unset_required_fields(): @@ -13584,7 +13562,7 @@ def test_update_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_rest_unset_required_fields(): @@ -13792,7 +13770,7 @@ def test_activate_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_activate_certificate_authority_rest_unset_required_fields(): @@ -14013,7 +13991,7 @@ def test_create_certificate_authority_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_certificate_authority_rest_unset_required_fields(): @@ -14216,7 +14194,7 @@ def test_disable_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_disable_certificate_authority_rest_unset_required_fields(): @@ -14403,7 +14381,7 @@ def test_enable_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_enable_certificate_authority_rest_unset_required_fields(): @@ -14586,7 +14564,7 @@ def test_fetch_certificate_authority_csr_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_fetch_certificate_authority_csr_rest_unset_required_fields(): @@ -14773,7 +14751,7 @@ def test_get_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_authority_rest_unset_required_fields(): @@ -14967,7 +14945,7 @@ def test_list_certificate_authorities_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificate_authorities_rest_unset_required_fields(): @@ -15229,7 +15207,7 @@ def test_undelete_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undelete_certificate_authority_rest_unset_required_fields(): @@ -15424,7 +15402,7 @@ def test_delete_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_certificate_authority_rest_unset_required_fields(): @@ -15621,7 +15599,7 @@ def test_update_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_authority_rest_unset_required_fields(): @@ -15836,7 +15814,7 @@ def test_create_ca_pool_rest_required_fields(request_type=service.CreateCaPoolRe ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_ca_pool_rest_unset_required_fields(): @@ -16031,7 +16009,7 @@ def test_update_ca_pool_rest_required_fields(request_type=service.UpdateCaPoolRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_ca_pool_rest_unset_required_fields(): @@ -16222,7 +16200,7 @@ def test_get_ca_pool_rest_required_fields(request_type=service.GetCaPoolRequest) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_ca_pool_rest_unset_required_fields(): @@ -16406,7 +16384,7 @@ def test_list_ca_pools_rest_required_fields(request_type=service.ListCaPoolsRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_ca_pools_rest_unset_required_fields(): @@ -16660,7 +16638,7 @@ def test_delete_ca_pool_rest_required_fields(request_type=service.DeleteCaPoolRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_ca_pool_rest_unset_required_fields(): @@ -16842,7 +16820,7 @@ def test_fetch_ca_certs_rest_required_fields(request_type=service.FetchCaCertsRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_fetch_ca_certs_rest_unset_required_fields(): @@ -17027,7 +17005,7 @@ def test_get_certificate_revocation_list_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_revocation_list_rest_unset_required_fields(): @@ -17225,7 +17203,7 @@ def test_list_certificate_revocation_lists_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificate_revocation_lists_rest_unset_required_fields(): @@ -17495,7 +17473,7 @@ def test_update_certificate_revocation_list_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_revocation_list_rest_unset_required_fields(): @@ -17728,7 +17706,7 @@ def test_create_certificate_template_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_certificate_template_rest_unset_required_fields(): @@ -17930,7 +17908,7 @@ def test_delete_certificate_template_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_certificate_template_rest_unset_required_fields(): @@ -18113,7 +18091,7 @@ def test_get_certificate_template_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_template_rest_unset_required_fields(): @@ -18307,7 +18285,7 @@ def test_list_certificate_templates_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificate_templates_rest_unset_required_fields(): @@ -18567,7 +18545,7 @@ def test_update_certificate_template_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_template_rest_unset_required_fields(): diff --git a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py index 0164175954ed..e6826595cc65 100644 --- a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py +++ b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2672,11 +2666,7 @@ async def test_list_certificates_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_certificates(request={}) - ).pages: + async for page_ in (await client.list_certificates(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6066,9 +6056,7 @@ async def test_list_certificate_authorities_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 + async for page_ in ( await client.list_certificate_authorities(request={}) ).pages: pages.append(page_) @@ -8039,9 +8027,7 @@ async def test_list_certificate_revocation_lists_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 + async for page_ in ( await client.list_certificate_revocation_lists(request={}) ).pages: pages.append(page_) @@ -9303,11 +9289,7 @@ async def test_list_reusable_configs_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_reusable_configs(request={}) - ).pages: + async for page_ in (await client.list_reusable_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9433,7 +9415,7 @@ def test_create_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_certificate_rest_unset_required_fields(): @@ -9630,7 +9612,7 @@ def test_get_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_rest_unset_required_fields(): @@ -9821,7 +9803,7 @@ def test_list_certificates_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificates_rest_unset_required_fields(): @@ -10079,7 +10061,7 @@ def test_revoke_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_revoke_certificate_rest_unset_required_fields(): @@ -10274,7 +10256,7 @@ def test_update_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_rest_unset_required_fields(): @@ -10482,7 +10464,7 @@ def test_activate_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_activate_certificate_authority_rest_unset_required_fields(): @@ -10703,7 +10685,7 @@ def test_create_certificate_authority_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_certificate_authority_rest_unset_required_fields(): @@ -10904,7 +10886,7 @@ def test_disable_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_disable_certificate_authority_rest_unset_required_fields(): @@ -11091,7 +11073,7 @@ def test_enable_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_enable_certificate_authority_rest_unset_required_fields(): @@ -11274,7 +11256,7 @@ def test_fetch_certificate_authority_csr_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_fetch_certificate_authority_csr_rest_unset_required_fields(): @@ -11461,7 +11443,7 @@ def test_get_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_authority_rest_unset_required_fields(): @@ -11655,7 +11637,7 @@ def test_list_certificate_authorities_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificate_authorities_rest_unset_required_fields(): @@ -11913,7 +11895,7 @@ def test_restore_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_certificate_authority_rest_unset_required_fields(): @@ -12104,7 +12086,7 @@ def test_schedule_delete_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_schedule_delete_certificate_authority_rest_unset_required_fields(): @@ -12295,7 +12277,7 @@ def test_update_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_authority_rest_unset_required_fields(): @@ -12495,7 +12477,7 @@ def test_get_certificate_revocation_list_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_certificate_revocation_list_rest_unset_required_fields(): @@ -12693,7 +12675,7 @@ def test_list_certificate_revocation_lists_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_certificate_revocation_lists_rest_unset_required_fields(): @@ -12963,7 +12945,7 @@ def test_update_certificate_revocation_list_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_certificate_revocation_list_rest_unset_required_fields(): @@ -13170,7 +13152,7 @@ def test_get_reusable_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_reusable_config_rest_unset_required_fields(): @@ -13364,7 +13346,7 @@ def test_list_reusable_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_reusable_configs_rest_unset_required_fields(): diff --git a/packages/google-cloud-private-catalog/docs/conf.py b/packages/google-cloud-private-catalog/docs/conf.py index 7d00d5a927f3..0adeab528d30 100644 --- a/packages/google-cloud-private-catalog/docs/conf.py +++ b/packages/google-cloud-private-catalog/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-private-catalog" -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-private-catalog/google/cloud/privatecatalog_v1beta1/__init__.py b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/__init__.py index 709cc71b01d8..4b7dfeb6b305 100644 --- a/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/__init__.py +++ b/packages/google-cloud-private-catalog/google/cloud/privatecatalog_v1beta1/__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.private_catalog import PrivateCatalogAsyncClient, PrivateCatalogClient from .types.private_catalog import ( @@ -55,28 +49,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.privatecatalog_v1beta1" - 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-private-catalog/noxfile.py b/packages/google-cloud-private-catalog/noxfile.py index 97f12a45d4de..da21e3590458 100644 --- a/packages/google-cloud-private-catalog/noxfile.py +++ b/packages/google-cloud-private-catalog/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", @@ -390,7 +389,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-private-catalog/setup.py b/packages/google-cloud-private-catalog/setup.py index 9ffad9f66626..2e16e7df2ef2 100644 --- a/packages/google-cloud-private-catalog/setup.py +++ b/packages/google-cloud-private-catalog/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-private-catalog/testing/constraints-3.10.txt b/packages/google-cloud-private-catalog/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-private-catalog/testing/constraints-3.10.txt +++ b/packages/google-cloud-private-catalog/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-private-catalog/testing/constraints-3.9.txt b/packages/google-cloud-private-catalog/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-private-catalog/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-private-catalog/tests/unit/gapic/privatecatalog_v1beta1/test_private_catalog.py b/packages/google-cloud-private-catalog/tests/unit/gapic/privatecatalog_v1beta1/test_private_catalog.py index 9e2dc16f71ad..f731939ab9bb 100644 --- a/packages/google-cloud-private-catalog/tests/unit/gapic/privatecatalog_v1beta1/test_private_catalog.py +++ b/packages/google-cloud-private-catalog/tests/unit/gapic/privatecatalog_v1beta1/test_private_catalog.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1742,11 +1736,7 @@ async def test_search_catalogs_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.search_catalogs(request={}) - ).pages: + async for page_ in (await client.search_catalogs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2181,11 +2171,7 @@ async def test_search_products_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.search_products(request={}) - ).pages: + async for page_ in (await client.search_products(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2620,11 +2606,7 @@ async def test_search_versions_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.search_versions(request={}) - ).pages: + async for page_ in (await client.search_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2746,7 +2728,7 @@ def test_search_catalogs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_catalogs_rest_unset_required_fields(): @@ -2946,7 +2928,7 @@ def test_search_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_products_rest_unset_required_fields(): @@ -3159,7 +3141,7 @@ def test_search_versions_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_versions_rest_unset_required_fields(): diff --git a/packages/google-cloud-privilegedaccessmanager/docs/conf.py b/packages/google-cloud-privilegedaccessmanager/docs/conf.py index 68156a7f8aa9..e56acb8d95db 100644 --- a/packages/google-cloud-privilegedaccessmanager/docs/conf.py +++ b/packages/google-cloud-privilegedaccessmanager/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-privilegedaccessmanager" -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-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/__init__.py b/packages/google-cloud-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/__init__.py index 34c793e87072..d276cb37b00b 100644 --- a/packages/google-cloud-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/__init__.py +++ b/packages/google-cloud-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/__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.privileged_access_manager import ( PrivilegedAccessManagerAsyncClient, @@ -72,28 +66,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.privilegedaccessmanager_v1" - 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-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/async_client.py b/packages/google-cloud-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/async_client.py index f8a5e49f6599..333caeb9ce5d 100644 --- a/packages/google-cloud-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/async_client.py +++ b/packages/google-cloud-privilegedaccessmanager/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/async_client.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. @@ -816,11 +816,11 @@ async def sample_create_entitlement(): ) # Make the request - operation = client.create_entitlement(request=request) + operation = await client.create_entitlement(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -973,11 +973,11 @@ async def sample_delete_entitlement(): ) # Make the request - operation = client.delete_entitlement(request=request) + operation = await client.delete_entitlement(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1118,11 +1118,11 @@ async def sample_update_entitlement(): ) # Make the request - operation = client.update_entitlement(request=request) + operation = await client.update_entitlement(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1908,11 +1908,11 @@ async def sample_revoke_grant(): ) # Make the request - operation = client.revoke_grant(request=request) + operation = await client.revoke_grant(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-privilegedaccessmanager/noxfile.py b/packages/google-cloud-privilegedaccessmanager/noxfile.py index 2e6f9a28e989..8bf383411567 100644 --- a/packages/google-cloud-privilegedaccessmanager/noxfile.py +++ b/packages/google-cloud-privilegedaccessmanager/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", @@ -390,7 +389,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-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_create_entitlement_async.py b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_create_entitlement_async.py index f6ef18dc4cfa..23d5781eb718 100644 --- a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_create_entitlement_async.py +++ b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_create_entitlement_async.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. @@ -45,11 +45,11 @@ async def sample_create_entitlement(): ) # Make the request - operation = client.create_entitlement(request=request) + operation = await client.create_entitlement(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_delete_entitlement_async.py b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_delete_entitlement_async.py index aacb1c3229c0..288ff606ff22 100644 --- a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_delete_entitlement_async.py +++ b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_delete_entitlement_async.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. @@ -44,11 +44,11 @@ async def sample_delete_entitlement(): ) # Make the request - operation = client.delete_entitlement(request=request) + operation = await client.delete_entitlement(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_revoke_grant_async.py b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_revoke_grant_async.py index a7857171f729..02e8070ee3e8 100644 --- a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_revoke_grant_async.py +++ b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_revoke_grant_async.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. @@ -44,11 +44,11 @@ async def sample_revoke_grant(): ) # Make the request - operation = client.revoke_grant(request=request) + operation = await client.revoke_grant(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_update_entitlement_async.py b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_update_entitlement_async.py index ac310596c4f5..669832a6cc7a 100644 --- a/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_update_entitlement_async.py +++ b/packages/google-cloud-privilegedaccessmanager/samples/generated_samples/privilegedaccessmanager_v1_generated_privileged_access_manager_update_entitlement_async.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. @@ -42,11 +42,11 @@ async def sample_update_entitlement(): request = privilegedaccessmanager_v1.UpdateEntitlementRequest() # Make the request - operation = client.update_entitlement(request=request) + operation = await client.update_entitlement(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-privilegedaccessmanager/setup.py b/packages/google-cloud-privilegedaccessmanager/setup.py index 9cd7f65c4c0b..e2a96c3433eb 100644 --- a/packages/google-cloud-privilegedaccessmanager/setup.py +++ b/packages/google-cloud-privilegedaccessmanager/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-privilegedaccessmanager/testing/constraints-3.10.txt b/packages/google-cloud-privilegedaccessmanager/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-privilegedaccessmanager/testing/constraints-3.10.txt +++ b/packages/google-cloud-privilegedaccessmanager/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-privilegedaccessmanager/testing/constraints-3.9.txt b/packages/google-cloud-privilegedaccessmanager/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-privilegedaccessmanager/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-privilegedaccessmanager/tests/unit/gapic/privilegedaccessmanager_v1/test_privileged_access_manager.py b/packages/google-cloud-privilegedaccessmanager/tests/unit/gapic/privilegedaccessmanager_v1/test_privileged_access_manager.py index 63ff7805c65c..f945f12ff4e1 100644 --- a/packages/google-cloud-privilegedaccessmanager/tests/unit/gapic/privilegedaccessmanager_v1/test_privileged_access_manager.py +++ b/packages/google-cloud-privilegedaccessmanager/tests/unit/gapic/privilegedaccessmanager_v1/test_privileged_access_manager.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2192,11 +2186,7 @@ async def test_list_entitlements_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_entitlements(request={}) - ).pages: + async for page_ in (await client.list_entitlements(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2656,11 +2646,7 @@ async def test_search_entitlements_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.search_entitlements(request={}) - ).pages: + async for page_ in (await client.search_entitlements(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4586,11 +4572,7 @@ async def test_list_grants_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_grants(request={}) - ).pages: + async for page_ in (await client.list_grants(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5026,11 +5008,7 @@ async def test_search_grants_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.search_grants(request={}) - ).pages: + async for page_ in (await client.search_grants(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6607,7 +6585,7 @@ def test_check_onboarding_status_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_check_onboarding_status_rest_unset_required_fields(): @@ -6740,7 +6718,7 @@ def test_list_entitlements_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_entitlements_rest_unset_required_fields(): @@ -7007,7 +6985,7 @@ def test_search_entitlements_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_entitlements_rest_unset_required_fields(): @@ -7206,7 +7184,7 @@ def test_get_entitlement_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_entitlement_rest_unset_required_fields(): @@ -7412,7 +7390,7 @@ def test_create_entitlement_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_entitlement_rest_unset_required_fields(): @@ -7618,7 +7596,7 @@ def test_delete_entitlement_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_entitlement_rest_unset_required_fields(): @@ -7807,7 +7785,7 @@ def test_update_entitlement_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_entitlement_rest_unset_required_fields(): @@ -8006,7 +7984,7 @@ def test_list_grants_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_grants_rest_unset_required_fields(): @@ -8270,7 +8248,7 @@ def test_search_grants_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_grants_rest_unset_required_fields(): @@ -8470,7 +8448,7 @@ def test_get_grant_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_grant_rest_unset_required_fields(): @@ -8653,7 +8631,7 @@ def test_create_grant_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_grant_rest_unset_required_fields(): @@ -8844,7 +8822,7 @@ def test_approve_grant_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_approve_grant_rest_unset_required_fields(): @@ -8965,7 +8943,7 @@ def test_deny_grant_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deny_grant_rest_unset_required_fields(): @@ -9087,7 +9065,7 @@ def test_revoke_grant_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_revoke_grant_rest_unset_required_fields(): diff --git a/packages/google-cloud-quotas/docs/conf.py b/packages/google-cloud-quotas/docs/conf.py index 64047fbc259b..bcee0804b3d0 100644 --- a/packages/google-cloud-quotas/docs/conf.py +++ b/packages/google-cloud-quotas/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-quotas" -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-quotas/google/cloud/cloudquotas_v1/__init__.py b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/__init__.py index e8a779ed5369..1e3583052da8 100644 --- a/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/__init__.py +++ b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/__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.cloud_quotas import CloudQuotasAsyncClient, CloudQuotasClient from .types.cloudquotas import ( @@ -60,28 +54,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.cloudquotas_v1" - 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-quotas/google/cloud/cloudquotas_v1beta/__init__.py b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/__init__.py index 3347dbd6256f..437e33d5dbd5 100644 --- a/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/__init__.py +++ b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/__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.cloud_quotas import CloudQuotasAsyncClient, CloudQuotasClient from .services.quota_adjuster_settings_manager import ( @@ -69,28 +63,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.cloudquotas_v1beta" - 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-quotas/noxfile.py b/packages/google-cloud-quotas/noxfile.py index d36f94afd752..83cb05320662 100644 --- a/packages/google-cloud-quotas/noxfile.py +++ b/packages/google-cloud-quotas/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", @@ -390,7 +389,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-quotas/setup.py b/packages/google-cloud-quotas/setup.py index 526a2603cd49..34ac8e380675 100644 --- a/packages/google-cloud-quotas/setup.py +++ b/packages/google-cloud-quotas/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-quotas/testing/constraints-3.10.txt b/packages/google-cloud-quotas/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-quotas/testing/constraints-3.10.txt +++ b/packages/google-cloud-quotas/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-quotas/testing/constraints-3.9.txt b/packages/google-cloud-quotas/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-quotas/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1/test_cloud_quotas.py b/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1/test_cloud_quotas.py index dfbdfcb1fd7f..e7fab48820b2 100644 --- a/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1/test_cloud_quotas.py +++ b/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1/test_cloud_quotas.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1789,11 +1783,7 @@ async def test_list_quota_infos_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_quota_infos(request={}) - ).pages: + async for page_ in (await client.list_quota_infos(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2715,11 +2705,7 @@ async def test_list_quota_preferences_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_quota_preferences(request={}) - ).pages: + async for page_ in (await client.list_quota_preferences(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3969,7 +3955,7 @@ def test_list_quota_infos_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_quota_infos_rest_unset_required_fields(): @@ -4222,7 +4208,7 @@ def test_get_quota_info_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_quota_info_rest_unset_required_fields(): @@ -4416,7 +4402,7 @@ def test_list_quota_preferences_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_quota_preferences_rest_unset_required_fields(): @@ -4671,7 +4657,7 @@ def test_get_quota_preference_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_quota_preference_rest_unset_required_fields(): @@ -4864,7 +4850,7 @@ def test_create_quota_preference_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_quota_preference_rest_unset_required_fields(): @@ -5069,7 +5055,7 @@ def test_update_quota_preference_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_quota_preference_rest_unset_required_fields(): diff --git a/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_cloud_quotas.py b/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_cloud_quotas.py index c5d360491004..3b6998a4f359 100644 --- a/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_cloud_quotas.py +++ b/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_cloud_quotas.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1789,11 +1783,7 @@ async def test_list_quota_infos_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_quota_infos(request={}) - ).pages: + async for page_ in (await client.list_quota_infos(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2715,11 +2705,7 @@ async def test_list_quota_preferences_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_quota_preferences(request={}) - ).pages: + async for page_ in (await client.list_quota_preferences(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3969,7 +3955,7 @@ def test_list_quota_infos_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_quota_infos_rest_unset_required_fields(): @@ -4222,7 +4208,7 @@ def test_get_quota_info_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_quota_info_rest_unset_required_fields(): @@ -4416,7 +4402,7 @@ def test_list_quota_preferences_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_quota_preferences_rest_unset_required_fields(): @@ -4671,7 +4657,7 @@ def test_get_quota_preference_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_quota_preference_rest_unset_required_fields(): @@ -4864,7 +4850,7 @@ def test_create_quota_preference_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_quota_preference_rest_unset_required_fields(): @@ -5069,7 +5055,7 @@ def test_update_quota_preference_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_quota_preference_rest_unset_required_fields(): diff --git a/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_quota_adjuster_settings_manager.py b/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_quota_adjuster_settings_manager.py index 7fcbaafb7cbe..5780b64fb0cc 100644 --- a/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_quota_adjuster_settings_manager.py +++ b/packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1beta/test_quota_adjuster_settings_manager.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2288,7 +2282,7 @@ def test_update_quota_adjuster_settings_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_quota_adjuster_settings_rest_unset_required_fields(): @@ -2495,7 +2489,7 @@ def test_get_quota_adjuster_settings_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_quota_adjuster_settings_rest_unset_required_fields(): diff --git a/packages/google-cloud-rapidmigrationassessment/docs/conf.py b/packages/google-cloud-rapidmigrationassessment/docs/conf.py index 8f5676b48ee4..05b39a9c781f 100644 --- a/packages/google-cloud-rapidmigrationassessment/docs/conf.py +++ b/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment" -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-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/__init__.py b/packages/google-cloud-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/__init__.py index 7260c004a5c0..8f8092abba4d 100644 --- a/packages/google-cloud-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/__init__.py +++ b/packages/google-cloud-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/__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.rapid_migration_assessment import ( RapidMigrationAssessmentAsyncClient, @@ -58,28 +52,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.rapidmigrationassessment_v1" - 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-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/services/rapid_migration_assessment/async_client.py b/packages/google-cloud-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/services/rapid_migration_assessment/async_client.py index 4c788bb1bfe4..bf31e0b16166 100644 --- a/packages/google-cloud-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/services/rapid_migration_assessment/async_client.py +++ b/packages/google-cloud-rapidmigrationassessment/google/cloud/rapidmigrationassessment_v1/services/rapid_migration_assessment/async_client.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. @@ -363,11 +363,11 @@ async def sample_create_collector(): ) # Make the request - operation = client.create_collector(request=request) + operation = await client.create_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -507,11 +507,11 @@ async def sample_create_annotation(): ) # Make the request - operation = client.create_annotation(request=request) + operation = await client.create_annotation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -987,11 +987,11 @@ async def sample_update_collector(): ) # Make the request - operation = client.update_collector(request=request) + operation = await client.update_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1129,11 +1129,11 @@ async def sample_delete_collector(): ) # Make the request - operation = client.delete_collector(request=request) + operation = await client.delete_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1254,11 +1254,11 @@ async def sample_resume_collector(): ) # Make the request - operation = client.resume_collector(request=request) + operation = await client.resume_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1379,11 +1379,11 @@ async def sample_register_collector(): ) # Make the request - operation = client.register_collector(request=request) + operation = await client.register_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1504,11 +1504,11 @@ async def sample_pause_collector(): ) # Make the request - operation = client.pause_collector(request=request) + operation = await client.pause_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/noxfile.py b/packages/google-cloud-rapidmigrationassessment/noxfile.py index 97194351c99c..7e5eefab871a 100644 --- a/packages/google-cloud-rapidmigrationassessment/noxfile.py +++ b/packages/google-cloud-rapidmigrationassessment/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", @@ -390,7 +389,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-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_annotation_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_annotation_async.py index ba89343a127c..b18444b8e470 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_annotation_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_annotation_async.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. @@ -44,11 +44,11 @@ async def sample_create_annotation(): ) # Make the request - operation = client.create_annotation(request=request) + operation = await client.create_annotation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_collector_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_collector_async.py index 59792edff473..75ac60975eb6 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_collector_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_create_collector_async.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. @@ -45,11 +45,11 @@ async def sample_create_collector(): ) # Make the request - operation = client.create_collector(request=request) + operation = await client.create_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_delete_collector_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_delete_collector_async.py index b3dad0c52ebf..5eb2e314c0b1 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_delete_collector_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_delete_collector_async.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. @@ -44,11 +44,11 @@ async def sample_delete_collector(): ) # Make the request - operation = client.delete_collector(request=request) + operation = await client.delete_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_pause_collector_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_pause_collector_async.py index 4c1150be8d74..9415f967f758 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_pause_collector_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_pause_collector_async.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. @@ -44,11 +44,11 @@ async def sample_pause_collector(): ) # Make the request - operation = client.pause_collector(request=request) + operation = await client.pause_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_register_collector_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_register_collector_async.py index f19d7cb72d2e..e99b3092612e 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_register_collector_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_register_collector_async.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. @@ -44,11 +44,11 @@ async def sample_register_collector(): ) # Make the request - operation = client.register_collector(request=request) + operation = await client.register_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_resume_collector_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_resume_collector_async.py index 9a6d97715b08..01a53338011b 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_resume_collector_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_resume_collector_async.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. @@ -44,11 +44,11 @@ async def sample_resume_collector(): ) # Make the request - operation = client.resume_collector(request=request) + operation = await client.resume_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_update_collector_async.py b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_update_collector_async.py index 090747896c46..c088749a05d1 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_update_collector_async.py +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated_samples/rapidmigrationassessment_v1_generated_rapid_migration_assessment_update_collector_async.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. @@ -42,11 +42,11 @@ async def sample_update_collector(): request = rapidmigrationassessment_v1.UpdateCollectorRequest() # Make the request - operation = client.update_collector(request=request) + operation = await client.update_collector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-rapidmigrationassessment/setup.py b/packages/google-cloud-rapidmigrationassessment/setup.py index ec4e40f3272a..7f031f6a3d4e 100644 --- a/packages/google-cloud-rapidmigrationassessment/setup.py +++ b/packages/google-cloud-rapidmigrationassessment/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-rapidmigrationassessment/testing/constraints-3.10.txt b/packages/google-cloud-rapidmigrationassessment/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-rapidmigrationassessment/testing/constraints-3.10.txt +++ b/packages/google-cloud-rapidmigrationassessment/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-rapidmigrationassessment/testing/constraints-3.9.txt b/packages/google-cloud-rapidmigrationassessment/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-rapidmigrationassessment/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-rapidmigrationassessment/tests/unit/gapic/rapidmigrationassessment_v1/test_rapid_migration_assessment.py b/packages/google-cloud-rapidmigrationassessment/tests/unit/gapic/rapidmigrationassessment_v1/test_rapid_migration_assessment.py index 5e00a58768f8..c32fd136a726 100644 --- a/packages/google-cloud-rapidmigrationassessment/tests/unit/gapic/rapidmigrationassessment_v1/test_rapid_migration_assessment.py +++ b/packages/google-cloud-rapidmigrationassessment/tests/unit/gapic/rapidmigrationassessment_v1/test_rapid_migration_assessment.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2952,11 +2946,7 @@ async def test_list_collectors_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_collectors(request={}) - ).pages: + async for page_ in (await client.list_collectors(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5136,7 +5126,7 @@ def test_create_collector_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_collector_rest_unset_required_fields(): @@ -5335,7 +5325,7 @@ def test_create_annotation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_annotation_rest_unset_required_fields(): @@ -5521,7 +5511,7 @@ def test_get_annotation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_annotation_rest_unset_required_fields(): @@ -5712,7 +5702,7 @@ def test_list_collectors_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_collectors_rest_unset_required_fields(): @@ -5962,7 +5952,7 @@ def test_get_collector_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_collector_rest_unset_required_fields(): @@ -6147,7 +6137,7 @@ def test_update_collector_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_collector_rest_unset_required_fields(): @@ -6347,7 +6337,7 @@ def test_delete_collector_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_collector_rest_unset_required_fields(): @@ -6528,7 +6518,7 @@ def test_resume_collector_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_resume_collector_rest_unset_required_fields(): @@ -6712,7 +6702,7 @@ def test_register_collector_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_register_collector_rest_unset_required_fields(): @@ -6892,7 +6882,7 @@ def test_pause_collector_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_pause_collector_rest_unset_required_fields(): diff --git a/packages/google-cloud-recaptcha-enterprise/docs/conf.py b/packages/google-cloud-recaptcha-enterprise/docs/conf.py index f569b2573a4c..d6b1169fff38 100644 --- a/packages/google-cloud-recaptcha-enterprise/docs/conf.py +++ b/packages/google-cloud-recaptcha-enterprise/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-recaptcha-enterprise" -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-recaptcha-enterprise/google/cloud/recaptchaenterprise_v1/__init__.py b/packages/google-cloud-recaptcha-enterprise/google/cloud/recaptchaenterprise_v1/__init__.py index de6cbf4a80b4..1aeb6a567ca1 100644 --- a/packages/google-cloud-recaptcha-enterprise/google/cloud/recaptchaenterprise_v1/__init__.py +++ b/packages/google-cloud-recaptcha-enterprise/google/cloud/recaptchaenterprise_v1/__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.recaptcha_enterprise_service import ( RecaptchaEnterpriseServiceAsyncClient, @@ -115,28 +109,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.recaptchaenterprise_v1" - 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-recaptcha-enterprise/noxfile.py b/packages/google-cloud-recaptcha-enterprise/noxfile.py index 9bf9e14345d7..de450059b0ab 100644 --- a/packages/google-cloud-recaptcha-enterprise/noxfile.py +++ b/packages/google-cloud-recaptcha-enterprise/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", diff --git a/packages/google-cloud-recaptcha-enterprise/setup.py b/packages/google-cloud-recaptcha-enterprise/setup.py index 743685876697..c196d054b9bf 100644 --- a/packages/google-cloud-recaptcha-enterprise/setup.py +++ b/packages/google-cloud-recaptcha-enterprise/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-recaptcha-enterprise/testing/constraints-3.10.txt b/packages/google-cloud-recaptcha-enterprise/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-recaptcha-enterprise/testing/constraints-3.10.txt +++ b/packages/google-cloud-recaptcha-enterprise/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-recaptcha-enterprise/testing/constraints-3.9.txt b/packages/google-cloud-recaptcha-enterprise/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-recaptcha-enterprise/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-recaptcha-enterprise/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py b/packages/google-cloud-recaptcha-enterprise/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py index e89aa3ebea07..11eed48613fc 100644 --- a/packages/google-cloud-recaptcha-enterprise/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py +++ b/packages/google-cloud-recaptcha-enterprise/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.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 @@ -2905,11 +2899,7 @@ async def test_list_keys_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_keys(request={}) - ).pages: + async for page_ in (await client.list_keys(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5676,11 +5666,7 @@ async def test_list_ip_overrides_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_ip_overrides(request={}) - ).pages: + async for page_ in (await client.list_ip_overrides(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6911,11 +6897,7 @@ async def test_list_firewall_policies_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_firewall_policies(request={}) - ).pages: + async for page_ in (await client.list_firewall_policies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8857,11 +8839,7 @@ async def test_list_related_account_groups_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_related_account_groups(request={}) - ).pages: + async for page_ in (await client.list_related_account_groups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9420,9 +9398,7 @@ async def test_list_related_account_group_memberships_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 + async for page_ in ( await client.list_related_account_group_memberships(request={}) ).pages: pages.append(page_) @@ -9999,9 +9975,7 @@ async def test_search_related_account_group_memberships_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 + async for page_ in ( await client.search_related_account_group_memberships(request={}) ).pages: pages.append(page_) diff --git a/packages/google-cloud-recommendations-ai/docs/conf.py b/packages/google-cloud-recommendations-ai/docs/conf.py index 63d83379d540..565417e063d8 100644 --- a/packages/google-cloud-recommendations-ai/docs/conf.py +++ b/packages/google-cloud-recommendations-ai/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-recommendations-ai" -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-recommendations-ai/google/cloud/recommendationengine_v1beta1/__init__.py b/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/__init__.py index 82e9fc1a33f5..d71aa9f4180c 100644 --- a/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/__init__.py +++ b/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/__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.catalog_service import CatalogServiceAsyncClient, CatalogServiceClient from .services.prediction_api_key_registry import ( @@ -100,28 +94,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.recommendationengine_v1beta1" - 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-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/catalog_service/async_client.py b/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/catalog_service/async_client.py index 01cf42548998..5179fa234994 100644 --- a/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/catalog_service/async_client.py +++ b/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/catalog_service/async_client.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. @@ -959,11 +959,11 @@ async def sample_import_catalog_items(): ) # Make the request - operation = client.import_catalog_items(request=request) + operation = await client.import_catalog_items(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/user_event_service/async_client.py b/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/user_event_service/async_client.py index 8b13c4a12ece..580681755d61 100644 --- a/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/user_event_service/async_client.py +++ b/packages/google-cloud-recommendations-ai/google/cloud/recommendationengine_v1beta1/services/user_event_service/async_client.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. @@ -849,11 +849,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1024,11 +1024,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-recommendations-ai/noxfile.py b/packages/google-cloud-recommendations-ai/noxfile.py index 95ef9d61b02b..19637d532774 100644 --- a/packages/google-cloud-recommendations-ai/noxfile.py +++ b/packages/google-cloud-recommendations-ai/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", @@ -390,7 +389,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-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_catalog_service_import_catalog_items_async.py b/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_catalog_service_import_catalog_items_async.py index 6dd2ce13584c..2c111eb9d3cc 100644 --- a/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_catalog_service_import_catalog_items_async.py +++ b/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_catalog_service_import_catalog_items_async.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. @@ -44,11 +44,11 @@ async def sample_import_catalog_items(): ) # Make the request - operation = client.import_catalog_items(request=request) + operation = await client.import_catalog_items(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_import_user_events_async.py b/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_import_user_events_async.py index ce2975598931..c8494ffe4e80 100644 --- a/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_import_user_events_async.py +++ b/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_import_user_events_async.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. @@ -44,11 +44,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_purge_user_events_async.py b/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_purge_user_events_async.py index febfe5c04e0f..ab34539f7c17 100644 --- a/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_purge_user_events_async.py +++ b/packages/google-cloud-recommendations-ai/samples/generated_samples/recommendationengine_v1beta1_generated_user_event_service_purge_user_events_async.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. @@ -45,11 +45,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-recommendations-ai/setup.py b/packages/google-cloud-recommendations-ai/setup.py index 989abe4cb853..47034d15bb1a 100644 --- a/packages/google-cloud-recommendations-ai/setup.py +++ b/packages/google-cloud-recommendations-ai/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-recommendations-ai/testing/constraints-3.10.txt b/packages/google-cloud-recommendations-ai/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-recommendations-ai/testing/constraints-3.10.txt +++ b/packages/google-cloud-recommendations-ai/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-recommendations-ai/testing/constraints-3.9.txt b/packages/google-cloud-recommendations-ai/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-recommendations-ai/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_catalog_service.py b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_catalog_service.py index 6b5849dccf40..d2e2c554d83f 100644 --- a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_catalog_service.py +++ b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_catalog_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2583,11 +2577,7 @@ async def test_list_catalog_items_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_catalog_items(request={}) - ).pages: + async for page_ in (await client.list_catalog_items(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3815,7 +3805,7 @@ def test_create_catalog_item_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_catalog_item_rest_unset_required_fields(): @@ -4007,7 +3997,7 @@ def test_get_catalog_item_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_catalog_item_rest_unset_required_fields(): @@ -4199,7 +4189,7 @@ def test_list_catalog_items_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_catalog_items_rest_unset_required_fields(): @@ -4462,7 +4452,7 @@ def test_update_catalog_item_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_catalog_item_rest_unset_required_fields(): @@ -4655,7 +4645,7 @@ def test_delete_catalog_item_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_catalog_item_rest_unset_required_fields(): @@ -4839,7 +4829,7 @@ def test_import_catalog_items_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_catalog_items_rest_unset_required_fields(): diff --git a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_api_key_registry.py b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_api_key_registry.py index ae1a6d17d7b4..1006e6eb5312 100644 --- a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_api_key_registry.py +++ b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_api_key_registry.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2331,9 +2325,7 @@ async def test_list_prediction_api_key_registrations_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 + async for page_ in ( await client.list_prediction_api_key_registrations(request={}) ).pages: pages.append(page_) @@ -2803,7 +2795,7 @@ def test_create_prediction_api_key_registration_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_prediction_api_key_registration_rest_unset_required_fields(): @@ -3025,7 +3017,7 @@ def test_list_prediction_api_key_registrations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_prediction_api_key_registrations_rest_unset_required_fields(): @@ -3300,7 +3292,7 @@ def test_delete_prediction_api_key_registration_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_prediction_api_key_registration_rest_unset_required_fields(): diff --git a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_service.py b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_service.py index 92b5b804b0a0..cffb28d0d42d 100644 --- a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_service.py +++ b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_prediction_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1895,11 +1889,7 @@ async def test_predict_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.predict(request={}) - ).pages: + async for page_ in (await client.predict(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2012,7 +2002,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_user_event_service.py b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_user_event_service.py index 2b2fa6e38b3c..c8f7a06b6151 100644 --- a/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_user_event_service.py +++ b/packages/google-cloud-recommendations-ai/tests/unit/gapic/recommendationengine_v1beta1/test_user_event_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2602,11 +2596,7 @@ async def test_list_user_events_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_user_events(request={}) - ).pages: + async for page_ in (await client.list_user_events(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3490,7 +3480,7 @@ def test_write_user_event_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_write_user_event_rest_unset_required_fields(): @@ -3703,7 +3693,7 @@ def test_collect_user_event_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_collect_user_event_rest_unset_required_fields(): @@ -3911,7 +3901,7 @@ def test_list_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_user_events_rest_unset_required_fields(): @@ -4175,7 +4165,7 @@ def test_purge_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_user_events_rest_unset_required_fields(): @@ -4371,7 +4361,7 @@ def test_import_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_user_events_rest_unset_required_fields(): diff --git a/packages/google-cloud-recommender/docs/conf.py b/packages/google-cloud-recommender/docs/conf.py index 9f9f50517eab..6b0df72c6e2d 100644 --- a/packages/google-cloud-recommender/docs/conf.py +++ b/packages/google-cloud-recommender/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-recommender" -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-recommender/google/cloud/recommender_v1/__init__.py b/packages/google-cloud-recommender/google/cloud/recommender_v1/__init__.py index 9e1c2af1dba7..944d0e34daba 100644 --- a/packages/google-cloud-recommender/google/cloud/recommender_v1/__init__.py +++ b/packages/google-cloud-recommender/google/cloud/recommender_v1/__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.recommender import RecommenderAsyncClient, RecommenderClient from .types.insight import Insight, InsightStateInfo @@ -73,28 +67,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.recommender_v1" - 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-recommender/google/cloud/recommender_v1beta1/__init__.py b/packages/google-cloud-recommender/google/cloud/recommender_v1beta1/__init__.py index b1a07c7f0475..2b8c92a4c1e5 100644 --- a/packages/google-cloud-recommender/google/cloud/recommender_v1beta1/__init__.py +++ b/packages/google-cloud-recommender/google/cloud/recommender_v1beta1/__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.recommender import RecommenderAsyncClient, RecommenderClient from .types.insight import Insight, InsightStateInfo, InsightType @@ -76,28 +70,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.recommender_v1beta1" - 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-recommender/noxfile.py b/packages/google-cloud-recommender/noxfile.py index f2084d82cf02..34b718bcb729 100644 --- a/packages/google-cloud-recommender/noxfile.py +++ b/packages/google-cloud-recommender/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", @@ -390,7 +389,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-recommender/setup.py b/packages/google-cloud-recommender/setup.py index c9c0e1345925..0a78a0e22f4c 100644 --- a/packages/google-cloud-recommender/setup.py +++ b/packages/google-cloud-recommender/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-recommender/testing/constraints-3.10.txt b/packages/google-cloud-recommender/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-recommender/testing/constraints-3.10.txt +++ b/packages/google-cloud-recommender/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-recommender/testing/constraints-3.9.txt b/packages/google-cloud-recommender/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-recommender/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1/test_recommender.py b/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1/test_recommender.py index b9e31b70b63d..ca112925c7a8 100644 --- a/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1/test_recommender.py +++ b/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1/test_recommender.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1803,11 +1797,7 @@ async def test_list_insights_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_insights(request={}) - ).pages: + async for page_ in (await client.list_insights(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3089,11 +3079,7 @@ async def test_list_recommendations_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_recommendations(request={}) - ).pages: + async for page_ in (await client.list_recommendations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6459,7 +6445,7 @@ def test_list_insights_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_insights_rest_unset_required_fields(): @@ -6713,7 +6699,7 @@ def test_get_insight_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_insight_rest_unset_required_fields(): @@ -6903,7 +6889,7 @@ def test_mark_insight_accepted_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_insight_accepted_rest_unset_required_fields(): @@ -7109,7 +7095,7 @@ def test_list_recommendations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_recommendations_rest_unset_required_fields(): @@ -7369,7 +7355,7 @@ def test_get_recommendation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_recommendation_rest_unset_required_fields(): @@ -7555,7 +7541,7 @@ def test_mark_recommendation_dismissed_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_dismissed_rest_unset_required_fields(): @@ -7687,7 +7673,7 @@ def test_mark_recommendation_claimed_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_claimed_rest_unset_required_fields(): @@ -7889,7 +7875,7 @@ def test_mark_recommendation_succeeded_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_succeeded_rest_unset_required_fields(): @@ -8093,7 +8079,7 @@ def test_mark_recommendation_failed_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_failed_rest_unset_required_fields(): @@ -8290,7 +8276,7 @@ def test_get_recommender_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_recommender_config_rest_unset_required_fields(): @@ -8478,7 +8464,7 @@ def test_update_recommender_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_recommender_config_rest_unset_required_fields(): @@ -8679,7 +8665,7 @@ def test_get_insight_type_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_insight_type_config_rest_unset_required_fields(): @@ -8867,7 +8853,7 @@ def test_update_insight_type_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_insight_type_config_rest_unset_required_fields(): diff --git a/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1beta1/test_recommender.py b/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1beta1/test_recommender.py index 19ca53a5ff66..4c3e45fd9617 100644 --- a/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1beta1/test_recommender.py +++ b/packages/google-cloud-recommender/tests/unit/gapic/recommender_v1beta1/test_recommender.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1803,11 +1797,7 @@ async def test_list_insights_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_insights(request={}) - ).pages: + async for page_ in (await client.list_insights(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3089,11 +3079,7 @@ async def test_list_recommendations_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_recommendations(request={}) - ).pages: + async for page_ in (await client.list_recommendations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6442,11 +6428,7 @@ async def test_list_recommenders_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_recommenders(request={}) - ).pages: + async for page_ in (await client.list_recommenders(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6832,11 +6814,7 @@ async def test_list_insight_types_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_insight_types(request={}) - ).pages: + async for page_ in (await client.list_insight_types(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6958,7 +6936,7 @@ def test_list_insights_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_insights_rest_unset_required_fields(): @@ -7212,7 +7190,7 @@ def test_get_insight_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_insight_rest_unset_required_fields(): @@ -7402,7 +7380,7 @@ def test_mark_insight_accepted_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_insight_accepted_rest_unset_required_fields(): @@ -7608,7 +7586,7 @@ def test_list_recommendations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_recommendations_rest_unset_required_fields(): @@ -7868,7 +7846,7 @@ def test_get_recommendation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_recommendation_rest_unset_required_fields(): @@ -8058,7 +8036,7 @@ def test_mark_recommendation_claimed_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_claimed_rest_unset_required_fields(): @@ -8260,7 +8238,7 @@ def test_mark_recommendation_succeeded_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_succeeded_rest_unset_required_fields(): @@ -8464,7 +8442,7 @@ def test_mark_recommendation_failed_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_mark_recommendation_failed_rest_unset_required_fields(): @@ -8661,7 +8639,7 @@ def test_get_recommender_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_recommender_config_rest_unset_required_fields(): @@ -8849,7 +8827,7 @@ def test_update_recommender_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_recommender_config_rest_unset_required_fields(): @@ -9050,7 +9028,7 @@ def test_get_insight_type_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_insight_type_config_rest_unset_required_fields(): @@ -9238,7 +9216,7 @@ def test_update_insight_type_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_insight_type_config_rest_unset_required_fields(): diff --git a/packages/google-cloud-redis-cluster/docs/conf.py b/packages/google-cloud-redis-cluster/docs/conf.py index 09ef8091215f..21ce411e2dd0 100644 --- a/packages/google-cloud-redis-cluster/docs/conf.py +++ b/packages/google-cloud-redis-cluster/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-redis-cluster" -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-redis-cluster/google/cloud/redis_cluster_v1/__init__.py b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1/__init__.py index 267b46d2be49..a466f04b66df 100644 --- a/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1/__init__.py +++ b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1/__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.cloud_redis_cluster import ( CloudRedisClusterAsyncClient, @@ -91,28 +85,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.redis_cluster_v1" - 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-redis-cluster/google/cloud/redis_cluster_v1/services/cloud_redis_cluster/async_client.py b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1/services/cloud_redis_cluster/async_client.py index c3f73af90401..8e1ea51a9f8d 100644 --- a/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1/services/cloud_redis_cluster/async_client.py +++ b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1/services/cloud_redis_cluster/async_client.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. @@ -654,11 +654,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -796,11 +796,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -945,11 +945,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1340,11 +1340,11 @@ async def sample_reschedule_cluster_maintenance(): ) # Make the request - operation = client.reschedule_cluster_maintenance(request=request) + operation = await client.reschedule_cluster_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1967,11 +1967,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2100,11 +2100,11 @@ async def sample_export_backup(): ) # Make the request - operation = client.export_backup(request=request) + operation = await client.export_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2215,11 +2215,11 @@ async def sample_backup_cluster(): ) # Make the request - operation = client.backup_cluster(request=request) + operation = await client.backup_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/__init__.py b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/__init__.py index 4ba7d984b7ae..5f39b56f7410 100644 --- a/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/__init__.py +++ b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/__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.cloud_redis_cluster import ( CloudRedisClusterAsyncClient, @@ -91,28 +85,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.redis_cluster_v1beta1" - 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-redis-cluster/google/cloud/redis_cluster_v1beta1/services/cloud_redis_cluster/async_client.py b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/services/cloud_redis_cluster/async_client.py index 89c4e1fbf5d3..63baba3299f4 100644 --- a/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/services/cloud_redis_cluster/async_client.py +++ b/packages/google-cloud-redis-cluster/google/cloud/redis_cluster_v1beta1/services/cloud_redis_cluster/async_client.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. @@ -654,11 +654,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -796,11 +796,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -945,11 +945,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1340,11 +1340,11 @@ async def sample_reschedule_cluster_maintenance(): ) # Make the request - operation = client.reschedule_cluster_maintenance(request=request) + operation = await client.reschedule_cluster_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1967,11 +1967,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2100,11 +2100,11 @@ async def sample_export_backup(): ) # Make the request - operation = client.export_backup(request=request) + operation = await client.export_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2215,11 +2215,11 @@ async def sample_backup_cluster(): ) # Make the request - operation = client.backup_cluster(request=request) + operation = await client.backup_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/noxfile.py b/packages/google-cloud-redis-cluster/noxfile.py index 982836af0bee..fcc21a4575e3 100644 --- a/packages/google-cloud-redis-cluster/noxfile.py +++ b/packages/google-cloud-redis-cluster/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", @@ -390,7 +389,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-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_backup_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_backup_cluster_async.py index 505b529409f3..5cb767b9afb5 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_backup_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_backup_cluster_async.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. @@ -44,11 +44,11 @@ async def sample_backup_cluster(): ) # Make the request - operation = client.backup_cluster(request=request) + operation = await client.backup_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_create_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_create_cluster_async.py index 489bf289b16b..d1003f857156 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_create_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_create_cluster_async.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. @@ -49,11 +49,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_backup_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_backup_async.py index 8222b7003af7..7ccb0b9fc29d 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_backup_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_backup_async.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. @@ -44,11 +44,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_cluster_async.py index ac584833e0e5..e221293e9283 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_delete_cluster_async.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. @@ -44,11 +44,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_export_backup_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_export_backup_async.py index d505ceb96bb6..f21949eb0db2 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_export_backup_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_export_backup_async.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. @@ -45,11 +45,11 @@ async def sample_export_backup(): ) # Make the request - operation = client.export_backup(request=request) + operation = await client.export_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.py index d6614382b8a2..afbffe76934e 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.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. @@ -45,11 +45,11 @@ async def sample_reschedule_cluster_maintenance(): ) # Make the request - operation = client.reschedule_cluster_maintenance(request=request) + operation = await client.reschedule_cluster_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_update_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_update_cluster_async.py index 8d033e840459..21ed2e466c9b 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_update_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1_generated_cloud_redis_cluster_update_cluster_async.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. @@ -47,11 +47,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_backup_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_backup_cluster_async.py index 2c03f1e3e580..6ca97cf8e718 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_backup_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_backup_cluster_async.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. @@ -44,11 +44,11 @@ async def sample_backup_cluster(): ) # Make the request - operation = client.backup_cluster(request=request) + operation = await client.backup_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_create_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_create_cluster_async.py index dfedf84f651b..62aa4e4fe877 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_create_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_create_cluster_async.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. @@ -49,11 +49,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_backup_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_backup_async.py index 840e1f274d61..899c622a9bfd 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_backup_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_backup_async.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. @@ -44,11 +44,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_cluster_async.py index d953b1e12b3b..5461ea343bad 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_delete_cluster_async.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. @@ -44,11 +44,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_export_backup_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_export_backup_async.py index 2b3773f3e46a..243db2a5e1cf 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_export_backup_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_export_backup_async.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. @@ -45,11 +45,11 @@ async def sample_export_backup(): ) # Make the request - operation = client.export_backup(request=request) + operation = await client.export_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.py index a4d09360f407..125b186806bf 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_reschedule_cluster_maintenance_async.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. @@ -45,11 +45,11 @@ async def sample_reschedule_cluster_maintenance(): ) # Make the request - operation = client.reschedule_cluster_maintenance(request=request) + operation = await client.reschedule_cluster_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_update_cluster_async.py b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_update_cluster_async.py index 7fb57a2861be..593c8b0b2542 100644 --- a/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_update_cluster_async.py +++ b/packages/google-cloud-redis-cluster/samples/generated_samples/redis_v1beta1_generated_cloud_redis_cluster_update_cluster_async.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. @@ -47,11 +47,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis-cluster/setup.py b/packages/google-cloud-redis-cluster/setup.py index 7584a4673b5a..77c9bfba18a7 100644 --- a/packages/google-cloud-redis-cluster/setup.py +++ b/packages/google-cloud-redis-cluster/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,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, @@ -81,7 +81,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", @@ -92,7 +91,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-redis-cluster/testing/constraints-3.10.txt b/packages/google-cloud-redis-cluster/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-redis-cluster/testing/constraints-3.10.txt +++ b/packages/google-cloud-redis-cluster/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-redis-cluster/testing/constraints-3.9.txt b/packages/google-cloud-redis-cluster/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-redis-cluster/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1/test_cloud_redis_cluster.py b/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1/test_cloud_redis_cluster.py index 76c1a18367c6..b040c5158bba 100644 --- a/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1/test_cloud_redis_cluster.py +++ b/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1/test_cloud_redis_cluster.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1879,11 +1873,7 @@ async def test_list_clusters_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_clusters(request={}) - ).pages: + async for page_ in (await client.list_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4950,11 +4940,7 @@ async def test_list_backup_collections_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_backup_collections(request={}) - ).pages: + async for page_ in (await client.list_backup_collections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5832,11 +5818,7 @@ async def test_list_backups_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_backups(request={}) - ).pages: + async for page_ in (await client.list_backups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7224,7 +7206,7 @@ def test_list_clusters_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_clusters_rest_unset_required_fields(): @@ -7472,7 +7454,7 @@ def test_get_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_rest_unset_required_fields(): @@ -7653,7 +7635,7 @@ def test_update_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_cluster_rest_unset_required_fields(): @@ -7857,7 +7839,7 @@ def test_delete_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cluster_rest_unset_required_fields(): @@ -8054,7 +8036,7 @@ def test_create_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cluster_rest_unset_required_fields(): @@ -8260,7 +8242,7 @@ def test_get_cluster_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_certificate_authority_rest_unset_required_fields(): @@ -8455,7 +8437,7 @@ def test_get_shared_regional_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_shared_regional_certificate_authority_rest_unset_required_fields(): @@ -8650,7 +8632,7 @@ def test_reschedule_cluster_maintenance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reschedule_cluster_maintenance_rest_unset_required_fields(): @@ -8854,7 +8836,7 @@ def test_list_backup_collections_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backup_collections_rest_unset_required_fields(): @@ -9111,7 +9093,7 @@ def test_get_backup_collection_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_collection_rest_unset_required_fields(): @@ -9298,7 +9280,7 @@ def test_list_backups_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backups_rest_unset_required_fields(): @@ -9551,7 +9533,7 @@ def test_get_backup_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_rest_unset_required_fields(): @@ -9734,7 +9716,7 @@ def test_delete_backup_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_backup_rest_unset_required_fields(): @@ -9914,7 +9896,7 @@ def test_export_backup_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_backup_rest_unset_required_fields(): @@ -10036,7 +10018,7 @@ def test_backup_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_backup_cluster_rest_unset_required_fields(): diff --git a/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1beta1/test_cloud_redis_cluster.py b/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1beta1/test_cloud_redis_cluster.py index df54a9fbe8ae..36694b1eff49 100644 --- a/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1beta1/test_cloud_redis_cluster.py +++ b/packages/google-cloud-redis-cluster/tests/unit/gapic/redis_cluster_v1beta1/test_cloud_redis_cluster.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1879,11 +1873,7 @@ async def test_list_clusters_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_clusters(request={}) - ).pages: + async for page_ in (await client.list_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4950,11 +4940,7 @@ async def test_list_backup_collections_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_backup_collections(request={}) - ).pages: + async for page_ in (await client.list_backup_collections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5832,11 +5818,7 @@ async def test_list_backups_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_backups(request={}) - ).pages: + async for page_ in (await client.list_backups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7224,7 +7206,7 @@ def test_list_clusters_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_clusters_rest_unset_required_fields(): @@ -7473,7 +7455,7 @@ def test_get_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_rest_unset_required_fields(): @@ -7655,7 +7637,7 @@ def test_update_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_cluster_rest_unset_required_fields(): @@ -7859,7 +7841,7 @@ def test_delete_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cluster_rest_unset_required_fields(): @@ -8057,7 +8039,7 @@ def test_create_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cluster_rest_unset_required_fields(): @@ -8264,7 +8246,7 @@ def test_get_cluster_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_certificate_authority_rest_unset_required_fields(): @@ -8459,7 +8441,7 @@ def test_get_shared_regional_certificate_authority_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_shared_regional_certificate_authority_rest_unset_required_fields(): @@ -8654,7 +8636,7 @@ def test_reschedule_cluster_maintenance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reschedule_cluster_maintenance_rest_unset_required_fields(): @@ -8858,7 +8840,7 @@ def test_list_backup_collections_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backup_collections_rest_unset_required_fields(): @@ -9115,7 +9097,7 @@ def test_get_backup_collection_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_collection_rest_unset_required_fields(): @@ -9302,7 +9284,7 @@ def test_list_backups_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backups_rest_unset_required_fields(): @@ -9555,7 +9537,7 @@ def test_get_backup_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_rest_unset_required_fields(): @@ -9738,7 +9720,7 @@ def test_delete_backup_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_backup_rest_unset_required_fields(): @@ -9918,7 +9900,7 @@ def test_export_backup_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_backup_rest_unset_required_fields(): @@ -10040,7 +10022,7 @@ def test_backup_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_backup_cluster_rest_unset_required_fields(): diff --git a/packages/google-cloud-redis/docs/conf.py b/packages/google-cloud-redis/docs/conf.py index 6e9b715b80c6..274b6429579c 100644 --- a/packages/google-cloud-redis/docs/conf.py +++ b/packages/google-cloud-redis/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-redis" -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-redis/google/cloud/redis_v1/__init__.py b/packages/google-cloud-redis/google/cloud/redis_v1/__init__.py index 67b65aeb1607..dc3033429796 100644 --- a/packages/google-cloud-redis/google/cloud/redis_v1/__init__.py +++ b/packages/google-cloud-redis/google/cloud/redis_v1/__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.cloud_redis import CloudRedisAsyncClient, CloudRedisClient from .types.cloud_redis import ( @@ -69,28 +63,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.redis_v1" - 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-redis/google/cloud/redis_v1/services/cloud_redis/async_client.py b/packages/google-cloud-redis/google/cloud/redis_v1/services/cloud_redis/async_client.py index 7cea7eda2613..2f7125bf0428 100644 --- a/packages/google-cloud-redis/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/packages/google-cloud-redis/google/cloud/redis_v1/services/cloud_redis/async_client.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. @@ -731,11 +731,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -893,11 +893,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1041,11 +1041,11 @@ async def sample_upgrade_instance(): ) # Make the request - operation = client.upgrade_instance(request=request) + operation = await client.upgrade_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1190,11 +1190,11 @@ async def sample_import_instance(): ) # Make the request - operation = client.import_instance(request=request) + operation = await client.import_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1336,11 +1336,11 @@ async def sample_export_instance(): ) # Make the request - operation = client.export_instance(request=request) + operation = await client.export_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1477,11 +1477,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1615,11 +1615,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1755,11 +1755,11 @@ async def sample_reschedule_maintenance(): ) # Make the request - operation = client.reschedule_maintenance(request=request) + operation = await client.reschedule_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/google/cloud/redis_v1beta1/__init__.py b/packages/google-cloud-redis/google/cloud/redis_v1beta1/__init__.py index 49618dea9389..f35f33fda484 100644 --- a/packages/google-cloud-redis/google/cloud/redis_v1beta1/__init__.py +++ b/packages/google-cloud-redis/google/cloud/redis_v1beta1/__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.cloud_redis import CloudRedisAsyncClient, CloudRedisClient from .types.cloud_redis import ( @@ -68,28 +62,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.redis_v1beta1" - 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-redis/google/cloud/redis_v1beta1/services/cloud_redis/async_client.py b/packages/google-cloud-redis/google/cloud/redis_v1beta1/services/cloud_redis/async_client.py index 8f0cc010385f..41e41c27cc2a 100644 --- a/packages/google-cloud-redis/google/cloud/redis_v1beta1/services/cloud_redis/async_client.py +++ b/packages/google-cloud-redis/google/cloud/redis_v1beta1/services/cloud_redis/async_client.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. @@ -730,11 +730,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -892,11 +892,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1040,11 +1040,11 @@ async def sample_upgrade_instance(): ) # Make the request - operation = client.upgrade_instance(request=request) + operation = await client.upgrade_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1189,11 +1189,11 @@ async def sample_import_instance(): ) # Make the request - operation = client.import_instance(request=request) + operation = await client.import_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1335,11 +1335,11 @@ async def sample_export_instance(): ) # Make the request - operation = client.export_instance(request=request) + operation = await client.export_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1476,11 +1476,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1614,11 +1614,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1754,11 +1754,11 @@ async def sample_reschedule_maintenance(): ) # Make the request - operation = client.reschedule_maintenance(request=request) + operation = await client.reschedule_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/noxfile.py b/packages/google-cloud-redis/noxfile.py index 2cf51925b6c6..5204882de9ec 100644 --- a/packages/google-cloud-redis/noxfile.py +++ b/packages/google-cloud-redis/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", @@ -390,7 +389,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-redis/samples/generated_samples/redis_v1_generated_cloud_redis_create_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_create_instance_async.py index 2361cded24c8..c9addda7a267 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_create_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_create_instance_async.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. @@ -51,11 +51,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_delete_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_delete_instance_async.py index eff35a3023b1..d14e68c12389 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_delete_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_delete_instance_async.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. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_export_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_export_instance_async.py index 1aab8d5159a3..b961f46e1ddd 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_export_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_export_instance_async.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. @@ -48,11 +48,11 @@ async def sample_export_instance(): ) # Make the request - operation = client.export_instance(request=request) + operation = await client.export_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_failover_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_failover_instance_async.py index 189c15c914d3..e0e165928111 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_failover_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_failover_instance_async.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. @@ -44,11 +44,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_import_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_import_instance_async.py index 695e3c0529fa..ee353d8e045c 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_import_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_import_instance_async.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. @@ -48,11 +48,11 @@ async def sample_import_instance(): ) # Make the request - operation = client.import_instance(request=request) + operation = await client.import_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_reschedule_maintenance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_reschedule_maintenance_async.py index 1072cd2500c7..b163204f930b 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_reschedule_maintenance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_reschedule_maintenance_async.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. @@ -45,11 +45,11 @@ async def sample_reschedule_maintenance(): ) # Make the request - operation = client.reschedule_maintenance(request=request) + operation = await client.reschedule_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_update_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_update_instance_async.py index 2094bd6233b6..5b5678982bd9 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_update_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_update_instance_async.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. @@ -49,11 +49,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_upgrade_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_upgrade_instance_async.py index 67d969e95567..2fbe79b96a08 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_upgrade_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1_generated_cloud_redis_upgrade_instance_async.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. @@ -45,11 +45,11 @@ async def sample_upgrade_instance(): ) # Make the request - operation = client.upgrade_instance(request=request) + operation = await client.upgrade_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_create_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_create_instance_async.py index a3ee680987cf..907adba73444 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_create_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_create_instance_async.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. @@ -51,11 +51,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_delete_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_delete_instance_async.py index 606efbac45d1..230f38eaa344 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_delete_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_delete_instance_async.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. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_export_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_export_instance_async.py index f3b55daa7aa2..b87f391b7de6 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_export_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_export_instance_async.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. @@ -48,11 +48,11 @@ async def sample_export_instance(): ) # Make the request - operation = client.export_instance(request=request) + operation = await client.export_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_failover_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_failover_instance_async.py index 4cbe3a4fbb64..e669ba8d4edb 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_failover_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_failover_instance_async.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. @@ -44,11 +44,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_import_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_import_instance_async.py index d4683e56b3f9..d90b737f9b6f 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_import_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_import_instance_async.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. @@ -48,11 +48,11 @@ async def sample_import_instance(): ) # Make the request - operation = client.import_instance(request=request) + operation = await client.import_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_reschedule_maintenance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_reschedule_maintenance_async.py index 6cb502d95612..1a62ee56f8a9 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_reschedule_maintenance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_reschedule_maintenance_async.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. @@ -45,11 +45,11 @@ async def sample_reschedule_maintenance(): ) # Make the request - operation = client.reschedule_maintenance(request=request) + operation = await client.reschedule_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_update_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_update_instance_async.py index 259c3f83a735..5a498344bf5c 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_update_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_update_instance_async.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. @@ -49,11 +49,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_upgrade_instance_async.py b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_upgrade_instance_async.py index b05f4c0816b7..9685f45feb8e 100644 --- a/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_upgrade_instance_async.py +++ b/packages/google-cloud-redis/samples/generated_samples/redis_v1beta1_generated_cloud_redis_upgrade_instance_async.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. @@ -45,11 +45,11 @@ async def sample_upgrade_instance(): ) # Make the request - operation = client.upgrade_instance(request=request) + operation = await client.upgrade_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-redis/setup.py b/packages/google-cloud-redis/setup.py index 7ce06dac9859..eaf0f2185b07 100644 --- a/packages/google-cloud-redis/setup.py +++ b/packages/google-cloud-redis/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. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,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, @@ -79,7 +79,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", @@ -90,7 +89,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-redis/testing/constraints-3.10.txt b/packages/google-cloud-redis/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-redis/testing/constraints-3.10.txt +++ b/packages/google-cloud-redis/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-redis/testing/constraints-3.9.txt b/packages/google-cloud-redis/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-redis/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/packages/google-cloud-redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index 9d8861df021a..4c12bcdae07c 100644 --- a/packages/google-cloud-redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/packages/google-cloud-redis/tests/unit/gapic/redis_v1/test_cloud_redis.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1797,11 +1791,7 @@ async def test_list_instances_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_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5488,7 +5478,7 @@ def test_list_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -5732,7 +5722,7 @@ def test_get_instance_rest_required_fields(request_type=cloud_redis.GetInstanceR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -5916,7 +5906,7 @@ def test_get_instance_auth_string_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_auth_string_rest_unset_required_fields(): @@ -6113,7 +6103,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -6300,7 +6290,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -6496,7 +6486,7 @@ def test_upgrade_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_upgrade_instance_rest_unset_required_fields(): @@ -6686,7 +6676,7 @@ def test_import_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_instance_rest_unset_required_fields(): @@ -6880,7 +6870,7 @@ def test_export_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_instance_rest_unset_required_fields(): @@ -7076,7 +7066,7 @@ def test_failover_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_failover_instance_rest_unset_required_fields(): @@ -7257,7 +7247,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -7441,7 +7431,7 @@ def test_reschedule_maintenance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reschedule_maintenance_rest_unset_required_fields(): diff --git a/packages/google-cloud-redis/tests/unit/gapic/redis_v1beta1/test_cloud_redis.py b/packages/google-cloud-redis/tests/unit/gapic/redis_v1beta1/test_cloud_redis.py index c6ca4c7688c3..5b8ded9c28f9 100644 --- a/packages/google-cloud-redis/tests/unit/gapic/redis_v1beta1/test_cloud_redis.py +++ b/packages/google-cloud-redis/tests/unit/gapic/redis_v1beta1/test_cloud_redis.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,19 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import re - -# 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 +import re from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1797,11 +1791,7 @@ async def test_list_instances_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_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5460,7 +5450,7 @@ def test_list_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -5705,7 +5695,7 @@ def test_get_instance_rest_required_fields(request_type=cloud_redis.GetInstanceR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -5890,7 +5880,7 @@ def test_get_instance_auth_string_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_auth_string_rest_unset_required_fields(): @@ -6087,7 +6077,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -6275,7 +6265,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -6471,7 +6461,7 @@ def test_upgrade_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_upgrade_instance_rest_unset_required_fields(): @@ -6661,7 +6651,7 @@ def test_import_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_instance_rest_unset_required_fields(): @@ -6855,7 +6845,7 @@ def test_export_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_instance_rest_unset_required_fields(): @@ -7051,7 +7041,7 @@ def test_failover_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_failover_instance_rest_unset_required_fields(): @@ -7232,7 +7222,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -7417,7 +7407,7 @@ def test_reschedule_maintenance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reschedule_maintenance_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/docs/conf.py b/packages/google-cloud-resource-manager/docs/conf.py index a89e68d65870..eeddf500ae5c 100644 --- a/packages/google-cloud-resource-manager/docs/conf.py +++ b/packages/google-cloud-resource-manager/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-resource-manager" -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-resource-manager/google/cloud/resourcemanager_v3/__init__.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/__init__.py index 9ec3b70ad65e..4fdd145f90f8 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/__init__.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/__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.folders import FoldersAsyncClient, FoldersClient from .services.organizations import OrganizationsAsyncClient, OrganizationsClient @@ -138,28 +132,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.resourcemanager_v3" - 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-resource-manager/google/cloud/resourcemanager_v3/services/folders/async_client.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/folders/async_client.py index 6bae7fa891bc..1709eafb3097 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/folders/async_client.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/folders/async_client.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. @@ -767,11 +767,11 @@ async def sample_create_folder(): ) # Make the request - operation = client.create_folder(request=request) + operation = await client.create_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -908,11 +908,11 @@ async def sample_update_folder(): ) # Make the request - operation = client.update_folder(request=request) + operation = await client.update_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1069,11 +1069,11 @@ async def sample_move_folder(): ) # Make the request - operation = client.move_folder(request=request) + operation = await client.move_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1215,11 +1215,11 @@ async def sample_delete_folder(): ) # Make the request - operation = client.delete_folder(request=request) + operation = await client.delete_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1351,11 +1351,11 @@ async def sample_undelete_folder(): ) # Make the request - operation = client.undelete_folder(request=request) + operation = await client.undelete_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/projects/async_client.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/projects/async_client.py index 44083cb79d34..1ed250493a89 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/projects/async_client.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/projects/async_client.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. @@ -764,11 +764,11 @@ async def sample_create_project(): ) # Make the request - operation = client.create_project(request=request) + operation = await client.create_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -899,11 +899,11 @@ async def sample_update_project(): ) # Make the request - operation = client.update_project(request=request) + operation = await client.update_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1059,11 +1059,11 @@ async def sample_move_project(): ) # Make the request - operation = client.move_project(request=request) + operation = await client.move_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1229,11 +1229,11 @@ async def sample_delete_project(): ) # Make the request - operation = client.delete_project(request=request) + operation = await client.delete_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1362,11 +1362,11 @@ async def sample_undelete_project(): ) # Make the request - operation = client.undelete_project(request=request) + operation = await client.undelete_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_bindings/async_client.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_bindings/async_client.py index 93d2a82053df..2ac1827c26ff 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_bindings/async_client.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_bindings/async_client.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. @@ -460,11 +460,11 @@ async def sample_create_tag_binding(): ) # Make the request - operation = client.create_tag_binding(request=request) + operation = await client.create_tag_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -581,11 +581,11 @@ async def sample_delete_tag_binding(): ) # Make the request - operation = client.delete_tag_binding(request=request) + operation = await client.delete_tag_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_holds/async_client.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_holds/async_client.py index abbd18218ff5..54e57c5fab28 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_holds/async_client.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_holds/async_client.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. @@ -334,11 +334,11 @@ async def sample_create_tag_hold(): ) # Make the request - operation = client.create_tag_hold(request=request) + operation = await client.create_tag_hold(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -469,11 +469,11 @@ async def sample_delete_tag_hold(): ) # Make the request - operation = client.delete_tag_hold(request=request) + operation = await client.delete_tag_hold(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_keys/async_client.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_keys/async_client.py index 898ca9622997..809c82f83063 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_keys/async_client.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_keys/async_client.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. @@ -677,11 +677,11 @@ async def sample_create_tag_key(): ) # Make the request - operation = client.create_tag_key(request=request) + operation = await client.create_tag_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -802,11 +802,11 @@ async def sample_update_tag_key(): ) # Make the request - operation = client.update_tag_key(request=request) + operation = await client.update_tag_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -945,11 +945,11 @@ async def sample_delete_tag_key(): ) # Make the request - operation = client.delete_tag_key(request=request) + operation = await client.delete_tag_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_values/async_client.py b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_values/async_client.py index 1b79e7e9aafa..81778cb919f8 100644 --- a/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_values/async_client.py +++ b/packages/google-cloud-resource-manager/google/cloud/resourcemanager_v3/services/tag_values/async_client.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. @@ -689,11 +689,11 @@ async def sample_create_tag_value(): ) # Make the request - operation = client.create_tag_value(request=request) + operation = await client.create_tag_value(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -814,11 +814,11 @@ async def sample_update_tag_value(): ) # Make the request - operation = client.update_tag_value(request=request) + operation = await client.update_tag_value(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -954,11 +954,11 @@ async def sample_delete_tag_value(): ) # Make the request - operation = client.delete_tag_value(request=request) + operation = await client.delete_tag_value(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/noxfile.py b/packages/google-cloud-resource-manager/noxfile.py index 19a87b36b89f..78a39a040491 100644 --- a/packages/google-cloud-resource-manager/noxfile.py +++ b/packages/google-cloud-resource-manager/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", @@ -390,7 +389,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-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_create_folder_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_create_folder_async.py index 856af3bba466..d9957160f8ac 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_create_folder_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_create_folder_async.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. @@ -47,11 +47,11 @@ async def sample_create_folder(): ) # Make the request - operation = client.create_folder(request=request) + operation = await client.create_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_delete_folder_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_delete_folder_async.py index a19ef2f07fe2..62144af764de 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_delete_folder_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_delete_folder_async.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. @@ -44,11 +44,11 @@ async def sample_delete_folder(): ) # Make the request - operation = client.delete_folder(request=request) + operation = await client.delete_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_move_folder_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_move_folder_async.py index 5b23fa4084ad..fb4b85a88533 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_move_folder_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_move_folder_async.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. @@ -45,11 +45,11 @@ async def sample_move_folder(): ) # Make the request - operation = client.move_folder(request=request) + operation = await client.move_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_undelete_folder_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_undelete_folder_async.py index 84534164bd34..8d7abb598545 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_undelete_folder_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_undelete_folder_async.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. @@ -44,11 +44,11 @@ async def sample_undelete_folder(): ) # Make the request - operation = client.undelete_folder(request=request) + operation = await client.undelete_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_update_folder_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_update_folder_async.py index 685299fdeebe..43ddabd792b0 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_update_folder_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_folders_update_folder_async.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. @@ -47,11 +47,11 @@ async def sample_update_folder(): ) # Make the request - operation = client.update_folder(request=request) + operation = await client.update_folder(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_create_project_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_create_project_async.py index 8c460fed6e79..cc43df57bf40 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_create_project_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_create_project_async.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. @@ -42,11 +42,11 @@ async def sample_create_project(): request = resourcemanager_v3.CreateProjectRequest() # Make the request - operation = client.create_project(request=request) + operation = await client.create_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_delete_project_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_delete_project_async.py index b0ea971c7d5d..2442797203e4 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_delete_project_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_delete_project_async.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. @@ -44,11 +44,11 @@ async def sample_delete_project(): ) # Make the request - operation = client.delete_project(request=request) + operation = await client.delete_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_move_project_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_move_project_async.py index 199a0b90a51b..5ccafdc0a931 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_move_project_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_move_project_async.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. @@ -45,11 +45,11 @@ async def sample_move_project(): ) # Make the request - operation = client.move_project(request=request) + operation = await client.move_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_undelete_project_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_undelete_project_async.py index 3afa000f8509..53d5c94c4f98 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_undelete_project_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_undelete_project_async.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. @@ -44,11 +44,11 @@ async def sample_undelete_project(): ) # Make the request - operation = client.undelete_project(request=request) + operation = await client.undelete_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_update_project_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_update_project_async.py index 3ea3913d0569..b71e104ddde9 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_update_project_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_projects_update_project_async.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. @@ -42,11 +42,11 @@ async def sample_update_project(): request = resourcemanager_v3.UpdateProjectRequest() # Make the request - operation = client.update_project(request=request) + operation = await client.update_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_create_tag_binding_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_create_tag_binding_async.py index 3df0a6012261..d2b97b951b78 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_create_tag_binding_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_create_tag_binding_async.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. @@ -42,11 +42,11 @@ async def sample_create_tag_binding(): request = resourcemanager_v3.CreateTagBindingRequest() # Make the request - operation = client.create_tag_binding(request=request) + operation = await client.create_tag_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_delete_tag_binding_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_delete_tag_binding_async.py index fb3246456db8..97a861450218 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_delete_tag_binding_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_bindings_delete_tag_binding_async.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. @@ -44,11 +44,11 @@ async def sample_delete_tag_binding(): ) # Make the request - operation = client.delete_tag_binding(request=request) + operation = await client.delete_tag_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_create_tag_hold_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_create_tag_hold_async.py index 800e96269a53..2d3e06f85557 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_create_tag_hold_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_create_tag_hold_async.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. @@ -48,11 +48,11 @@ async def sample_create_tag_hold(): ) # Make the request - operation = client.create_tag_hold(request=request) + operation = await client.create_tag_hold(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_delete_tag_hold_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_delete_tag_hold_async.py index 4b3a8bd80e2f..1545ad8d409c 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_delete_tag_hold_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_holds_delete_tag_hold_async.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. @@ -44,11 +44,11 @@ async def sample_delete_tag_hold(): ) # Make the request - operation = client.delete_tag_hold(request=request) + operation = await client.delete_tag_hold(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_create_tag_key_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_create_tag_key_async.py index 18d8b6fdbada..d1d46f4a83a8 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_create_tag_key_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_create_tag_key_async.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. @@ -47,11 +47,11 @@ async def sample_create_tag_key(): ) # Make the request - operation = client.create_tag_key(request=request) + operation = await client.create_tag_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_delete_tag_key_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_delete_tag_key_async.py index a5beca0befb2..dd4f430f9af8 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_delete_tag_key_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_delete_tag_key_async.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. @@ -44,11 +44,11 @@ async def sample_delete_tag_key(): ) # Make the request - operation = client.delete_tag_key(request=request) + operation = await client.delete_tag_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_update_tag_key_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_update_tag_key_async.py index 46e04465f5a8..86a3343fa68e 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_update_tag_key_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_keys_update_tag_key_async.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. @@ -47,11 +47,11 @@ async def sample_update_tag_key(): ) # Make the request - operation = client.update_tag_key(request=request) + operation = await client.update_tag_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_create_tag_value_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_create_tag_value_async.py index 308c1cd0f8b3..8bd090fe5034 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_create_tag_value_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_create_tag_value_async.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. @@ -47,11 +47,11 @@ async def sample_create_tag_value(): ) # Make the request - operation = client.create_tag_value(request=request) + operation = await client.create_tag_value(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_delete_tag_value_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_delete_tag_value_async.py index 0f6b579a9751..164fd549c335 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_delete_tag_value_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_delete_tag_value_async.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. @@ -44,11 +44,11 @@ async def sample_delete_tag_value(): ) # Make the request - operation = client.delete_tag_value(request=request) + operation = await client.delete_tag_value(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_update_tag_value_async.py b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_update_tag_value_async.py index 958ea3f9aae9..afb61cc7e29d 100644 --- a/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_update_tag_value_async.py +++ b/packages/google-cloud-resource-manager/samples/generated_samples/cloudresourcemanager_v3_generated_tag_values_update_tag_value_async.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. @@ -47,11 +47,11 @@ async def sample_update_tag_value(): ) # Make the request - operation = client.update_tag_value(request=request) + operation = await client.update_tag_value(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-resource-manager/setup.py b/packages/google-cloud-resource-manager/setup.py index bbb658dea565..341698810ad1 100644 --- a/packages/google-cloud-resource-manager/setup.py +++ b/packages/google-cloud-resource-manager/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. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +74,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, @@ -82,7 +82,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", @@ -93,7 +92,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-resource-manager/testing/constraints-3.10.txt b/packages/google-cloud-resource-manager/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-resource-manager/testing/constraints-3.10.txt +++ b/packages/google-cloud-resource-manager/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# 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-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 diff --git a/packages/google-cloud-resource-manager/testing/constraints-3.9.txt b/packages/google-cloud-resource-manager/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-resource-manager/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_folders.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_folders.py index 9c8a456f9a97..126bcadbb37a 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_folders.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_folders.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2035,11 +2029,7 @@ async def test_list_folders_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_folders(request={}) - ).pages: + async for page_ in (await client.list_folders(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2490,11 +2480,7 @@ async def test_search_folders_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.search_folders(request={}) - ).pages: + async for page_ in (await client.search_folders(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5246,7 +5232,7 @@ def test_get_folder_rest_required_fields(request_type=folders.GetFolderRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_folder_rest_unset_required_fields(): @@ -5438,7 +5424,7 @@ def test_list_folders_rest_required_fields(request_type=folders.ListFoldersReque ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_folders_rest_unset_required_fields(): @@ -5831,7 +5817,7 @@ def test_create_folder_rest_required_fields(request_type=folders.CreateFolderReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_folder_rest_unset_required_fields(): @@ -6000,7 +5986,7 @@ def test_update_folder_rest_required_fields(request_type=folders.UpdateFolderReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_folder_rest_unset_required_fields(): @@ -6188,7 +6174,7 @@ def test_move_folder_rest_required_fields(request_type=folders.MoveFolderRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_move_folder_rest_unset_required_fields(): @@ -6371,7 +6357,7 @@ def test_delete_folder_rest_required_fields(request_type=folders.DeleteFolderReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_folder_rest_unset_required_fields(): @@ -6547,7 +6533,7 @@ def test_undelete_folder_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undelete_folder_rest_unset_required_fields(): @@ -6720,7 +6706,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -6893,7 +6879,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -7082,7 +7068,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_organizations.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_organizations.py index 5b73efedc04c..f14efe6c13de 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_organizations.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_organizations.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2125,11 +2119,7 @@ async def test_search_organizations_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.search_organizations(request={}) - ).pages: + async for page_ in (await client.search_organizations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3297,7 +3287,7 @@ def test_get_organization_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_organization_rest_unset_required_fields(): @@ -3631,7 +3621,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -3805,7 +3795,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -3995,7 +3985,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_projects.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_projects.py index 081b352ca942..7fde7252bb7f 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_projects.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_projects.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2052,11 +2046,7 @@ async def test_list_projects_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_projects(request={}) - ).pages: + async for page_ in (await client.list_projects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2507,11 +2497,7 @@ async def test_search_projects_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.search_projects(request={}) - ).pages: + async for page_ in (await client.search_projects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5265,7 +5251,7 @@ def test_get_project_rest_required_fields(request_type=projects.GetProjectReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_project_rest_unset_required_fields(): @@ -5457,7 +5443,7 @@ def test_list_projects_rest_required_fields(request_type=projects.ListProjectsRe ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_projects_rest_unset_required_fields(): @@ -5854,7 +5840,7 @@ def test_create_project_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_project_rest_unset_required_fields(): @@ -6027,7 +6013,7 @@ def test_update_project_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_project_rest_unset_required_fields(): @@ -6207,7 +6193,7 @@ def test_move_project_rest_required_fields(request_type=projects.MoveProjectRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_move_project_rest_unset_required_fields(): @@ -6392,7 +6378,7 @@ def test_delete_project_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_project_rest_unset_required_fields(): @@ -6570,7 +6556,7 @@ def test_undelete_project_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undelete_project_rest_unset_required_fields(): @@ -6743,7 +6729,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -6916,7 +6902,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -7105,7 +7091,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_bindings.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_bindings.py index f35e7957fead..ae7cd2b8f8cc 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_bindings.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_bindings.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1749,11 +1743,7 @@ async def test_list_tag_bindings_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_tag_bindings(request={}) - ).pages: + async for page_ in (await client.list_tag_bindings(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2847,11 +2837,7 @@ async def test_list_effective_tags_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_effective_tags(request={}) - ).pages: + async for page_ in (await client.list_effective_tags(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2984,7 +2970,7 @@ def test_list_tag_bindings_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_tag_bindings_rest_unset_required_fields(): @@ -3235,7 +3221,7 @@ def test_create_tag_binding_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_tag_binding_rest_unset_required_fields(): @@ -3414,7 +3400,7 @@ def test_delete_tag_binding_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_tag_binding_rest_unset_required_fields(): @@ -3609,7 +3595,7 @@ def test_list_effective_tags_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_effective_tags_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_holds.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_holds.py index 161376d8d79f..90083e60447c 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_holds.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_holds.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2439,11 +2433,7 @@ async def test_list_tag_holds_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_tag_holds(request={}) - ).pages: + async for page_ in (await client.list_tag_holds(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2561,7 +2551,7 @@ def test_create_tag_hold_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_tag_hold_rest_unset_required_fields(): @@ -2748,7 +2738,7 @@ def test_delete_tag_hold_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_tag_hold_rest_unset_required_fields(): @@ -2930,7 +2920,7 @@ def test_list_tag_holds_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_tag_holds_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_keys.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_keys.py index 610f67657daf..7d9486f9e3a0 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_keys.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_keys.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1704,11 +1698,7 @@ async def test_list_tag_keys_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_tag_keys(request={}) - ).pages: + async for page_ in (await client.list_tag_keys(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4455,7 +4445,7 @@ def test_list_tag_keys_rest_required_fields(request_type=tag_keys.ListTagKeysReq ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_tag_keys_rest_unset_required_fields(): @@ -4697,7 +4687,7 @@ def test_get_tag_key_rest_required_fields(request_type=tag_keys.GetTagKeyRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_tag_key_rest_unset_required_fields(): @@ -4889,7 +4879,7 @@ def test_get_namespaced_tag_key_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_namespaced_tag_key_rest_unset_required_fields(): @@ -5062,7 +5052,7 @@ def test_create_tag_key_rest_required_fields(request_type=tag_keys.CreateTagKeyR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_tag_key_rest_unset_required_fields(): @@ -5236,7 +5226,7 @@ def test_update_tag_key_rest_required_fields(request_type=tag_keys.UpdateTagKeyR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_tag_key_rest_unset_required_fields(): @@ -5426,7 +5416,7 @@ def test_delete_tag_key_rest_required_fields(request_type=tag_keys.DeleteTagKeyR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_tag_key_rest_unset_required_fields(): @@ -5607,7 +5597,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -5780,7 +5770,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -5969,7 +5959,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_values.py b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_values.py index 4087b1feb7f1..82ae0b055029 100644 --- a/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_values.py +++ b/packages/google-cloud-resource-manager/tests/unit/gapic/resourcemanager_v3/test_tag_values.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1728,11 +1722,7 @@ async def test_list_tag_values_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_tag_values(request={}) - ).pages: + async for page_ in (await client.list_tag_values(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4480,7 +4470,7 @@ def test_list_tag_values_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_tag_values_rest_unset_required_fields(): @@ -4724,7 +4714,7 @@ def test_get_tag_value_rest_required_fields(request_type=tag_values.GetTagValueR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_tag_value_rest_unset_required_fields(): @@ -4916,7 +4906,7 @@ def test_get_namespaced_tag_value_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_namespaced_tag_value_rest_unset_required_fields(): @@ -5093,7 +5083,7 @@ def test_create_tag_value_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_tag_value_rest_unset_required_fields(): @@ -5273,7 +5263,7 @@ def test_update_tag_value_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_tag_value_rest_unset_required_fields(): @@ -5467,7 +5457,7 @@ def test_delete_tag_value_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_tag_value_rest_unset_required_fields(): @@ -5648,7 +5638,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -5822,7 +5812,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -6012,7 +6002,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/docs/conf.py b/packages/google-cloud-retail/docs/conf.py index 26f43b97aa23..cb19586a4d8f 100644 --- a/packages/google-cloud-retail/docs/conf.py +++ b/packages/google-cloud-retail/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-retail" -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-retail/google/cloud/retail_v2/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2/__init__.py index e2ec5e647770..963a4610b622 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_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.analytics_service import ( AnalyticsServiceAsyncClient, @@ -252,28 +246,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.retail_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-retail/google/cloud/retail_v2/services/analytics_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/analytics_service/async_client.py index 23dd6d6dade5..b1a68302cbc6 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/analytics_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/analytics_service/async_client.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. @@ -341,11 +341,11 @@ async def sample_export_analytics_metrics(): ) # Make the request - operation = client.export_analytics_metrics(request=request) + operation = await client.export_analytics_metrics(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/completion_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/completion_service/async_client.py index 42a2cedcf00d..52e16891670c 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/completion_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/completion_service/async_client.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. @@ -443,11 +443,11 @@ async def sample_import_completion_data(): ) # Make the request - operation = client.import_completion_data(request=request) + operation = await client.import_completion_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/model_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/model_service/async_client.py index 3c550c48d518..ff8c0d972ddf 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/model_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/model_service/async_client.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. @@ -350,11 +350,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1193,11 +1193,11 @@ async def sample_tune_model(): ) # Make the request - operation = client.tune_model(request=request) + operation = await client.tune_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py index 835af6653482..8672def4b350 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/product_service/async_client.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. @@ -1048,11 +1048,11 @@ async def sample_purge_products(): ) # Make the request - operation = client.purge_products(request=request) + operation = await client.purge_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1161,11 +1161,11 @@ async def sample_import_products(): ) # Make the request - operation = client.import_products(request=request) + operation = await client.import_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1321,11 +1321,11 @@ async def sample_set_inventory(): ) # Make the request - operation = client.set_inventory(request=request) + operation = await client.set_inventory(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1564,11 +1564,11 @@ async def sample_add_fulfillment_places(): ) # Make the request - operation = client.add_fulfillment_places(request=request) + operation = await client.add_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1733,11 +1733,11 @@ async def sample_remove_fulfillment_places(): ) # Make the request - operation = client.remove_fulfillment_places(request=request) + operation = await client.remove_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1900,11 +1900,11 @@ async def sample_add_local_inventories(): ) # Make the request - operation = client.add_local_inventories(request=request) + operation = await client.add_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2067,11 +2067,11 @@ async def sample_remove_local_inventories(): ) # Make the request - operation = client.remove_local_inventories(request=request) + operation = await client.remove_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py index d303e4294f18..024e327fe3a7 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2/services/user_event_service/async_client.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. @@ -583,11 +583,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -695,11 +695,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -810,11 +810,11 @@ async def sample_rejoin_user_events(): ) # Make the request - operation = client.rejoin_user_events(request=request) + operation = await client.rejoin_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py index dbda94b4caf8..e3981c3e52bb 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/__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.analytics_service import ( AnalyticsServiceAsyncClient, @@ -298,28 +292,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.retail_v2alpha" - 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-retail/google/cloud/retail_v2alpha/services/analytics_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/analytics_service/async_client.py index d13e30f237ed..c11f05a58210 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/analytics_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/analytics_service/async_client.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. @@ -341,11 +341,11 @@ async def sample_export_analytics_metrics(): ) # Make the request - operation = client.export_analytics_metrics(request=request) + operation = await client.export_analytics_metrics(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py index e46a3363893f..b4cc10e603c0 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.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. @@ -443,11 +443,11 @@ async def sample_import_completion_data(): ) # Make the request - operation = client.import_completion_data(request=request) + operation = await client.import_completion_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py index 08a041350590..4858a0f712b7 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/merchant_center_account_link_service/async_client.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. @@ -509,11 +509,11 @@ async def sample_create_merchant_center_account_link(): ) # Make the request - operation = client.create_merchant_center_account_link(request=request) + operation = await client.create_merchant_center_account_link(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py index e98e3e488815..90dd73e7f18e 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.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. @@ -353,11 +353,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1201,11 +1201,11 @@ async def sample_tune_model(): ) # Make the request - operation = client.tune_model(request=request) + operation = await client.tune_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py index 8419fb4ae522..b54e4fc53dc9 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.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. @@ -1052,11 +1052,11 @@ async def sample_purge_products(): ) # Make the request - operation = client.purge_products(request=request) + operation = await client.purge_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1165,11 +1165,11 @@ async def sample_import_products(): ) # Make the request - operation = client.import_products(request=request) + operation = await client.import_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1273,11 +1273,11 @@ async def sample_export_products(): ) # Make the request - operation = client.export_products(request=request) + operation = await client.export_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1432,11 +1432,11 @@ async def sample_set_inventory(): ) # Make the request - operation = client.set_inventory(request=request) + operation = await client.set_inventory(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1676,11 +1676,11 @@ async def sample_add_fulfillment_places(): ) # Make the request - operation = client.add_fulfillment_places(request=request) + operation = await client.add_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1845,11 +1845,11 @@ async def sample_remove_fulfillment_places(): ) # Make the request - operation = client.remove_fulfillment_places(request=request) + operation = await client.remove_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2012,11 +2012,11 @@ async def sample_add_local_inventories(): ) # Make the request - operation = client.add_local_inventories(request=request) + operation = await client.add_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2179,11 +2179,11 @@ async def sample_remove_local_inventories(): ) # Make the request - operation = client.remove_local_inventories(request=request) + operation = await client.remove_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/project_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/project_service/async_client.py index 177d54f1563e..37ad3decc0d2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/project_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/project_service/async_client.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. @@ -573,11 +573,11 @@ async def sample_enroll_solution(): ) # Make the request - operation = client.enroll_solution(request=request) + operation = await client.enroll_solution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py index 261173c337c8..55257b4656ef 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.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. @@ -584,11 +584,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -696,11 +696,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -806,11 +806,11 @@ async def sample_export_user_events(): ) # Make the request - operation = client.export_user_events(request=request) + operation = await client.export_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -920,11 +920,11 @@ async def sample_rejoin_user_events(): ) # Make the request - operation = client.rejoin_user_events(request=request) + operation = await client.rejoin_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py index ee6d4d07be5d..40b56c721de0 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/__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.analytics_service import ( AnalyticsServiceAsyncClient, @@ -264,28 +258,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.retail_v2beta" - 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-retail/google/cloud/retail_v2beta/services/analytics_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/analytics_service/async_client.py index daccf854107e..7cdb46352c7c 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/analytics_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/analytics_service/async_client.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. @@ -341,11 +341,11 @@ async def sample_export_analytics_metrics(): ) # Make the request - operation = client.export_analytics_metrics(request=request) + operation = await client.export_analytics_metrics(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/completion_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/completion_service/async_client.py index 86479aa84b9c..578787f7811d 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/completion_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/completion_service/async_client.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. @@ -443,11 +443,11 @@ async def sample_import_completion_data(): ) # Make the request - operation = client.import_completion_data(request=request) + operation = await client.import_completion_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/model_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/model_service/async_client.py index 55b3790d9561..019ce7afc1b3 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/model_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/model_service/async_client.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. @@ -350,11 +350,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1195,11 +1195,11 @@ async def sample_tune_model(): ) # Make the request - operation = client.tune_model(request=request) + operation = await client.tune_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/product_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/product_service/async_client.py index ec6f63d1485f..71dc4d574de2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/product_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/product_service/async_client.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. @@ -1051,11 +1051,11 @@ async def sample_purge_products(): ) # Make the request - operation = client.purge_products(request=request) + operation = await client.purge_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1164,11 +1164,11 @@ async def sample_import_products(): ) # Make the request - operation = client.import_products(request=request) + operation = await client.import_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1271,11 +1271,11 @@ async def sample_export_products(): ) # Make the request - operation = client.export_products(request=request) + operation = await client.export_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1430,11 +1430,11 @@ async def sample_set_inventory(): ) # Make the request - operation = client.set_inventory(request=request) + operation = await client.set_inventory(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1673,11 +1673,11 @@ async def sample_add_fulfillment_places(): ) # Make the request - operation = client.add_fulfillment_places(request=request) + operation = await client.add_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1842,11 +1842,11 @@ async def sample_remove_fulfillment_places(): ) # Make the request - operation = client.remove_fulfillment_places(request=request) + operation = await client.remove_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2009,11 +2009,11 @@ async def sample_add_local_inventories(): ) # Make the request - operation = client.add_local_inventories(request=request) + operation = await client.add_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2176,11 +2176,11 @@ async def sample_remove_local_inventories(): ) # Make the request - operation = client.remove_local_inventories(request=request) + operation = await client.remove_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/user_event_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/user_event_service/async_client.py index 9da5f87601dd..cd590387e3ca 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/services/user_event_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/services/user_event_service/async_client.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. @@ -584,11 +584,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -696,11 +696,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -806,11 +806,11 @@ async def sample_export_user_events(): ) # Make the request - operation = client.export_user_events(request=request) + operation = await client.export_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -920,11 +920,11 @@ async def sample_rejoin_user_events(): ) # Make the request - operation = client.rejoin_user_events(request=request) + operation = await client.rejoin_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/noxfile.py b/packages/google-cloud-retail/noxfile.py index d281dc7ac174..d9a7146b882f 100644 --- a/packages/google-cloud-retail/noxfile.py +++ b/packages/google-cloud-retail/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", @@ -390,7 +389,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-retail/samples/generated_samples/retail_v2_generated_analytics_service_export_analytics_metrics_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_analytics_service_export_analytics_metrics_async.py index 23eafd1f4992..426b37fdaa38 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_analytics_service_export_analytics_metrics_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_analytics_service_export_analytics_metrics_async.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. @@ -48,11 +48,11 @@ async def sample_export_analytics_metrics(): ) # Make the request - operation = client.export_analytics_metrics(request=request) + operation = await client.export_analytics_metrics(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py index 4048dedb423e..2f39ded9b7b0 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_completion_service_import_completion_data_async.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. @@ -49,11 +49,11 @@ async def sample_import_completion_data(): ) # Make the request - operation = client.import_completion_data(request=request) + operation = await client.import_completion_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_create_model_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_create_model_async.py index 5d846399cf77..fc8833a1144e 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_create_model_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_create_model_async.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. @@ -50,11 +50,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_tune_model_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_tune_model_async.py index a04978ce2302..a3c2b23892a4 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_tune_model_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_model_service_tune_model_async.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. @@ -44,11 +44,11 @@ async def sample_tune_model(): ) # Make the request - operation = client.tune_model(request=request) + operation = await client.tune_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py index 3023a7aa2679..5c9f1fe5837d 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_fulfillment_places_async.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. @@ -46,11 +46,11 @@ async def sample_add_fulfillment_places(): ) # Make the request - operation = client.add_fulfillment_places(request=request) + operation = await client.add_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py index b57115cda839..227b90f48342 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_add_local_inventories_async.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. @@ -44,11 +44,11 @@ async def sample_add_local_inventories(): ) # Make the request - operation = client.add_local_inventories(request=request) + operation = await client.add_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py index 165a1b61da07..3c4b420fadde 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_import_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_import_products_async.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. @@ -48,11 +48,11 @@ async def sample_import_products(): ) # Make the request - operation = client.import_products(request=request) + operation = await client.import_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_purge_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_purge_products_async.py index ee87b5fc1d1d..53d78248ba20 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_purge_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_purge_products_async.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. @@ -45,11 +45,11 @@ async def sample_purge_products(): ) # Make the request - operation = client.purge_products(request=request) + operation = await client.purge_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py index 4099d8f10284..c132cbc6def2 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_fulfillment_places_async.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. @@ -46,11 +46,11 @@ async def sample_remove_fulfillment_places(): ) # Make the request - operation = client.remove_fulfillment_places(request=request) + operation = await client.remove_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py index 1e826b7bf858..0a7e4375602b 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_remove_local_inventories_async.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. @@ -45,11 +45,11 @@ async def sample_remove_local_inventories(): ) # Make the request - operation = client.remove_local_inventories(request=request) + operation = await client.remove_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py index aa9df850bb31..fe3671f7b3e9 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_product_service_set_inventory_async.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. @@ -47,11 +47,11 @@ async def sample_set_inventory(): ) # Make the request - operation = client.set_inventory(request=request) + operation = await client.set_inventory(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py index 74a77de7f55e..e5a6d2e1523d 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_import_user_events_async.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. @@ -49,11 +49,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py index eab880c1dc16..357bc2e52710 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_purge_user_events_async.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. @@ -45,11 +45,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py index e079f3b6a6bd..81de938aa5ce 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2_generated_user_event_service_rejoin_user_events_async.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. @@ -44,11 +44,11 @@ async def sample_rejoin_user_events(): ) # Make the request - operation = client.rejoin_user_events(request=request) + operation = await client.rejoin_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_analytics_service_export_analytics_metrics_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_analytics_service_export_analytics_metrics_async.py index 76ef918df79b..297eea77795a 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_analytics_service_export_analytics_metrics_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_analytics_service_export_analytics_metrics_async.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. @@ -48,11 +48,11 @@ async def sample_export_analytics_metrics(): ) # Make the request - operation = client.export_analytics_metrics(request=request) + operation = await client.export_analytics_metrics(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py index 740c09770930..2a15d4276daa 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_completion_service_import_completion_data_async.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. @@ -49,11 +49,11 @@ async def sample_import_completion_data(): ) # Make the request - operation = client.import_completion_data(request=request) + operation = await client.import_completion_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_merchant_center_account_link_service_create_merchant_center_account_link_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_merchant_center_account_link_service_create_merchant_center_account_link_async.py index 6a5ef0b8e454..f88126bf81f1 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_merchant_center_account_link_service_create_merchant_center_account_link_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_merchant_center_account_link_service_create_merchant_center_account_link_async.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. @@ -49,11 +49,11 @@ async def sample_create_merchant_center_account_link(): ) # Make the request - operation = client.create_merchant_center_account_link(request=request) + operation = await client.create_merchant_center_account_link(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py index d601392e7cf8..2144e0eb02f8 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.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. @@ -59,11 +59,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py index 2e49fd2ed949..870ebbf2e4a6 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.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. @@ -44,11 +44,11 @@ async def sample_tune_model(): ) # Make the request - operation = client.tune_model(request=request) + operation = await client.tune_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py index 7216db0ebf70..b4f9d2d592a4 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_fulfillment_places_async.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. @@ -46,11 +46,11 @@ async def sample_add_fulfillment_places(): ) # Make the request - operation = client.add_fulfillment_places(request=request) + operation = await client.add_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py index 87fc2a80247a..2ac1ff100b79 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_add_local_inventories_async.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. @@ -44,11 +44,11 @@ async def sample_add_local_inventories(): ) # Make the request - operation = client.add_local_inventories(request=request) + operation = await client.add_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_export_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_export_products_async.py index d31db1ab8bba..15437337392c 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_export_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_export_products_async.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. @@ -48,11 +48,11 @@ async def sample_export_products(): ) # Make the request - operation = client.export_products(request=request) + operation = await client.export_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py index ab1e3a732288..fb8b14ff9a40 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_import_products_async.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. @@ -48,11 +48,11 @@ async def sample_import_products(): ) # Make the request - operation = client.import_products(request=request) + operation = await client.import_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py index 470acbdca1cc..549b320bece0 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_purge_products_async.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. @@ -45,11 +45,11 @@ async def sample_purge_products(): ) # Make the request - operation = client.purge_products(request=request) + operation = await client.purge_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py index 473220718d25..968ce0c2b25f 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_fulfillment_places_async.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. @@ -46,11 +46,11 @@ async def sample_remove_fulfillment_places(): ) # Make the request - operation = client.remove_fulfillment_places(request=request) + operation = await client.remove_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py index ee77bcbb8400..44b834b9f4a0 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_remove_local_inventories_async.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. @@ -45,11 +45,11 @@ async def sample_remove_local_inventories(): ) # Make the request - operation = client.remove_local_inventories(request=request) + operation = await client.remove_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py index ad7f458e643a..946a54588d3b 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_product_service_set_inventory_async.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. @@ -47,11 +47,11 @@ async def sample_set_inventory(): ) # Make the request - operation = client.set_inventory(request=request) + operation = await client.set_inventory(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_project_service_enroll_solution_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_project_service_enroll_solution_async.py index 823df9ac3c14..e9e95afb9a4b 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_project_service_enroll_solution_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_project_service_enroll_solution_async.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. @@ -45,11 +45,11 @@ async def sample_enroll_solution(): ) # Make the request - operation = client.enroll_solution(request=request) + operation = await client.enroll_solution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_export_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_export_user_events_async.py index f5128f6a9c73..859a522393de 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_export_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_export_user_events_async.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. @@ -48,11 +48,11 @@ async def sample_export_user_events(): ) # Make the request - operation = client.export_user_events(request=request) + operation = await client.export_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py index 9aabd6e9fd13..538040618fed 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_import_user_events_async.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. @@ -49,11 +49,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py index f56729e94e95..69d556dfd0ef 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_purge_user_events_async.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. @@ -45,11 +45,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py index aa127b6c2b1b..b0dce70e085b 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_rejoin_user_events_async.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. @@ -44,11 +44,11 @@ async def sample_rejoin_user_events(): ) # Make the request - operation = client.rejoin_user_events(request=request) + operation = await client.rejoin_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_analytics_service_export_analytics_metrics_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_analytics_service_export_analytics_metrics_async.py index 32ffd43d2e57..43e9bbd95cb6 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_analytics_service_export_analytics_metrics_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_analytics_service_export_analytics_metrics_async.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. @@ -48,11 +48,11 @@ async def sample_export_analytics_metrics(): ) # Make the request - operation = client.export_analytics_metrics(request=request) + operation = await client.export_analytics_metrics(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py index af852b192d35..cc26fb38c5f8 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_completion_service_import_completion_data_async.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. @@ -49,11 +49,11 @@ async def sample_import_completion_data(): ) # Make the request - operation = client.import_completion_data(request=request) + operation = await client.import_completion_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py index d729f1c13ace..0ff7ad1ee77e 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.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. @@ -50,11 +50,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py index 327d1199bcee..b3d5fd8f8428 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_model_service_tune_model_async.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. @@ -44,11 +44,11 @@ async def sample_tune_model(): ) # Make the request - operation = client.tune_model(request=request) + operation = await client.tune_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py index f9620cefe93d..0fbfaa4f8e54 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_fulfillment_places_async.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. @@ -46,11 +46,11 @@ async def sample_add_fulfillment_places(): ) # Make the request - operation = client.add_fulfillment_places(request=request) + operation = await client.add_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py index 64ac1d0be97c..f9dd34f11e61 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_add_local_inventories_async.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. @@ -44,11 +44,11 @@ async def sample_add_local_inventories(): ) # Make the request - operation = client.add_local_inventories(request=request) + operation = await client.add_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_export_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_export_products_async.py index ed248b8160d4..1dd60c780ccc 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_export_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_export_products_async.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. @@ -48,11 +48,11 @@ async def sample_export_products(): ) # Make the request - operation = client.export_products(request=request) + operation = await client.export_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py index 78af608f2d51..a3eb1583cb1e 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_import_products_async.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. @@ -48,11 +48,11 @@ async def sample_import_products(): ) # Make the request - operation = client.import_products(request=request) + operation = await client.import_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_purge_products_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_purge_products_async.py index 22b8eb68e5e4..91c306186225 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_purge_products_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_purge_products_async.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. @@ -45,11 +45,11 @@ async def sample_purge_products(): ) # Make the request - operation = client.purge_products(request=request) + operation = await client.purge_products(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py index d9a8679f025b..34c74e6a2a83 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_fulfillment_places_async.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. @@ -46,11 +46,11 @@ async def sample_remove_fulfillment_places(): ) # Make the request - operation = client.remove_fulfillment_places(request=request) + operation = await client.remove_fulfillment_places(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py index 44a187504f1f..038edc737703 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_remove_local_inventories_async.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. @@ -45,11 +45,11 @@ async def sample_remove_local_inventories(): ) # Make the request - operation = client.remove_local_inventories(request=request) + operation = await client.remove_local_inventories(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py index aa089516b0b5..5a2d6f788824 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_product_service_set_inventory_async.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. @@ -47,11 +47,11 @@ async def sample_set_inventory(): ) # Make the request - operation = client.set_inventory(request=request) + operation = await client.set_inventory(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_export_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_export_user_events_async.py index 6714ed2720a8..505ef1c8a76b 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_export_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_export_user_events_async.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. @@ -48,11 +48,11 @@ async def sample_export_user_events(): ) # Make the request - operation = client.export_user_events(request=request) + operation = await client.export_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py index d4491cde44fe..4a3be8886497 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_import_user_events_async.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. @@ -49,11 +49,11 @@ async def sample_import_user_events(): ) # Make the request - operation = client.import_user_events(request=request) + operation = await client.import_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py index f26cc2c6ae14..077d2213019d 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_purge_user_events_async.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. @@ -45,11 +45,11 @@ async def sample_purge_user_events(): ) # Make the request - operation = client.purge_user_events(request=request) + operation = await client.purge_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py index 0a06f9e8cafc..bda41f97db35 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2beta_generated_user_event_service_rejoin_user_events_async.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. @@ -44,11 +44,11 @@ async def sample_rejoin_user_events(): ) # Make the request - operation = client.rejoin_user_events(request=request) + operation = await client.rejoin_user_events(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-retail/setup.py b/packages/google-cloud-retail/setup.py index ab353eea0960..2ac0f84dbf7d 100644 --- a/packages/google-cloud-retail/setup.py +++ b/packages/google-cloud-retail/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. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,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, @@ -79,7 +79,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", @@ -90,7 +89,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-retail/testing/constraints-3.10.txt b/packages/google-cloud-retail/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-retail/testing/constraints-3.10.txt +++ b/packages/google-cloud-retail/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# 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-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-retail/testing/constraints-3.9.txt b/packages/google-cloud-retail/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-retail/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_analytics_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_analytics_service.py index 1914b6c9b0c5..63c355311076 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_analytics_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_analytics_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1726,7 +1720,7 @@ def test_export_analytics_metrics_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_analytics_metrics_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_catalog_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_catalog_service.py index ae2e58021b3f..1e0cccd681a3 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_catalog_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_catalog_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1828,11 +1822,7 @@ async def test_list_catalogs_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_catalogs(request={}) - ).pages: + async for page_ in (await client.list_catalogs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5261,7 +5251,7 @@ def test_list_catalogs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_catalogs_rest_unset_required_fields(): @@ -5507,7 +5497,7 @@ def test_update_catalog_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_catalog_rest_unset_required_fields(): @@ -5892,7 +5882,7 @@ def test_get_completion_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_completion_config_rest_unset_required_fields(): @@ -6075,7 +6065,7 @@ def test_update_completion_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_completion_config_rest_unset_required_fields(): @@ -6264,7 +6254,7 @@ def test_get_attributes_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_attributes_config_rest_unset_required_fields(): @@ -6447,7 +6437,7 @@ def test_update_attributes_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_attributes_config_rest_unset_required_fields(): @@ -6637,7 +6627,7 @@ def test_add_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_catalog_attribute_rest_unset_required_fields(): @@ -6775,7 +6765,7 @@ def test_remove_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_catalog_attribute_rest_unset_required_fields(): @@ -6909,7 +6899,7 @@ def test_replace_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_replace_catalog_attribute_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_completion_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_completion_service.py index c7e6d3f045ec..f940e2b6e2b0 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_completion_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_completion_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2006,7 +2000,7 @@ def test_complete_query_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_complete_query_rest_unset_required_fields(): @@ -2152,7 +2146,7 @@ def test_import_completion_data_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_completion_data_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_control_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_control_service.py index a2b5014c8117..c87b741127da 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_control_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_control_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3233,11 +3227,7 @@ async def test_list_controls_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_controls(request={}) - ).pages: + async for page_ in (await client.list_controls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3367,7 +3357,7 @@ def test_create_control_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_control_rest_unset_required_fields(): @@ -3561,7 +3551,7 @@ def test_delete_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_control_rest_unset_required_fields(): @@ -3737,7 +3727,7 @@ def test_update_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_control_rest_unset_required_fields(): @@ -3925,7 +3915,7 @@ def test_get_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_control_rest_unset_required_fields(): @@ -4113,7 +4103,7 @@ def test_list_controls_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_controls_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_conversational_search_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_conversational_search_service.py index 8d0ec1d0cee8..28a9edba67e0 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_conversational_search_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_conversational_search_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1822,7 +1816,7 @@ def test_conversational_search_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_conversational_search_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_generative_question_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_generative_question_service.py index 63632da78138..ac186fd135cf 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_generative_question_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_generative_question_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3395,7 +3389,7 @@ def test_update_generative_questions_feature_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_generative_questions_feature_config_rest_unset_required_fields(): @@ -3604,7 +3598,7 @@ def test_get_generative_questions_feature_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_generative_questions_feature_config_rest_unset_required_fields(): @@ -3799,7 +3793,7 @@ def test_list_generative_question_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_generative_question_configs_rest_unset_required_fields(): @@ -3990,7 +3984,7 @@ def test_update_generative_question_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_generative_question_config_rest_unset_required_fields(): @@ -4193,7 +4187,7 @@ def test_batch_update_generative_question_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_update_generative_question_configs_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_model_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_model_service.py index 034fc9e8f98e..be6594170091 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_model_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_model_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3555,11 +3549,7 @@ async def test_list_models_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_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4375,7 +4365,7 @@ def test_create_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -4561,7 +4551,7 @@ def test_get_model_rest_required_fields(request_type=model_service.GetModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -4740,7 +4730,7 @@ def test_pause_model_rest_required_fields(request_type=model_service.PauseModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_pause_model_rest_unset_required_fields(): @@ -4921,7 +4911,7 @@ def test_resume_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_resume_model_rest_unset_required_fields(): @@ -5098,7 +5088,7 @@ def test_delete_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -5281,7 +5271,7 @@ def test_list_models_rest_required_fields(request_type=model_service.ListModelsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -5530,7 +5520,7 @@ def test_update_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_model_rest_unset_required_fields(): @@ -5714,7 +5704,7 @@ def test_tune_model_rest_required_fields(request_type=model_service.TuneModelReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_tune_model_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_prediction_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_prediction_service.py index cbd26f9dd605..0e5f04cc5808 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_prediction_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_prediction_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1721,7 +1715,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_product_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_product_service.py index 1d758e256a43..9c0ee7593816 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_product_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_product_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2647,11 +2641,7 @@ async def test_list_products_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_products(request={}) - ).pages: + async for page_ in (await client.list_products(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5714,7 +5704,7 @@ def test_create_product_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_product_rest_unset_required_fields(): @@ -5911,7 +5901,7 @@ def test_get_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_product_rest_unset_required_fields(): @@ -6100,7 +6090,7 @@ def test_list_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_products_rest_unset_required_fields(): @@ -6358,7 +6348,7 @@ def test_update_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_product_rest_unset_required_fields(): @@ -6551,7 +6541,7 @@ def test_delete_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_product_rest_unset_required_fields(): @@ -6735,7 +6725,7 @@ def test_purge_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_products_rest_unset_required_fields(): @@ -6865,7 +6855,7 @@ def test_import_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_products_rest_unset_required_fields(): @@ -6990,7 +6980,7 @@ def test_set_inventory_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_inventory_rest_unset_required_fields(): @@ -7187,7 +7177,7 @@ def test_add_fulfillment_places_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_fulfillment_places_rest_unset_required_fields(): @@ -7389,7 +7379,7 @@ def test_remove_fulfillment_places_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_fulfillment_places_rest_unset_required_fields(): @@ -7583,7 +7573,7 @@ def test_add_local_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_local_inventories_rest_unset_required_fields(): @@ -7780,7 +7770,7 @@ def test_remove_local_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_local_inventories_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_search_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_search_service.py index efadfecbdbc3..5422b197408f 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_search_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_search_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1780,11 +1774,7 @@ async def test_search_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.search(request={}) - ).pages: + async for page_ in (await client.search(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1901,7 +1891,7 @@ def test_search_rest_required_fields(request_type=search_service.SearchRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_serving_config_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_serving_config_service.py index ae225b1c20c5..a0a3212591d5 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_serving_config_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_serving_config_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3539,11 +3533,7 @@ async def test_list_serving_configs_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_serving_configs(request={}) - ).pages: + async for page_ in (await client.list_serving_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4486,7 +4476,7 @@ def test_create_serving_config_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_serving_config_rest_unset_required_fields(): @@ -4681,7 +4671,7 @@ def test_delete_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_serving_config_rest_unset_required_fields(): @@ -4862,7 +4852,7 @@ def test_update_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_serving_config_rest_unset_required_fields(): @@ -5050,7 +5040,7 @@ def test_get_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_serving_config_rest_unset_required_fields(): @@ -5243,7 +5233,7 @@ def test_list_serving_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_serving_configs_rest_unset_required_fields(): @@ -5504,7 +5494,7 @@ def test_add_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_control_rest_unset_required_fields(): @@ -5697,7 +5687,7 @@ def test_remove_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_control_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_user_event_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_user_event_service.py index bf8b176dcbad..19474f782c17 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_user_event_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2/test_user_event_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2822,7 +2816,7 @@ def test_write_user_event_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_write_user_event_rest_unset_required_fields(): @@ -2975,7 +2969,7 @@ def test_collect_user_event_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_collect_user_event_rest_unset_required_fields(): @@ -3119,7 +3113,7 @@ def test_purge_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_user_events_rest_unset_required_fields(): @@ -3253,7 +3247,7 @@ def test_import_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_user_events_rest_unset_required_fields(): @@ -3387,7 +3381,7 @@ def test_rejoin_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_rejoin_user_events_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_analytics_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_analytics_service.py index 7607d31f65a6..5ec4a9aa5525 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_analytics_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_analytics_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1726,7 +1720,7 @@ def test_export_analytics_metrics_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_analytics_metrics_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_branch_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_branch_service.py index 170fa29eefec..32171a7514eb 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_branch_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_branch_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2063,7 +2057,7 @@ def test_list_branches_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_branches_rest_unset_required_fields(): @@ -2243,7 +2237,7 @@ def test_get_branch_rest_required_fields(request_type=branch_service.GetBranchRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_branch_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py index 7afe8a959430..b7c3790484d7 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1833,11 +1827,7 @@ async def test_list_catalogs_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_catalogs(request={}) - ).pages: + async for page_ in (await client.list_catalogs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5527,7 +5517,7 @@ def test_list_catalogs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_catalogs_rest_unset_required_fields(): @@ -5774,7 +5764,7 @@ def test_update_catalog_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_catalog_rest_unset_required_fields(): @@ -6159,7 +6149,7 @@ def test_get_completion_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_completion_config_rest_unset_required_fields(): @@ -6342,7 +6332,7 @@ def test_update_completion_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_completion_config_rest_unset_required_fields(): @@ -6531,7 +6521,7 @@ def test_get_attributes_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_attributes_config_rest_unset_required_fields(): @@ -6714,7 +6704,7 @@ def test_update_attributes_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_attributes_config_rest_unset_required_fields(): @@ -6904,7 +6894,7 @@ def test_add_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_catalog_attribute_rest_unset_required_fields(): @@ -7042,7 +7032,7 @@ def test_remove_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_catalog_attribute_rest_unset_required_fields(): @@ -7182,7 +7172,7 @@ def test_batch_remove_catalog_attributes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_remove_catalog_attributes_rest_unset_required_fields(): @@ -7318,7 +7308,7 @@ def test_replace_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_replace_catalog_attribute_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_completion_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_completion_service.py index 87dc7f1fa6e9..2d5a78f0a2dc 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_completion_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_completion_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2006,7 +2000,7 @@ def test_complete_query_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_complete_query_rest_unset_required_fields(): @@ -2152,7 +2146,7 @@ def test_import_completion_data_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_completion_data_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_control_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_control_service.py index d32608999066..51ace5fd8df0 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_control_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_control_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3286,11 +3280,7 @@ async def test_list_controls_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_controls(request={}) - ).pages: + async for page_ in (await client.list_controls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3420,7 +3410,7 @@ def test_create_control_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_control_rest_unset_required_fields(): @@ -3622,7 +3612,7 @@ def test_delete_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_control_rest_unset_required_fields(): @@ -3798,7 +3788,7 @@ def test_update_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_control_rest_unset_required_fields(): @@ -3994,7 +3984,7 @@ def test_get_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_control_rest_unset_required_fields(): @@ -4182,7 +4172,7 @@ def test_list_controls_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_controls_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_conversational_search_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_conversational_search_service.py index edd55937737f..1c13e4a9f211 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_conversational_search_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_conversational_search_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1822,7 +1816,7 @@ def test_conversational_search_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_conversational_search_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_generative_question_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_generative_question_service.py index d9d00bcb4bdf..3d87f41d8ba6 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_generative_question_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_generative_question_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3395,7 +3389,7 @@ def test_update_generative_questions_feature_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_generative_questions_feature_config_rest_unset_required_fields(): @@ -3604,7 +3598,7 @@ def test_get_generative_questions_feature_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_generative_questions_feature_config_rest_unset_required_fields(): @@ -3799,7 +3793,7 @@ def test_list_generative_question_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_generative_question_configs_rest_unset_required_fields(): @@ -3990,7 +3984,7 @@ def test_update_generative_question_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_generative_question_config_rest_unset_required_fields(): @@ -4193,7 +4187,7 @@ def test_batch_update_generative_question_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_update_generative_question_configs_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_merchant_center_account_link_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_merchant_center_account_link_service.py index 4b757799a722..cece18c58023 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_merchant_center_account_link_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_merchant_center_account_link_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2654,7 +2648,7 @@ def test_list_merchant_center_account_links_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_merchant_center_account_links_rest_unset_required_fields(): @@ -2847,7 +2841,7 @@ def test_create_merchant_center_account_link_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_merchant_center_account_link_rest_unset_required_fields(): @@ -3045,7 +3039,7 @@ def test_delete_merchant_center_account_link_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_merchant_center_account_link_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_model_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_model_service.py index b1a9c9fee38d..94f1e2867668 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_model_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_model_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3579,11 +3573,7 @@ async def test_list_models_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_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4423,7 +4413,7 @@ def test_create_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -4617,7 +4607,7 @@ def test_get_model_rest_required_fields(request_type=model_service.GetModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -4796,7 +4786,7 @@ def test_pause_model_rest_required_fields(request_type=model_service.PauseModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_pause_model_rest_unset_required_fields(): @@ -4977,7 +4967,7 @@ def test_resume_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_resume_model_rest_unset_required_fields(): @@ -5154,7 +5144,7 @@ def test_delete_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -5337,7 +5327,7 @@ def test_list_models_rest_required_fields(request_type=model_service.ListModelsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -5586,7 +5576,7 @@ def test_update_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_model_rest_unset_required_fields(): @@ -5778,7 +5768,7 @@ def test_tune_model_rest_required_fields(request_type=model_service.TuneModelReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_tune_model_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_prediction_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_prediction_service.py index 3f0104c69ed2..36bf9519ed85 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_prediction_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_prediction_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1721,7 +1715,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_product_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_product_service.py index 7ec69fbbed09..b629479a048b 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_product_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_product_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2652,11 +2646,7 @@ async def test_list_products_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_products(request={}) - ).pages: + async for page_ in (await client.list_products(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5966,7 +5956,7 @@ def test_create_product_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_product_rest_unset_required_fields(): @@ -6163,7 +6153,7 @@ def test_get_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_product_rest_unset_required_fields(): @@ -6353,7 +6343,7 @@ def test_list_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_products_rest_unset_required_fields(): @@ -6612,7 +6602,7 @@ def test_update_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_product_rest_unset_required_fields(): @@ -6807,7 +6797,7 @@ def test_delete_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_product_rest_unset_required_fields(): @@ -6991,7 +6981,7 @@ def test_purge_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_products_rest_unset_required_fields(): @@ -7121,7 +7111,7 @@ def test_import_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_products_rest_unset_required_fields(): @@ -7251,7 +7241,7 @@ def test_export_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_products_rest_unset_required_fields(): @@ -7376,7 +7366,7 @@ def test_set_inventory_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_inventory_rest_unset_required_fields(): @@ -7573,7 +7563,7 @@ def test_add_fulfillment_places_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_fulfillment_places_rest_unset_required_fields(): @@ -7775,7 +7765,7 @@ def test_remove_fulfillment_places_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_fulfillment_places_rest_unset_required_fields(): @@ -7969,7 +7959,7 @@ def test_add_local_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_local_inventories_rest_unset_required_fields(): @@ -8166,7 +8156,7 @@ def test_remove_local_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_local_inventories_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_project_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_project_service.py index 5cab57587472..846c4f275a44 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_project_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_project_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -4030,7 +4024,7 @@ def test_get_project_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_project_rest_unset_required_fields(): @@ -4208,7 +4202,7 @@ def test_accept_terms_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_accept_terms_rest_unset_required_fields(): @@ -4388,7 +4382,7 @@ def test_enroll_solution_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_enroll_solution_rest_unset_required_fields(): @@ -4523,7 +4517,7 @@ def test_list_enrolled_solutions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_enrolled_solutions_rest_unset_required_fields(): @@ -4704,7 +4698,7 @@ def test_get_logging_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_logging_config_rest_unset_required_fields(): @@ -4884,7 +4878,7 @@ def test_update_logging_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_logging_config_rest_unset_required_fields(): @@ -5066,7 +5060,7 @@ def test_get_alert_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_alert_config_rest_unset_required_fields(): @@ -5244,7 +5238,7 @@ def test_update_alert_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_alert_config_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_search_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_search_service.py index 97ceaf2d69f4..bb6c10690df7 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_search_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_search_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1782,11 +1776,7 @@ async def test_search_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.search(request={}) - ).pages: + async for page_ in (await client.search(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1903,7 +1893,7 @@ def test_search_rest_required_fields(request_type=search_service.SearchRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py index 99b2ee0c0c66..cdb0719e9e32 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3539,11 +3533,7 @@ async def test_list_serving_configs_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_serving_configs(request={}) - ).pages: + async for page_ in (await client.list_serving_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4486,7 +4476,7 @@ def test_create_serving_config_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_serving_config_rest_unset_required_fields(): @@ -4681,7 +4671,7 @@ def test_delete_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_serving_config_rest_unset_required_fields(): @@ -4862,7 +4852,7 @@ def test_update_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_serving_config_rest_unset_required_fields(): @@ -5050,7 +5040,7 @@ def test_get_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_serving_config_rest_unset_required_fields(): @@ -5243,7 +5233,7 @@ def test_list_serving_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_serving_configs_rest_unset_required_fields(): @@ -5504,7 +5494,7 @@ def test_add_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_control_rest_unset_required_fields(): @@ -5697,7 +5687,7 @@ def test_remove_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_control_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_user_event_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_user_event_service.py index 6cb555293842..0b7988f10ac2 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_user_event_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_user_event_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3084,7 +3078,7 @@ def test_write_user_event_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_write_user_event_rest_unset_required_fields(): @@ -3237,7 +3231,7 @@ def test_collect_user_event_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_collect_user_event_rest_unset_required_fields(): @@ -3381,7 +3375,7 @@ def test_purge_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_user_events_rest_unset_required_fields(): @@ -3515,7 +3509,7 @@ def test_import_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_user_events_rest_unset_required_fields(): @@ -3649,7 +3643,7 @@ def test_export_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_user_events_rest_unset_required_fields(): @@ -3783,7 +3777,7 @@ def test_rejoin_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_rejoin_user_events_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_analytics_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_analytics_service.py index c5657bf4664e..235f72a6493d 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_analytics_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_analytics_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1726,7 +1720,7 @@ def test_export_analytics_metrics_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_analytics_metrics_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_catalog_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_catalog_service.py index 1c3090c60a4f..7e358eaf3091 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_catalog_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_catalog_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1833,11 +1827,7 @@ async def test_list_catalogs_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_catalogs(request={}) - ).pages: + async for page_ in (await client.list_catalogs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5527,7 +5517,7 @@ def test_list_catalogs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_catalogs_rest_unset_required_fields(): @@ -5774,7 +5764,7 @@ def test_update_catalog_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_catalog_rest_unset_required_fields(): @@ -6159,7 +6149,7 @@ def test_get_completion_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_completion_config_rest_unset_required_fields(): @@ -6342,7 +6332,7 @@ def test_update_completion_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_completion_config_rest_unset_required_fields(): @@ -6531,7 +6521,7 @@ def test_get_attributes_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_attributes_config_rest_unset_required_fields(): @@ -6714,7 +6704,7 @@ def test_update_attributes_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_attributes_config_rest_unset_required_fields(): @@ -6904,7 +6894,7 @@ def test_add_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_catalog_attribute_rest_unset_required_fields(): @@ -7042,7 +7032,7 @@ def test_remove_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_catalog_attribute_rest_unset_required_fields(): @@ -7182,7 +7172,7 @@ def test_batch_remove_catalog_attributes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_remove_catalog_attributes_rest_unset_required_fields(): @@ -7318,7 +7308,7 @@ def test_replace_catalog_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_replace_catalog_attribute_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_completion_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_completion_service.py index c5b08b372039..b4bcdb128b74 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_completion_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_completion_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2006,7 +2000,7 @@ def test_complete_query_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_complete_query_rest_unset_required_fields(): @@ -2152,7 +2146,7 @@ def test_import_completion_data_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_completion_data_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_control_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_control_service.py index 94e53df8b5b2..27c7949a4b9d 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_control_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_control_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3286,11 +3280,7 @@ async def test_list_controls_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_controls(request={}) - ).pages: + async for page_ in (await client.list_controls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3420,7 +3410,7 @@ def test_create_control_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_control_rest_unset_required_fields(): @@ -3622,7 +3612,7 @@ def test_delete_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_control_rest_unset_required_fields(): @@ -3798,7 +3788,7 @@ def test_update_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_control_rest_unset_required_fields(): @@ -3994,7 +3984,7 @@ def test_get_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_control_rest_unset_required_fields(): @@ -4182,7 +4172,7 @@ def test_list_controls_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_controls_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_conversational_search_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_conversational_search_service.py index 969f5887de19..19fae25fc1fe 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_conversational_search_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_conversational_search_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1822,7 +1816,7 @@ def test_conversational_search_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_conversational_search_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_generative_question_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_generative_question_service.py index 3dc06f3ee816..66b828307a5a 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_generative_question_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_generative_question_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3395,7 +3389,7 @@ def test_update_generative_questions_feature_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_generative_questions_feature_config_rest_unset_required_fields(): @@ -3604,7 +3598,7 @@ def test_get_generative_questions_feature_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_generative_questions_feature_config_rest_unset_required_fields(): @@ -3799,7 +3793,7 @@ def test_list_generative_question_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_generative_question_configs_rest_unset_required_fields(): @@ -3990,7 +3984,7 @@ def test_update_generative_question_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_generative_question_config_rest_unset_required_fields(): @@ -4193,7 +4187,7 @@ def test_batch_update_generative_question_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_update_generative_question_configs_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_model_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_model_service.py index e10ab4b414ea..23c72e4ff218 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_model_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_model_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3555,11 +3549,7 @@ async def test_list_models_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_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4375,7 +4365,7 @@ def test_create_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -4561,7 +4551,7 @@ def test_get_model_rest_required_fields(request_type=model_service.GetModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -4740,7 +4730,7 @@ def test_pause_model_rest_required_fields(request_type=model_service.PauseModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_pause_model_rest_unset_required_fields(): @@ -4921,7 +4911,7 @@ def test_resume_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_resume_model_rest_unset_required_fields(): @@ -5098,7 +5088,7 @@ def test_delete_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -5281,7 +5271,7 @@ def test_list_models_rest_required_fields(request_type=model_service.ListModelsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -5530,7 +5520,7 @@ def test_update_model_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_model_rest_unset_required_fields(): @@ -5714,7 +5704,7 @@ def test_tune_model_rest_required_fields(request_type=model_service.TuneModelReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_tune_model_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_prediction_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_prediction_service.py index 012734e7edb3..a31f30e795ab 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_prediction_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_prediction_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1721,7 +1715,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_product_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_product_service.py index 500cb689f63b..65aca24ab958 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_product_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_product_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2648,11 +2642,7 @@ async def test_list_products_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_products(request={}) - ).pages: + async for page_ in (await client.list_products(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5962,7 +5952,7 @@ def test_create_product_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_product_rest_unset_required_fields(): @@ -6159,7 +6149,7 @@ def test_get_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_product_rest_unset_required_fields(): @@ -6348,7 +6338,7 @@ def test_list_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_products_rest_unset_required_fields(): @@ -6606,7 +6596,7 @@ def test_update_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_product_rest_unset_required_fields(): @@ -6799,7 +6789,7 @@ def test_delete_product_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_product_rest_unset_required_fields(): @@ -6983,7 +6973,7 @@ def test_purge_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_products_rest_unset_required_fields(): @@ -7113,7 +7103,7 @@ def test_import_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_products_rest_unset_required_fields(): @@ -7243,7 +7233,7 @@ def test_export_products_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_products_rest_unset_required_fields(): @@ -7368,7 +7358,7 @@ def test_set_inventory_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_inventory_rest_unset_required_fields(): @@ -7565,7 +7555,7 @@ def test_add_fulfillment_places_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_fulfillment_places_rest_unset_required_fields(): @@ -7767,7 +7757,7 @@ def test_remove_fulfillment_places_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_fulfillment_places_rest_unset_required_fields(): @@ -7961,7 +7951,7 @@ def test_add_local_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_local_inventories_rest_unset_required_fields(): @@ -8158,7 +8148,7 @@ def test_remove_local_inventories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_local_inventories_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_project_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_project_service.py index da2928f98649..ed38652dcedb 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_project_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_project_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2090,7 +2084,7 @@ def test_get_alert_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_alert_config_rest_unset_required_fields(): @@ -2268,7 +2262,7 @@ def test_update_alert_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_alert_config_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_search_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_search_service.py index 65be3932bc45..d674e453ca4e 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_search_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_search_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1780,11 +1774,7 @@ async def test_search_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.search(request={}) - ).pages: + async for page_ in (await client.search(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1901,7 +1891,7 @@ def test_search_rest_required_fields(request_type=search_service.SearchRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_serving_config_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_serving_config_service.py index 572d6569b5fc..ae8bca79c26c 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_serving_config_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_serving_config_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3539,11 +3533,7 @@ async def test_list_serving_configs_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_serving_configs(request={}) - ).pages: + async for page_ in (await client.list_serving_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4486,7 +4476,7 @@ def test_create_serving_config_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_serving_config_rest_unset_required_fields(): @@ -4681,7 +4671,7 @@ def test_delete_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_serving_config_rest_unset_required_fields(): @@ -4862,7 +4852,7 @@ def test_update_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_serving_config_rest_unset_required_fields(): @@ -5050,7 +5040,7 @@ def test_get_serving_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_serving_config_rest_unset_required_fields(): @@ -5243,7 +5233,7 @@ def test_list_serving_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_serving_configs_rest_unset_required_fields(): @@ -5504,7 +5494,7 @@ def test_add_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_add_control_rest_unset_required_fields(): @@ -5697,7 +5687,7 @@ def test_remove_control_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_remove_control_rest_unset_required_fields(): diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_user_event_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_user_event_service.py index ad0cbae0f9cd..98269b25cb97 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_user_event_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2beta/test_user_event_service.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3084,7 +3078,7 @@ def test_write_user_event_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_write_user_event_rest_unset_required_fields(): @@ -3237,7 +3231,7 @@ def test_collect_user_event_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_collect_user_event_rest_unset_required_fields(): @@ -3381,7 +3375,7 @@ def test_purge_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_purge_user_events_rest_unset_required_fields(): @@ -3515,7 +3509,7 @@ def test_import_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_user_events_rest_unset_required_fields(): @@ -3649,7 +3643,7 @@ def test_export_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_user_events_rest_unset_required_fields(): @@ -3783,7 +3777,7 @@ def test_rejoin_user_events_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_rejoin_user_events_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/docs/conf.py b/packages/google-cloud-run/docs/conf.py index 3e7898d7894d..1b766eb7bf3a 100644 --- a/packages/google-cloud-run/docs/conf.py +++ b/packages/google-cloud-run/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-run" -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-run/google/cloud/run_v2/__init__.py b/packages/google-cloud-run/google/cloud/run_v2/__init__.py index 0fc40b8a79c9..243d5084cf9a 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/__init__.py +++ b/packages/google-cloud-run/google/cloud/run_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.builds import BuildsAsyncClient, BuildsClient from .services.executions import ExecutionsAsyncClient, ExecutionsClient @@ -162,28 +156,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.run_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-run/google/cloud/run_v2/services/executions/async_client.py b/packages/google-cloud-run/google/cloud/run_v2/services/executions/async_client.py index 0560af5f5468..59fe690686e7 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/services/executions/async_client.py +++ b/packages/google-cloud-run/google/cloud/run_v2/services/executions/async_client.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. @@ -581,11 +581,11 @@ async def sample_delete_execution(): ) # Make the request - operation = client.delete_execution(request=request) + operation = await client.delete_execution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -708,11 +708,11 @@ async def sample_cancel_execution(): ) # Make the request - operation = client.cancel_execution(request=request) + operation = await client.cancel_execution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/google/cloud/run_v2/services/instances/async_client.py b/packages/google-cloud-run/google/cloud/run_v2/services/instances/async_client.py index 9076cfe34165..7be1b7f8c461 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/services/instances/async_client.py +++ b/packages/google-cloud-run/google/cloud/run_v2/services/instances/async_client.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. @@ -352,11 +352,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -489,11 +489,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -874,11 +874,11 @@ async def sample_stop_instance(): ) # Make the request - operation = client.stop_instance(request=request) + operation = await client.stop_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1000,11 +1000,11 @@ async def sample_start_instance(): ) # Make the request - operation = client.start_instance(request=request) + operation = await client.start_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/google/cloud/run_v2/services/jobs/async_client.py b/packages/google-cloud-run/google/cloud/run_v2/services/jobs/async_client.py index a9c5dc9e6b11..bee74205f12a 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/services/jobs/async_client.py +++ b/packages/google-cloud-run/google/cloud/run_v2/services/jobs/async_client.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. @@ -351,11 +351,11 @@ async def sample_create_job(): ) # Make the request - operation = client.create_job(request=request) + operation = await client.create_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -766,11 +766,11 @@ async def sample_update_job(): ) # Make the request - operation = client.update_job(request=request) + operation = await client.update_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -896,11 +896,11 @@ async def sample_delete_job(): ) # Make the request - operation = client.delete_job(request=request) + operation = await client.delete_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1032,11 +1032,11 @@ async def sample_run_job(): ) # Make the request - operation = client.run_job(request=request) + operation = await client.run_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/google/cloud/run_v2/services/revisions/async_client.py b/packages/google-cloud-run/google/cloud/run_v2/services/revisions/async_client.py index d29c05f2017f..059993ec269a 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/services/revisions/async_client.py +++ b/packages/google-cloud-run/google/cloud/run_v2/services/revisions/async_client.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. @@ -609,11 +609,11 @@ async def sample_delete_revision(): ) # Make the request - operation = client.delete_revision(request=request) + operation = await client.delete_revision(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/google/cloud/run_v2/services/services/async_client.py b/packages/google-cloud-run/google/cloud/run_v2/services/services/async_client.py index 7babf38234a1..dae1249136d4 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/services/services/async_client.py +++ b/packages/google-cloud-run/google/cloud/run_v2/services/services/async_client.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. @@ -358,11 +358,11 @@ async def sample_create_service(): ) # Make the request - operation = client.create_service(request=request) + operation = await client.create_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -790,11 +790,11 @@ async def sample_update_service(): ) # Make the request - operation = client.update_service(request=request) + operation = await client.update_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -937,11 +937,11 @@ async def sample_delete_service(): ) # Make the request - operation = client.delete_service(request=request) + operation = await client.delete_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/google/cloud/run_v2/services/worker_pools/async_client.py b/packages/google-cloud-run/google/cloud/run_v2/services/worker_pools/async_client.py index c3837d525016..8616ffaa7379 100644 --- a/packages/google-cloud-run/google/cloud/run_v2/services/worker_pools/async_client.py +++ b/packages/google-cloud-run/google/cloud/run_v2/services/worker_pools/async_client.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. @@ -358,11 +358,11 @@ async def sample_create_worker_pool(): ) # Make the request - operation = client.create_worker_pool(request=request) + operation = await client.create_worker_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -785,11 +785,11 @@ async def sample_update_worker_pool(): ) # Make the request - operation = client.update_worker_pool(request=request) + operation = await client.update_worker_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -932,11 +932,11 @@ async def sample_delete_worker_pool(): ) # Make the request - operation = client.delete_worker_pool(request=request) + operation = await client.delete_worker_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/noxfile.py b/packages/google-cloud-run/noxfile.py index 25c87fa037d7..530e669c47b0 100644 --- a/packages/google-cloud-run/noxfile.py +++ b/packages/google-cloud-run/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", @@ -390,7 +389,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-run/samples/generated_samples/run_v2_generated_executions_cancel_execution_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_cancel_execution_async.py index b4fb8a34d287..3e1353a32d68 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_cancel_execution_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_cancel_execution_async.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. @@ -44,11 +44,11 @@ async def sample_cancel_execution(): ) # Make the request - operation = client.cancel_execution(request=request) + operation = await client.cancel_execution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_delete_execution_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_delete_execution_async.py index dbfd837d1ef1..8d3038d89585 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_delete_execution_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_executions_delete_execution_async.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. @@ -44,11 +44,11 @@ async def sample_delete_execution(): ) # Make the request - operation = client.delete_execution(request=request) + operation = await client.delete_execution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_create_instance_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_create_instance_async.py index 1fc8c51b7994..c39a64ad90d4 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_create_instance_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_create_instance_async.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. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_delete_instance_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_delete_instance_async.py index c76fcf12f232..7e3e45d34246 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_delete_instance_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_delete_instance_async.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. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_start_instance_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_start_instance_async.py index 51ae8e362d19..0a5b8fbf7760 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_start_instance_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_start_instance_async.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. @@ -44,11 +44,11 @@ async def sample_start_instance(): ) # Make the request - operation = client.start_instance(request=request) + operation = await client.start_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_stop_instance_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_stop_instance_async.py index bc013687d006..29f3229d28a5 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_stop_instance_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_instances_stop_instance_async.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. @@ -44,11 +44,11 @@ async def sample_stop_instance(): ) # Make the request - operation = client.stop_instance(request=request) + operation = await client.stop_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_create_job_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_create_job_async.py index e3b67008a2dc..46da4a5d3d69 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_create_job_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_create_job_async.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. @@ -50,11 +50,11 @@ async def sample_create_job(): ) # Make the request - operation = client.create_job(request=request) + operation = await client.create_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_delete_job_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_delete_job_async.py index 2a1b845e7c54..8b6c7351f835 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_delete_job_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_delete_job_async.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. @@ -44,11 +44,11 @@ async def sample_delete_job(): ) # Make the request - operation = client.delete_job(request=request) + operation = await client.delete_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_run_job_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_run_job_async.py index affb84a7db60..cf99c2b1738b 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_run_job_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_run_job_async.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. @@ -44,11 +44,11 @@ async def sample_run_job(): ) # Make the request - operation = client.run_job(request=request) + operation = await client.run_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_update_job_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_update_job_async.py index a2825f4907f6..9c8b8511feb6 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_update_job_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_jobs_update_job_async.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. @@ -48,11 +48,11 @@ async def sample_update_job(): ) # Make the request - operation = client.update_job(request=request) + operation = await client.update_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_revisions_delete_revision_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_revisions_delete_revision_async.py index f50df3a81fb5..1ae273dc2e0b 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_revisions_delete_revision_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_revisions_delete_revision_async.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. @@ -44,11 +44,11 @@ async def sample_delete_revision(): ) # Make the request - operation = client.delete_revision(request=request) + operation = await client.delete_revision(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_create_service_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_create_service_async.py index 45f17e70238a..2c65e02630ca 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_create_service_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_create_service_async.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. @@ -45,11 +45,11 @@ async def sample_create_service(): ) # Make the request - operation = client.create_service(request=request) + operation = await client.create_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_delete_service_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_delete_service_async.py index b9912139a53a..78a795a5b3ba 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_delete_service_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_delete_service_async.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. @@ -44,11 +44,11 @@ async def sample_delete_service(): ) # Make the request - operation = client.delete_service(request=request) + operation = await client.delete_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_update_service_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_update_service_async.py index 65956ed07680..48542561823f 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_update_service_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_services_update_service_async.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. @@ -42,11 +42,11 @@ async def sample_update_service(): request = run_v2.UpdateServiceRequest() # Make the request - operation = client.update_service(request=request) + operation = await client.update_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_create_worker_pool_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_create_worker_pool_async.py index a83eaab1447b..4aa7280f188f 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_create_worker_pool_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_create_worker_pool_async.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. @@ -45,11 +45,11 @@ async def sample_create_worker_pool(): ) # Make the request - operation = client.create_worker_pool(request=request) + operation = await client.create_worker_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_delete_worker_pool_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_delete_worker_pool_async.py index ea9ea0101d2b..c919613ec2af 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_delete_worker_pool_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_delete_worker_pool_async.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. @@ -44,11 +44,11 @@ async def sample_delete_worker_pool(): ) # Make the request - operation = client.delete_worker_pool(request=request) + operation = await client.delete_worker_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_update_worker_pool_async.py b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_update_worker_pool_async.py index 41c5849dc8ea..3278b3f8ed58 100644 --- a/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_update_worker_pool_async.py +++ b/packages/google-cloud-run/samples/generated_samples/run_v2_generated_worker_pools_update_worker_pool_async.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. @@ -42,11 +42,11 @@ async def sample_update_worker_pool(): request = run_v2.UpdateWorkerPoolRequest() # Make the request - operation = client.update_worker_pool(request=request) + operation = await client.update_worker_pool(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-run/setup.py b/packages/google-cloud-run/setup.py index 2bf20bd88576..c09f14874677 100644 --- a/packages/google-cloud-run/setup.py +++ b/packages/google-cloud-run/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. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -72,7 +72,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, @@ -80,7 +80,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", @@ -91,7 +90,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-run/testing/constraints-3.10.txt b/packages/google-cloud-run/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-run/testing/constraints-3.10.txt +++ b/packages/google-cloud-run/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# 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-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 diff --git a/packages/google-cloud-run/testing/constraints-3.9.txt b/packages/google-cloud-run/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-run/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +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-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_builds.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_builds.py index 1e5bbef2faa3..3a263df6f67e 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_builds.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_builds.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1611,7 +1605,7 @@ def test_submit_build_rest_required_fields(request_type=build.SubmitBuildRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_submit_build_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_executions.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_executions.py index 34ca1db51362..dbd2979b0cd6 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_executions.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_executions.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2175,11 +2169,7 @@ async def test_list_executions_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_executions(request={}) - ).pages: + async for page_ in (await client.list_executions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2953,7 +2943,7 @@ def test_get_execution_rest_required_fields(request_type=execution.GetExecutionR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_execution_rest_unset_required_fields(): @@ -3141,7 +3131,7 @@ def test_list_executions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_executions_rest_unset_required_fields(): @@ -3399,7 +3389,7 @@ def test_delete_execution_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_execution_rest_unset_required_fields(): @@ -3589,7 +3579,7 @@ def test_cancel_execution_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_cancel_execution_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_instances.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_instances.py index 9c72637f99d7..924a34e74d52 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_instances.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_instances.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2624,11 +2618,7 @@ async def test_list_instances_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_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3422,7 +3412,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -3621,7 +3611,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -3804,7 +3794,7 @@ def test_get_instance_rest_required_fields(request_type=instance.GetInstanceRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -3991,7 +3981,7 @@ def test_list_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -4238,7 +4228,7 @@ def test_stop_instance_rest_required_fields(request_type=instance.StopInstanceRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_stop_instance_rest_unset_required_fields(): @@ -4418,7 +4408,7 @@ def test_start_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_start_instance_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_jobs.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_jobs.py index cbe9660ae17b..da3d63abb50d 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_jobs.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_jobs.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2282,11 +2276,7 @@ async def test_list_jobs_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_jobs(request={}) - ).pages: + async for page_ in (await client.list_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4008,7 +3998,7 @@ def test_create_job_rest_required_fields(request_type=gcr_job.CreateJobRequest): ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_job_rest_unset_required_fields(): @@ -4199,7 +4189,7 @@ def test_get_job_rest_required_fields(request_type=job.GetJobRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_job_rest_unset_required_fields(): @@ -4382,7 +4372,7 @@ def test_list_jobs_rest_required_fields(request_type=job.ListJobsRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_jobs_rest_unset_required_fields(): @@ -4631,7 +4621,7 @@ def test_update_job_rest_required_fields(request_type=gcr_job.UpdateJobRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_job_rest_unset_required_fields(): @@ -4822,7 +4812,7 @@ def test_delete_job_rest_required_fields(request_type=job.DeleteJobRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_job_rest_unset_required_fields(): @@ -5005,7 +4995,7 @@ def test_run_job_rest_required_fields(request_type=job.RunJobRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_run_job_rest_unset_required_fields(): @@ -5180,7 +5170,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -5299,7 +5289,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -5434,7 +5424,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_revisions.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_revisions.py index 9dd8268ee27c..4c4911187f27 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_revisions.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_revisions.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2067,11 +2061,7 @@ async def test_list_revisions_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_revisions(request={}) - ).pages: + async for page_ in (await client.list_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2451,7 +2441,7 @@ def test_get_revision_rest_required_fields(request_type=revision.GetRevisionRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_revision_rest_unset_required_fields(): @@ -2639,7 +2629,7 @@ def test_list_revisions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_revisions_rest_unset_required_fields(): @@ -2899,7 +2889,7 @@ def test_delete_revision_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_revision_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_services.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_services.py index 541bd700b557..2da4325eb13b 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_services.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_services.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2361,11 +2355,7 @@ async def test_list_services_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_services(request={}) - ).pages: + async for page_ in (await client.list_services(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3837,7 +3827,7 @@ def test_create_service_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_service_rest_unset_required_fields(): @@ -4028,7 +4018,7 @@ def test_get_service_rest_required_fields(request_type=service.GetServiceRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_service_rest_unset_required_fields(): @@ -4211,7 +4201,7 @@ def test_list_services_rest_required_fields(request_type=service.ListServicesReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_services_rest_unset_required_fields(): @@ -4463,7 +4453,7 @@ def test_update_service_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_service_rest_unset_required_fields(): @@ -4658,7 +4648,7 @@ def test_delete_service_rest_required_fields(request_type=service.DeleteServiceR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_service_rest_unset_required_fields(): @@ -4841,7 +4831,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -4960,7 +4950,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -5095,7 +5085,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_tasks.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_tasks.py index 2c3af59cdb23..c620ce6c3a01 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_tasks.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_tasks.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2136,11 +2130,7 @@ async def test_list_tasks_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_tasks(request={}) - ).pages: + async for page_ in (await client.list_tasks(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2252,7 +2242,7 @@ def test_get_task_rest_required_fields(request_type=task.GetTaskRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_task_rest_unset_required_fields(): @@ -2438,7 +2428,7 @@ def test_list_tasks_rest_required_fields(request_type=task.ListTasksRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_tasks_rest_unset_required_fields(): diff --git a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_worker_pools.py b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_worker_pools.py index ffe4a6868456..060111274d82 100644 --- a/packages/google-cloud-run/tests/unit/gapic/run_v2/test_worker_pools.py +++ b/packages/google-cloud-run/tests/unit/gapic/run_v2/test_worker_pools.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 AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2391,11 +2385,7 @@ async def test_list_worker_pools_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_worker_pools(request={}) - ).pages: + async for page_ in (await client.list_worker_pools(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3900,7 +3890,7 @@ def test_create_worker_pool_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_worker_pool_rest_unset_required_fields(): @@ -4094,7 +4084,7 @@ def test_get_worker_pool_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_worker_pool_rest_unset_required_fields(): @@ -4284,7 +4274,7 @@ def test_list_worker_pools_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_worker_pools_rest_unset_required_fields(): @@ -4544,7 +4534,7 @@ def test_update_worker_pool_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_worker_pool_rest_unset_required_fields(): @@ -4748,7 +4738,7 @@ def test_delete_worker_pool_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_worker_pool_rest_unset_required_fields(): @@ -4934,7 +4924,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -5053,7 +5043,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -5188,7 +5178,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields():