diff --git a/packages/google-cloud-talent/docs/conf.py b/packages/google-cloud-talent/docs/conf.py index 5679a7962b3e..dd9fc77f5566 100644 --- a/packages/google-cloud-talent/docs/conf.py +++ b/packages/google-cloud-talent/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-talent" -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-talent/google/cloud/talent_v4/__init__.py b/packages/google-cloud-talent/google/cloud/talent_v4/__init__.py index d933fa08f27b..0f2b7ee0a32b 100644 --- a/packages/google-cloud-talent/google/cloud/talent_v4/__init__.py +++ b/packages/google-cloud-talent/google/cloud/talent_v4/__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.company_service import CompanyServiceAsyncClient, CompanyServiceClient from .services.completion import CompletionAsyncClient, CompletionClient @@ -107,28 +101,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.talent_v4" - 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-talent/google/cloud/talent_v4/services/job_service/async_client.py b/packages/google-cloud-talent/google/cloud/talent_v4/services/job_service/async_client.py index 01751176ff16..94bbf4b10598 100644 --- a/packages/google-cloud-talent/google/cloud/talent_v4/services/job_service/async_client.py +++ b/packages/google-cloud-talent/google/cloud/talent_v4/services/job_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. @@ -474,11 +474,11 @@ async def sample_batch_create_jobs(): ) # Make the request - operation = client.batch_create_jobs(request=request) + operation = await client.batch_create_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -876,11 +876,11 @@ async def sample_batch_update_jobs(): ) # Make the request - operation = client.batch_update_jobs(request=request) + operation = await client.batch_update_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1122,11 +1122,11 @@ async def sample_batch_delete_jobs(): ) # Make the request - operation = client.batch_delete_jobs(request=request) + operation = await client.batch_delete_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/google/cloud/talent_v4beta1/__init__.py b/packages/google-cloud-talent/google/cloud/talent_v4beta1/__init__.py index 3ed75ad58f20..34cf5dd14249 100644 --- a/packages/google-cloud-talent/google/cloud/talent_v4beta1/__init__.py +++ b/packages/google-cloud-talent/google/cloud/talent_v4beta1/__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.company_service import CompanyServiceAsyncClient, CompanyServiceClient from .services.completion import CompletionAsyncClient, CompletionClient @@ -104,28 +98,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.talent_v4beta1" - 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-talent/google/cloud/talent_v4beta1/services/job_service/async_client.py b/packages/google-cloud-talent/google/cloud/talent_v4beta1/services/job_service/async_client.py index d6fdd2354069..04d564f5fa81 100644 --- a/packages/google-cloud-talent/google/cloud/talent_v4beta1/services/job_service/async_client.py +++ b/packages/google-cloud-talent/google/cloud/talent_v4beta1/services/job_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. @@ -473,11 +473,11 @@ async def sample_batch_create_jobs(): ) # Make the request - operation = client.batch_create_jobs(request=request) + operation = await client.batch_create_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -860,11 +860,11 @@ async def sample_batch_update_jobs(): ) # Make the request - operation = client.batch_update_jobs(request=request) + operation = await client.batch_update_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/noxfile.py b/packages/google-cloud-talent/noxfile.py index a1a6cc9afe4e..3ced61ca9385 100644 --- a/packages/google-cloud-talent/noxfile.py +++ b/packages/google-cloud-talent/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-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_create_jobs_async.py b/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_create_jobs_async.py index 2818e123a990..f71f0d25cef7 100644 --- a/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_create_jobs_async.py +++ b/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_create_jobs_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_batch_create_jobs(): ) # Make the request - operation = client.batch_create_jobs(request=request) + operation = await client.batch_create_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_delete_jobs_async.py b/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_delete_jobs_async.py index a94ac23a9d82..a5305ee2529a 100644 --- a/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_delete_jobs_async.py +++ b/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_delete_jobs_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_batch_delete_jobs(): ) # Make the request - operation = client.batch_delete_jobs(request=request) + operation = await client.batch_delete_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_update_jobs_async.py b/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_update_jobs_async.py index 97051b15dd0d..23e948bcd384 100644 --- a/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_update_jobs_async.py +++ b/packages/google-cloud-talent/samples/generated_samples/jobs_v4_generated_job_service_batch_update_jobs_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_batch_update_jobs(): ) # Make the request - operation = client.batch_update_jobs(request=request) + operation = await client.batch_update_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_create_jobs_async.py b/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_create_jobs_async.py index 66b1fd367676..e7ee5271bfd9 100644 --- a/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_create_jobs_async.py +++ b/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_create_jobs_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_batch_create_jobs(): ) # Make the request - operation = client.batch_create_jobs(request=request) + operation = await client.batch_create_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_update_jobs_async.py b/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_update_jobs_async.py index 2e6529950ddf..3cbda1b736bf 100644 --- a/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_update_jobs_async.py +++ b/packages/google-cloud-talent/samples/generated_samples/jobs_v4beta1_generated_job_service_batch_update_jobs_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_batch_update_jobs(): ) # Make the request - operation = client.batch_update_jobs(request=request) + operation = await client.batch_update_jobs(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-talent/setup.py b/packages/google-cloud-talent/setup.py index 814ba6bac028..a0c3e68e7928 100644 --- a/packages/google-cloud-talent/setup.py +++ b/packages/google-cloud-talent/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-talent/testing/constraints-3.10.txt b/packages/google-cloud-talent/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-talent/testing/constraints-3.10.txt +++ b/packages/google-cloud-talent/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-talent/testing/constraints-3.9.txt b/packages/google-cloud-talent/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-talent/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-talent/tests/unit/gapic/talent_v4/test_company_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_company_service.py index b5ff1a741667..54984cd52b66 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_company_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_company_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 @@ -3270,11 +3264,7 @@ async def test_list_companies_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_companies(request={}) - ).pages: + async for page_ in (await client.list_companies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3389,7 +3379,7 @@ def test_create_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -3576,7 +3566,7 @@ def test_get_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -3751,7 +3741,7 @@ def test_update_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -3930,7 +3920,7 @@ def test_delete_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -4113,7 +4103,7 @@ def test_list_companies_rest_required_fields( expected_params = [("$alt", "json;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_companies_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_completion.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_completion.py index 5f0a0907df05..f910646f455b 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_completion.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_completion.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1657,7 +1651,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(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_event_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_event_service.py index 20949392f412..6270f80a4a9e 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_event_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_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 @@ -1762,7 +1756,7 @@ def test_create_client_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_create_client_event_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_job_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_job_service.py index b4ceb957c336..4affc3a84cc9 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_job_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_job_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 @@ -4358,11 +4352,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 @@ -4998,7 +4988,7 @@ def test_create_job_rest_required_fields(request_type=job_service.CreateJobReque expected_params = [("$alt", "json;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(): @@ -5188,7 +5178,7 @@ def test_batch_create_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_batch_create_jobs_rest_unset_required_fields(): @@ -5372,7 +5362,7 @@ def test_get_job_rest_required_fields(request_type=job_service.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(): @@ -5544,7 +5534,7 @@ def test_update_job_rest_required_fields(request_type=job_service.UpdateJobReque expected_params = [("$alt", "json;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(): @@ -5729,7 +5719,7 @@ def test_batch_update_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_batch_update_jobs_rest_unset_required_fields(): @@ -5910,7 +5900,7 @@ def test_delete_job_rest_required_fields(request_type=job_service.DeleteJobReque expected_params = [("$alt", "json;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(): @@ -6088,7 +6078,7 @@ def test_batch_delete_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_batch_delete_jobs_rest_unset_required_fields(): @@ -6286,7 +6276,7 @@ def test_list_jobs_rest_required_fields(request_type=job_service.ListJobsRequest ("$alt", "json;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(): @@ -6539,7 +6529,7 @@ def test_search_jobs_rest_required_fields(request_type=job_service.SearchJobsReq expected_params = [("$alt", "json;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_jobs_rest_unset_required_fields(): @@ -6673,7 +6663,7 @@ def test_search_jobs_for_alert_rest_required_fields( expected_params = [("$alt", "json;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_jobs_for_alert_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_tenant_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_tenant_service.py index 0b733849fee1..eda0b2606301 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_tenant_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4/test_tenant_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 @@ -3118,11 +3112,7 @@ async def test_list_tenants_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_tenants(request={}) - ).pages: + async for page_ in (await client.list_tenants(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3237,7 +3227,7 @@ def test_create_tenant_rest_required_fields( expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3421,7 +3411,7 @@ def test_get_tenant_rest_required_fields(request_type=tenant_service.GetTenantRe expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3595,7 +3585,7 @@ def test_update_tenant_rest_required_fields( expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3770,7 +3760,7 @@ def test_delete_tenant_rest_required_fields( expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3951,7 +3941,7 @@ def test_list_tenants_rest_required_fields( expected_params = [("$alt", "json;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_tenants_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_company_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_company_service.py index dbfcdea3d84f..f113e6a92dad 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_company_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_company_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 @@ -3260,11 +3254,7 @@ async def test_list_companies_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_companies(request={}) - ).pages: + async for page_ in (await client.list_companies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3379,7 +3369,7 @@ def test_create_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -3567,7 +3557,7 @@ def test_get_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -3741,7 +3731,7 @@ def test_update_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -3918,7 +3908,7 @@ def test_delete_company_rest_required_fields( expected_params = [("$alt", "json;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_company_rest_unset_required_fields(): @@ -4102,7 +4092,7 @@ def test_list_companies_rest_required_fields( expected_params = [("$alt", "json;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_companies_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_completion.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_completion.py index e99a3801884d..845ae0a96c56 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_completion.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_completion.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1657,7 +1651,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(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_event_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_event_service.py index 6544494a37a4..391026e03546 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_event_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_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 @@ -1762,7 +1756,7 @@ def test_create_client_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_create_client_event_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_job_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_job_service.py index 271a32c46dda..97b71c080e26 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_job_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_job_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 @@ -4340,11 +4334,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 @@ -4795,11 +4785,7 @@ async def test_search_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.search_jobs(request={}) - ).pages: + async for page_ in (await client.search_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5273,11 +5259,7 @@ async def test_search_jobs_for_alert_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_jobs_for_alert(request={}) - ).pages: + async for page_ in (await client.search_jobs_for_alert(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5390,7 +5372,7 @@ def test_create_job_rest_required_fields(request_type=job_service.CreateJobReque expected_params = [("$alt", "json;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(): @@ -5581,7 +5563,7 @@ def test_batch_create_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_batch_create_jobs_rest_unset_required_fields(): @@ -5765,7 +5747,7 @@ def test_get_job_rest_required_fields(request_type=job_service.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(): @@ -5936,7 +5918,7 @@ def test_update_job_rest_required_fields(request_type=job_service.UpdateJobReque expected_params = [("$alt", "json;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(): @@ -6120,7 +6102,7 @@ def test_batch_update_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_batch_update_jobs_rest_unset_required_fields(): @@ -6301,7 +6283,7 @@ def test_delete_job_rest_required_fields(request_type=job_service.DeleteJobReque expected_params = [("$alt", "json;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(): @@ -6480,7 +6462,7 @@ def test_batch_delete_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_batch_delete_jobs_rest_unset_required_fields(): @@ -6686,7 +6668,7 @@ def test_list_jobs_rest_required_fields(request_type=job_service.ListJobsRequest ("$alt", "json;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(): @@ -6940,7 +6922,7 @@ def test_search_jobs_rest_required_fields(request_type=job_service.SearchJobsReq expected_params = [("$alt", "json;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_jobs_rest_unset_required_fields(): @@ -7137,7 +7119,7 @@ def test_search_jobs_for_alert_rest_required_fields( expected_params = [("$alt", "json;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_jobs_for_alert_rest_unset_required_fields(): diff --git a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_tenant_service.py b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_tenant_service.py index babf54985b49..55e33250be2a 100644 --- a/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_tenant_service.py +++ b/packages/google-cloud-talent/tests/unit/gapic/talent_v4beta1/test_tenant_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 @@ -3156,11 +3150,7 @@ async def test_list_tenants_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_tenants(request={}) - ).pages: + async for page_ in (await client.list_tenants(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3275,7 +3265,7 @@ def test_create_tenant_rest_required_fields( expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3459,7 +3449,7 @@ def test_get_tenant_rest_required_fields(request_type=tenant_service.GetTenantRe expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3631,7 +3621,7 @@ def test_update_tenant_rest_required_fields( expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3805,7 +3795,7 @@ def test_delete_tenant_rest_required_fields( expected_params = [("$alt", "json;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_tenant_rest_unset_required_fields(): @@ -3986,7 +3976,7 @@ def test_list_tenants_rest_required_fields( expected_params = [("$alt", "json;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_tenants_rest_unset_required_fields(): diff --git a/packages/google-cloud-tasks/docs/conf.py b/packages/google-cloud-tasks/docs/conf.py index 0c50c09422b3..54de3edad894 100644 --- a/packages/google-cloud-tasks/docs/conf.py +++ b/packages/google-cloud-tasks/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-tasks" -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-tasks/google/cloud/tasks_v2/__init__.py b/packages/google-cloud-tasks/google/cloud/tasks_v2/__init__.py index 9beb2eae9ff3..e2e6c2d5b104 100644 --- a/packages/google-cloud-tasks/google/cloud/tasks_v2/__init__.py +++ b/packages/google-cloud-tasks/google/cloud/tasks_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.cloud_tasks import CloudTasksAsyncClient, CloudTasksClient from .types.cloudtasks import ( @@ -67,28 +61,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.tasks_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-tasks/google/cloud/tasks_v2beta2/__init__.py b/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/__init__.py index f50e08173403..8212d629baf4 100644 --- a/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/__init__.py +++ b/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/__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_tasks import CloudTasksAsyncClient, CloudTasksClient from .types.cloudtasks import ( @@ -80,28 +74,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.tasks_v2beta2" - 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-tasks/google/cloud/tasks_v2beta3/__init__.py b/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/__init__.py index 336f50d78df3..69f0155ffa89 100644 --- a/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/__init__.py +++ b/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/__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_tasks import CloudTasksAsyncClient, CloudTasksClient from .types.cloudtasks import ( @@ -79,28 +73,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.tasks_v2beta3" - 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-tasks/noxfile.py b/packages/google-cloud-tasks/noxfile.py index 93f682bd1119..4e98707a6391 100644 --- a/packages/google-cloud-tasks/noxfile.py +++ b/packages/google-cloud-tasks/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-tasks/setup.py b/packages/google-cloud-tasks/setup.py index 78fc42d88057..9156cf879944 100644 --- a/packages/google-cloud-tasks/setup.py +++ b/packages/google-cloud-tasks/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-tasks/testing/constraints-3.10.txt b/packages/google-cloud-tasks/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-tasks/testing/constraints-3.10.txt +++ b/packages/google-cloud-tasks/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-tasks/testing/constraints-3.9.txt b/packages/google-cloud-tasks/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-tasks/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-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index f0d2067b7a1e..406a4813c28a 100644 --- a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_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 @@ -1794,11 +1788,7 @@ async def test_list_queues_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_queues(request={}) - ).pages: + async for page_ in (await client.list_queues(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5626,11 +5616,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 @@ -7060,7 +7046,7 @@ def test_list_queues_rest_required_fields(request_type=cloudtasks.ListQueuesRequ expected_params = [("$alt", "json;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_queues_rest_unset_required_fields(): @@ -7305,7 +7291,7 @@ def test_get_queue_rest_required_fields(request_type=cloudtasks.GetQueueRequest) expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -7481,7 +7467,7 @@ def test_create_queue_rest_required_fields(request_type=cloudtasks.CreateQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -7664,7 +7650,7 @@ def test_update_queue_rest_required_fields(request_type=cloudtasks.UpdateQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -7841,7 +7827,7 @@ def test_delete_queue_rest_required_fields(request_type=cloudtasks.DeleteQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8015,7 +8001,7 @@ def test_purge_queue_rest_required_fields(request_type=cloudtasks.PurgeQueueRequ expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8192,7 +8178,7 @@ def test_pause_queue_rest_required_fields(request_type=cloudtasks.PauseQueueRequ expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8369,7 +8355,7 @@ def test_resume_queue_rest_required_fields(request_type=cloudtasks.ResumeQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8546,7 +8532,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(): @@ -8723,7 +8709,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(): @@ -8916,7 +8902,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(): @@ -9110,7 +9096,7 @@ def test_list_tasks_rest_required_fields(request_type=cloudtasks.ListTasksReques expected_params = [("$alt", "json;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(): @@ -9358,7 +9344,7 @@ def test_get_task_rest_required_fields(request_type=cloudtasks.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(): @@ -9537,7 +9523,7 @@ def test_create_task_rest_required_fields(request_type=cloudtasks.CreateTaskRequ expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): @@ -9720,7 +9706,7 @@ def test_delete_task_rest_required_fields(request_type=cloudtasks.DeleteTaskRequ expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): @@ -9897,7 +9883,7 @@ def test_run_task_rest_required_fields(request_type=cloudtasks.RunTaskRequest): expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): diff --git a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index 9c015a729066..90efad328ea2 100644 --- a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_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 @@ -1795,11 +1789,7 @@ async def test_list_queues_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_queues(request={}) - ).pages: + async for page_ in (await client.list_queues(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5807,11 +5797,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 @@ -8546,7 +8532,7 @@ def test_list_queues_rest_required_fields(request_type=cloudtasks.ListQueuesRequ expected_params = [("$alt", "json;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_queues_rest_unset_required_fields(): @@ -8795,7 +8781,7 @@ def test_get_queue_rest_required_fields(request_type=cloudtasks.GetQueueRequest) expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8972,7 +8958,7 @@ def test_create_queue_rest_required_fields(request_type=cloudtasks.CreateQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -9156,7 +9142,7 @@ def test_update_queue_rest_required_fields(request_type=cloudtasks.UpdateQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -9333,7 +9319,7 @@ def test_delete_queue_rest_required_fields(request_type=cloudtasks.DeleteQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -9508,7 +9494,7 @@ def test_purge_queue_rest_required_fields(request_type=cloudtasks.PurgeQueueRequ expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -9685,7 +9671,7 @@ def test_pause_queue_rest_required_fields(request_type=cloudtasks.PauseQueueRequ expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -9862,7 +9848,7 @@ def test_resume_queue_rest_required_fields(request_type=cloudtasks.ResumeQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -10049,7 +10035,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(): @@ -10226,7 +10212,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(): @@ -10419,7 +10405,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(): @@ -10613,7 +10599,7 @@ def test_list_tasks_rest_required_fields(request_type=cloudtasks.ListTasksReques expected_params = [("$alt", "json;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(): @@ -10861,7 +10847,7 @@ def test_get_task_rest_required_fields(request_type=cloudtasks.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(): @@ -11040,7 +11026,7 @@ def test_create_task_rest_required_fields(request_type=cloudtasks.CreateTaskRequ expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): @@ -11223,7 +11209,7 @@ def test_delete_task_rest_required_fields(request_type=cloudtasks.DeleteTaskRequ expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): @@ -11400,7 +11386,7 @@ def test_lease_tasks_rest_required_fields(request_type=cloudtasks.LeaseTasksRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lease_tasks_rest_unset_required_fields(): @@ -11588,7 +11574,7 @@ def test_acknowledge_task_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_acknowledge_task_rest_unset_required_fields(): @@ -11775,7 +11761,7 @@ def test_renew_lease_rest_required_fields(request_type=cloudtasks.RenewLeaseRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_renew_lease_rest_unset_required_fields(): @@ -11967,7 +11953,7 @@ def test_cancel_lease_rest_required_fields(request_type=cloudtasks.CancelLeaseRe expected_params = [("$alt", "json;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_lease_rest_unset_required_fields(): @@ -12156,7 +12142,7 @@ def test_run_task_rest_required_fields(request_type=cloudtasks.RunTaskRequest): expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): diff --git a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index 12d8d620cecb..ede203ba75de 100644 --- a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_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 @@ -1794,11 +1788,7 @@ async def test_list_queues_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_queues(request={}) - ).pages: + async for page_ in (await client.list_queues(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5650,11 +5640,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 @@ -7085,7 +7071,7 @@ def test_list_queues_rest_required_fields(request_type=cloudtasks.ListQueuesRequ expected_params = [("$alt", "json;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_queues_rest_unset_required_fields(): @@ -7334,7 +7320,7 @@ def test_get_queue_rest_required_fields(request_type=cloudtasks.GetQueueRequest) expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -7511,7 +7497,7 @@ def test_create_queue_rest_required_fields(request_type=cloudtasks.CreateQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -7695,7 +7681,7 @@ def test_update_queue_rest_required_fields(request_type=cloudtasks.UpdateQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -7872,7 +7858,7 @@ def test_delete_queue_rest_required_fields(request_type=cloudtasks.DeleteQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8047,7 +8033,7 @@ def test_purge_queue_rest_required_fields(request_type=cloudtasks.PurgeQueueRequ expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8224,7 +8210,7 @@ def test_pause_queue_rest_required_fields(request_type=cloudtasks.PauseQueueRequ expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8401,7 +8387,7 @@ def test_resume_queue_rest_required_fields(request_type=cloudtasks.ResumeQueueRe expected_params = [("$alt", "json;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_queue_rest_unset_required_fields(): @@ -8578,7 +8564,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(): @@ -8755,7 +8741,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(): @@ -8948,7 +8934,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(): @@ -9142,7 +9128,7 @@ def test_list_tasks_rest_required_fields(request_type=cloudtasks.ListTasksReques expected_params = [("$alt", "json;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(): @@ -9390,7 +9376,7 @@ def test_get_task_rest_required_fields(request_type=cloudtasks.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(): @@ -9569,7 +9555,7 @@ def test_create_task_rest_required_fields(request_type=cloudtasks.CreateTaskRequ expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): @@ -9752,7 +9738,7 @@ def test_delete_task_rest_required_fields(request_type=cloudtasks.DeleteTaskRequ expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): @@ -9929,7 +9915,7 @@ def test_run_task_rest_required_fields(request_type=cloudtasks.RunTaskRequest): expected_params = [("$alt", "json;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_task_rest_unset_required_fields(): diff --git a/packages/google-cloud-telcoautomation/docs/conf.py b/packages/google-cloud-telcoautomation/docs/conf.py index 1d7f41c24961..18a7cbd88d84 100644 --- a/packages/google-cloud-telcoautomation/docs/conf.py +++ b/packages/google-cloud-telcoautomation/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-telcoautomation" -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-telcoautomation/google/cloud/telcoautomation_v1/__init__.py b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1/__init__.py index ad4aa3e1b264..b3563c10f192 100644 --- a/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1/__init__.py +++ b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_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.telco_automation import TelcoAutomationAsyncClient, TelcoAutomationClient from .types.telcoautomation import ( @@ -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.telcoautomation_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-telcoautomation/google/cloud/telcoautomation_v1/services/telco_automation/async_client.py b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1/services/telco_automation/async_client.py index 0cf666c6a4d3..852599d32ca3 100644 --- a/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1/services/telco_automation/async_client.py +++ b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1/services/telco_automation/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_orchestration_cluster(): ) # Make the request - operation = client.create_orchestration_cluster(request=request) + operation = await client.create_orchestration_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -750,11 +750,11 @@ async def sample_delete_orchestration_cluster(): ) # Make the request - operation = client.delete_orchestration_cluster(request=request) + operation = await client.delete_orchestration_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1122,11 +1122,11 @@ async def sample_create_edge_slm(): ) # Make the request - operation = client.create_edge_slm(request=request) + operation = await client.create_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1262,11 +1262,11 @@ async def sample_delete_edge_slm(): ) # Make the request - operation = client.delete_edge_slm(request=request) + operation = await client.delete_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/__init__.py b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/__init__.py index 916d16de8e87..91ee97c852b9 100644 --- a/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/__init__.py +++ b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/__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.telco_automation import TelcoAutomationAsyncClient, TelcoAutomationClient from .types.telcoautomation import ( @@ -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.telcoautomation_v1alpha1" - 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-telcoautomation/google/cloud/telcoautomation_v1alpha1/services/telco_automation/async_client.py b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/services/telco_automation/async_client.py index a7241b5e9d36..54b176489b01 100644 --- a/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/services/telco_automation/async_client.py +++ b/packages/google-cloud-telcoautomation/google/cloud/telcoautomation_v1alpha1/services/telco_automation/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_orchestration_cluster(): ) # Make the request - operation = client.create_orchestration_cluster(request=request) + operation = await client.create_orchestration_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -750,11 +750,11 @@ async def sample_delete_orchestration_cluster(): ) # Make the request - operation = client.delete_orchestration_cluster(request=request) + operation = await client.delete_orchestration_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1122,11 +1122,11 @@ async def sample_create_edge_slm(): ) # Make the request - operation = client.create_edge_slm(request=request) + operation = await client.create_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1262,11 +1262,11 @@ async def sample_delete_edge_slm(): ) # Make the request - operation = client.delete_edge_slm(request=request) + operation = await client.delete_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-telcoautomation/noxfile.py b/packages/google-cloud-telcoautomation/noxfile.py index 8619575986fc..f359d5096c6b 100644 --- a/packages/google-cloud-telcoautomation/noxfile.py +++ b/packages/google-cloud-telcoautomation/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-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_edge_slm_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_edge_slm_async.py index b1626fc8a2b8..560be8b4b781 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_edge_slm_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_edge_slm_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_edge_slm(): ) # Make the request - operation = client.create_edge_slm(request=request) + operation = await client.create_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_orchestration_cluster_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_orchestration_cluster_async.py index 82f41e1da2b6..a42d2a5bb9c6 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_orchestration_cluster_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_create_orchestration_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_create_orchestration_cluster(): ) # Make the request - operation = client.create_orchestration_cluster(request=request) + operation = await client.create_orchestration_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-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_edge_slm_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_edge_slm_async.py index 7154cc3b410a..e9322e2d0b57 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_edge_slm_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_edge_slm_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_edge_slm(): ) # Make the request - operation = client.delete_edge_slm(request=request) + operation = await client.delete_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_orchestration_cluster_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_orchestration_cluster_async.py index 54f200308711..ccacdae38e77 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_orchestration_cluster_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1_generated_telco_automation_delete_orchestration_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_orchestration_cluster(): ) # Make the request - operation = client.delete_orchestration_cluster(request=request) + operation = await client.delete_orchestration_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-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_edge_slm_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_edge_slm_async.py index 2baa8ea5eb23..8cbdf50de2e0 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_edge_slm_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_edge_slm_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_edge_slm(): ) # Make the request - operation = client.create_edge_slm(request=request) + operation = await client.create_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_orchestration_cluster_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_orchestration_cluster_async.py index 70ac8e3bd192..36e76f1fed5f 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_orchestration_cluster_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_create_orchestration_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_create_orchestration_cluster(): ) # Make the request - operation = client.create_orchestration_cluster(request=request) + operation = await client.create_orchestration_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-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_edge_slm_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_edge_slm_async.py index d1516a126b15..b14ebde53fa4 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_edge_slm_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_edge_slm_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_edge_slm(): ) # Make the request - operation = client.delete_edge_slm(request=request) + operation = await client.delete_edge_slm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_orchestration_cluster_async.py b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_orchestration_cluster_async.py index 58de5554c07b..cf74653a75e5 100644 --- a/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_orchestration_cluster_async.py +++ b/packages/google-cloud-telcoautomation/samples/generated_samples/telcoautomation_v1alpha1_generated_telco_automation_delete_orchestration_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_orchestration_cluster(): ) # Make the request - operation = client.delete_orchestration_cluster(request=request) + operation = await client.delete_orchestration_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-telcoautomation/setup.py b/packages/google-cloud-telcoautomation/setup.py index b5d42a006064..4b3a4142c38c 100644 --- a/packages/google-cloud-telcoautomation/setup.py +++ b/packages/google-cloud-telcoautomation/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-telcoautomation/testing/constraints-3.10.txt b/packages/google-cloud-telcoautomation/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-telcoautomation/testing/constraints-3.10.txt +++ b/packages/google-cloud-telcoautomation/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-telcoautomation/testing/constraints-3.9.txt b/packages/google-cloud-telcoautomation/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-telcoautomation/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-telcoautomation/tests/unit/gapic/telcoautomation_v1/test_telco_automation.py b/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1/test_telco_automation.py index 4fc88ac3df08..cfa370dea895 100644 --- a/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1/test_telco_automation.py +++ b/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1/test_telco_automation.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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_list_orchestration_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_orchestration_clusters(request={}) - ).pages: + async for page_ in (await client.list_orchestration_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3501,11 +3491,7 @@ async def test_list_edge_slms_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_edge_slms(request={}) - ).pages: + async for page_ in (await client.list_edge_slms(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6457,11 +6443,7 @@ async def test_list_blueprints_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_blueprints(request={}) - ).pages: + async for page_ in (await client.list_blueprints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8107,11 +8089,7 @@ async def test_list_blueprint_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_blueprint_revisions(request={}) - ).pages: + async for page_ in (await client.list_blueprint_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8668,11 +8646,7 @@ async def test_search_blueprint_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.search_blueprint_revisions(request={}) - ).pages: + async for page_ in (await client.search_blueprint_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9229,11 +9203,7 @@ async def test_search_deployment_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.search_deployment_revisions(request={}) - ).pages: + async for page_ in (await client.search_deployment_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10113,11 +10083,7 @@ async def test_list_public_blueprints_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_public_blueprints(request={}) - ).pages: + async for page_ in (await client.list_public_blueprints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12465,11 +12431,7 @@ async def test_list_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_deployments(request={}) - ).pages: + async for page_ in (await client.list_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13014,11 +12976,7 @@ async def test_list_deployment_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_deployment_revisions(request={}) - ).pages: + async for page_ in (await client.list_deployment_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15349,11 +15307,7 @@ async def test_list_hydrated_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_hydrated_deployments(request={}) - ).pages: + async for page_ in (await client.list_hydrated_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -16191,7 +16145,7 @@ def test_list_orchestration_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_orchestration_clusters_rest_unset_required_fields(): @@ -16450,7 +16404,7 @@ def test_get_orchestration_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_orchestration_cluster_rest_unset_required_fields(): @@ -16662,7 +16616,7 @@ def test_create_orchestration_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_orchestration_cluster_rest_unset_required_fields(): @@ -16868,7 +16822,7 @@ def test_delete_orchestration_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_orchestration_cluster_rest_unset_required_fields(): @@ -17055,7 +17009,7 @@ def test_list_edge_slms_rest_required_fields( expected_params = [("$alt", "json;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_edge_slms_rest_unset_required_fields(): @@ -17305,7 +17259,7 @@ def test_get_edge_slm_rest_required_fields( expected_params = [("$alt", "json;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_edge_slm_rest_unset_required_fields(): @@ -17504,7 +17458,7 @@ def test_create_edge_slm_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_edge_slm_rest_unset_required_fields(): @@ -17700,7 +17654,7 @@ def test_delete_edge_slm_rest_required_fields( expected_params = [("$alt", "json;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_edge_slm_rest_unset_required_fields(): @@ -17880,7 +17834,7 @@ def test_create_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18072,7 +18026,7 @@ def test_update_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18266,7 +18220,7 @@ def test_get_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18445,7 +18399,7 @@ def test_delete_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18631,7 +18585,7 @@ def test_list_blueprints_rest_required_fields( expected_params = [("$alt", "json;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_blueprints_rest_unset_required_fields(): @@ -18888,7 +18842,7 @@ def test_approve_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -19071,7 +19025,7 @@ def test_propose_blueprint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_propose_blueprint_rest_unset_required_fields(): @@ -19254,7 +19208,7 @@ def test_reject_blueprint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reject_blueprint_rest_unset_required_fields(): @@ -19448,7 +19402,7 @@ def test_list_blueprint_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_blueprint_revisions_rest_unset_required_fields(): @@ -19729,7 +19683,7 @@ def test_search_blueprint_revisions_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_blueprint_revisions_rest_unset_required_fields(): @@ -20019,7 +19973,7 @@ def test_search_deployment_revisions_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_deployment_revisions_rest_unset_required_fields(): @@ -20291,7 +20245,7 @@ def test_discard_blueprint_changes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_discard_blueprint_changes_rest_unset_required_fields(): @@ -20483,7 +20437,7 @@ def test_list_public_blueprints_rest_required_fields( expected_params = [("$alt", "json;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_public_blueprints_rest_unset_required_fields(): @@ -20736,7 +20690,7 @@ def test_get_public_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_public_blueprint_rest_unset_required_fields(): @@ -20921,7 +20875,7 @@ def test_create_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_create_deployment_rest_unset_required_fields(): @@ -21113,7 +21067,7 @@ def test_update_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_deployment_rest_unset_required_fields(): @@ -21307,7 +21261,7 @@ def test_get_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_deployment_rest_unset_required_fields(): @@ -21487,7 +21441,7 @@ def test_remove_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_remove_deployment_rest_unset_required_fields(): @@ -21675,7 +21629,7 @@ def test_list_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_deployments_rest_unset_required_fields(): @@ -21943,7 +21897,7 @@ def test_list_deployment_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_deployment_revisions_rest_unset_required_fields(): @@ -22204,7 +22158,7 @@ def test_discard_deployment_changes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_discard_deployment_changes_rest_unset_required_fields(): @@ -22387,7 +22341,7 @@ def test_apply_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_apply_deployment_rest_unset_required_fields(): @@ -22574,7 +22528,7 @@ def test_compute_deployment_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_compute_deployment_status_rest_unset_required_fields(): @@ -22763,7 +22717,7 @@ def test_rollback_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_rollback_deployment_rest_unset_required_fields(): @@ -22958,7 +22912,7 @@ def test_get_hydrated_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_hydrated_deployment_rest_unset_required_fields(): @@ -23152,7 +23106,7 @@ def test_list_hydrated_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_hydrated_deployments_rest_unset_required_fields(): @@ -23408,7 +23362,7 @@ def test_update_hydrated_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_hydrated_deployment_rest_unset_required_fields(): @@ -23606,7 +23560,7 @@ def test_apply_hydrated_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_apply_hydrated_deployment_rest_unset_required_fields(): diff --git a/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1alpha1/test_telco_automation.py b/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1alpha1/test_telco_automation.py index 769e0c54d12d..65fc6a98bc2d 100644 --- a/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1alpha1/test_telco_automation.py +++ b/packages/google-cloud-telcoautomation/tests/unit/gapic/telcoautomation_v1alpha1/test_telco_automation.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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_list_orchestration_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_orchestration_clusters(request={}) - ).pages: + async for page_ in (await client.list_orchestration_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3501,11 +3491,7 @@ async def test_list_edge_slms_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_edge_slms(request={}) - ).pages: + async for page_ in (await client.list_edge_slms(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6457,11 +6443,7 @@ async def test_list_blueprints_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_blueprints(request={}) - ).pages: + async for page_ in (await client.list_blueprints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8107,11 +8089,7 @@ async def test_list_blueprint_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_blueprint_revisions(request={}) - ).pages: + async for page_ in (await client.list_blueprint_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8668,11 +8646,7 @@ async def test_search_blueprint_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.search_blueprint_revisions(request={}) - ).pages: + async for page_ in (await client.search_blueprint_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9229,11 +9203,7 @@ async def test_search_deployment_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.search_deployment_revisions(request={}) - ).pages: + async for page_ in (await client.search_deployment_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10113,11 +10083,7 @@ async def test_list_public_blueprints_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_public_blueprints(request={}) - ).pages: + async for page_ in (await client.list_public_blueprints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12465,11 +12431,7 @@ async def test_list_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_deployments(request={}) - ).pages: + async for page_ in (await client.list_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13014,11 +12976,7 @@ async def test_list_deployment_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_deployment_revisions(request={}) - ).pages: + async for page_ in (await client.list_deployment_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15349,11 +15307,7 @@ async def test_list_hydrated_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_hydrated_deployments(request={}) - ).pages: + async for page_ in (await client.list_hydrated_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -16191,7 +16145,7 @@ def test_list_orchestration_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_orchestration_clusters_rest_unset_required_fields(): @@ -16450,7 +16404,7 @@ def test_get_orchestration_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_orchestration_cluster_rest_unset_required_fields(): @@ -16662,7 +16616,7 @@ def test_create_orchestration_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_orchestration_cluster_rest_unset_required_fields(): @@ -16868,7 +16822,7 @@ def test_delete_orchestration_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_orchestration_cluster_rest_unset_required_fields(): @@ -17055,7 +17009,7 @@ def test_list_edge_slms_rest_required_fields( expected_params = [("$alt", "json;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_edge_slms_rest_unset_required_fields(): @@ -17306,7 +17260,7 @@ def test_get_edge_slm_rest_required_fields( expected_params = [("$alt", "json;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_edge_slm_rest_unset_required_fields(): @@ -17506,7 +17460,7 @@ def test_create_edge_slm_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_edge_slm_rest_unset_required_fields(): @@ -17703,7 +17657,7 @@ def test_delete_edge_slm_rest_required_fields( expected_params = [("$alt", "json;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_edge_slm_rest_unset_required_fields(): @@ -17884,7 +17838,7 @@ def test_create_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18076,7 +18030,7 @@ def test_update_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18270,7 +18224,7 @@ def test_get_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18449,7 +18403,7 @@ def test_delete_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -18635,7 +18589,7 @@ def test_list_blueprints_rest_required_fields( expected_params = [("$alt", "json;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_blueprints_rest_unset_required_fields(): @@ -18892,7 +18846,7 @@ def test_approve_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_blueprint_rest_unset_required_fields(): @@ -19075,7 +19029,7 @@ def test_propose_blueprint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_propose_blueprint_rest_unset_required_fields(): @@ -19258,7 +19212,7 @@ def test_reject_blueprint_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reject_blueprint_rest_unset_required_fields(): @@ -19452,7 +19406,7 @@ def test_list_blueprint_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_blueprint_revisions_rest_unset_required_fields(): @@ -19733,7 +19687,7 @@ def test_search_blueprint_revisions_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_blueprint_revisions_rest_unset_required_fields(): @@ -20023,7 +19977,7 @@ def test_search_deployment_revisions_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_deployment_revisions_rest_unset_required_fields(): @@ -20295,7 +20249,7 @@ def test_discard_blueprint_changes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_discard_blueprint_changes_rest_unset_required_fields(): @@ -20487,7 +20441,7 @@ def test_list_public_blueprints_rest_required_fields( expected_params = [("$alt", "json;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_public_blueprints_rest_unset_required_fields(): @@ -20740,7 +20694,7 @@ def test_get_public_blueprint_rest_required_fields( expected_params = [("$alt", "json;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_public_blueprint_rest_unset_required_fields(): @@ -20925,7 +20879,7 @@ def test_create_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_create_deployment_rest_unset_required_fields(): @@ -21117,7 +21071,7 @@ def test_update_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_deployment_rest_unset_required_fields(): @@ -21311,7 +21265,7 @@ def test_get_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_deployment_rest_unset_required_fields(): @@ -21491,7 +21445,7 @@ def test_remove_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_remove_deployment_rest_unset_required_fields(): @@ -21679,7 +21633,7 @@ def test_list_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_deployments_rest_unset_required_fields(): @@ -21947,7 +21901,7 @@ def test_list_deployment_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_deployment_revisions_rest_unset_required_fields(): @@ -22208,7 +22162,7 @@ def test_discard_deployment_changes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_discard_deployment_changes_rest_unset_required_fields(): @@ -22391,7 +22345,7 @@ def test_apply_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_apply_deployment_rest_unset_required_fields(): @@ -22578,7 +22532,7 @@ def test_compute_deployment_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_compute_deployment_status_rest_unset_required_fields(): @@ -22767,7 +22721,7 @@ def test_rollback_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_rollback_deployment_rest_unset_required_fields(): @@ -22962,7 +22916,7 @@ def test_get_hydrated_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_hydrated_deployment_rest_unset_required_fields(): @@ -23156,7 +23110,7 @@ def test_list_hydrated_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_hydrated_deployments_rest_unset_required_fields(): @@ -23412,7 +23366,7 @@ def test_update_hydrated_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_hydrated_deployment_rest_unset_required_fields(): @@ -23610,7 +23564,7 @@ def test_apply_hydrated_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_apply_hydrated_deployment_rest_unset_required_fields(): diff --git a/packages/google-cloud-texttospeech/docs/conf.py b/packages/google-cloud-texttospeech/docs/conf.py index 4659436ada3e..3043a37975fa 100644 --- a/packages/google-cloud-texttospeech/docs/conf.py +++ b/packages/google-cloud-texttospeech/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-texttospeech" -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-texttospeech/google/cloud/texttospeech_v1/__init__.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py index 39f5546120f0..93755da86ee2 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_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.text_to_speech import TextToSpeechAsyncClient, TextToSpeechClient from .services.text_to_speech_long_audio_synthesize import ( @@ -74,28 +68,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.texttospeech_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-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py index 3bd7e10c9e66..e761b4cd91ae 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/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. @@ -365,11 +365,11 @@ async def sample_synthesize_long_audio(): ) # Make the request - operation = client.synthesize_long_audio(request=request) + operation = await client.synthesize_long_audio(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/__init__.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/__init__.py index 46557f22a3af..0ac7c07db17e 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/__init__.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_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.text_to_speech import TextToSpeechAsyncClient, TextToSpeechClient from .services.text_to_speech_long_audio_synthesize import ( @@ -75,28 +69,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.texttospeech_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-texttospeech/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/async_client.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/async_client.py index 879256310dc5..c2f5681c8c18 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/async_client.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/services/text_to_speech_long_audio_synthesize/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. @@ -365,11 +365,11 @@ async def sample_synthesize_long_audio(): ) # Make the request - operation = client.synthesize_long_audio(request=request) + operation = await client.synthesize_long_audio(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-texttospeech/noxfile.py b/packages/google-cloud-texttospeech/noxfile.py index b6595f37b11f..c990ebb26fad 100644 --- a/packages/google-cloud-texttospeech/noxfile.py +++ b/packages/google-cloud-texttospeech/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-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py index f5b1e4031ea7..755aeae0ab76 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py +++ b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_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_synthesize_long_audio(): ) # Make the request - operation = client.synthesize_long_audio(request=request) + operation = await client.synthesize_long_audio(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1beta1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1beta1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py index 68543b8e5335..de1f41ef531e 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1beta1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py +++ b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1beta1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_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_synthesize_long_audio(): ) # Make the request - operation = client.synthesize_long_audio(request=request) + operation = await client.synthesize_long_audio(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-texttospeech/setup.py b/packages/google-cloud-texttospeech/setup.py index 6389b289aeaf..e4e322da9523 100644 --- a/packages/google-cloud-texttospeech/setup.py +++ b/packages/google-cloud-texttospeech/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-texttospeech/testing/constraints-3.10.txt b/packages/google-cloud-texttospeech/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-texttospeech/testing/constraints-3.10.txt +++ b/packages/google-cloud-texttospeech/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-texttospeech/testing/constraints-3.9.txt b/packages/google-cloud-texttospeech/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-texttospeech/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-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech.py b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech.py index ea10c4ee9538..25928a91f6bd 100644 --- a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech.py +++ b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2201,7 +2195,7 @@ def test_synthesize_speech_rest_required_fields( expected_params = [] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_synthesize_speech_rest_unset_required_fields(): diff --git a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech_long_audio_synthesize.py b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech_long_audio_synthesize.py index a4a717dc61b7..630f7c1c6b20 100644 --- a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech_long_audio_synthesize.py +++ b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1/test_text_to_speech_long_audio_synthesize.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1829,7 +1823,7 @@ def test_synthesize_long_audio_rest_required_fields( expected_params = [] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_synthesize_long_audio_rest_unset_required_fields(): diff --git a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech.py b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech.py index 9941b2fd890c..168bf837d172 100644 --- a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech.py +++ b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2203,7 +2197,7 @@ def test_synthesize_speech_rest_required_fields( expected_params = [] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_synthesize_speech_rest_unset_required_fields(): diff --git a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech_long_audio_synthesize.py b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech_long_audio_synthesize.py index 8eaad585c421..212322116525 100644 --- a/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech_long_audio_synthesize.py +++ b/packages/google-cloud-texttospeech/tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech_long_audio_synthesize.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1829,7 +1823,7 @@ def test_synthesize_long_audio_rest_required_fields( expected_params = [] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_synthesize_long_audio_rest_unset_required_fields(): diff --git a/packages/google-cloud-tpu/docs/conf.py b/packages/google-cloud-tpu/docs/conf.py index 0e41e7a0c9f0..9023f768e2ea 100644 --- a/packages/google-cloud-tpu/docs/conf.py +++ b/packages/google-cloud-tpu/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-tpu" -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-tpu/google/cloud/tpu_v1/__init__.py b/packages/google-cloud-tpu/google/cloud/tpu_v1/__init__.py index 46f79b2cfcd4..2a61f42cd6be 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v1/__init__.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_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.tpu import TpuAsyncClient, TpuClient from .types.cloud_tpu import ( @@ -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.tpu_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-tpu/google/cloud/tpu_v1/services/tpu/async_client.py b/packages/google-cloud-tpu/google/cloud/tpu_v1/services/tpu/async_client.py index b1c4f45411fe..0bc773343230 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v1/services/tpu/async_client.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_v1/services/tpu/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. @@ -565,11 +565,11 @@ async def sample_create_node(): ) # Make the request - operation = client.create_node(request=request) + operation = await client.create_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -702,11 +702,11 @@ async def sample_delete_node(): ) # Make the request - operation = client.delete_node(request=request) + operation = await client.delete_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -823,11 +823,11 @@ async def sample_reimage_node(): ) # Make the request - operation = client.reimage_node(request=request) + operation = await client.reimage_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -923,11 +923,11 @@ async def sample_stop_node(): ) # Make the request - operation = client.stop_node(request=request) + operation = await client.stop_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1022,11 +1022,11 @@ async def sample_start_node(): ) # Make the request - operation = client.start_node(request=request) + operation = await client.start_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/google/cloud/tpu_v2/__init__.py b/packages/google-cloud-tpu/google/cloud/tpu_v2/__init__.py index 1373358b5ad4..c69b2ad5605d 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v2/__init__.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_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.tpu import TpuAsyncClient, TpuClient from .types.cloud_tpu import ( @@ -85,28 +79,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.tpu_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-tpu/google/cloud/tpu_v2/services/tpu/async_client.py b/packages/google-cloud-tpu/google/cloud/tpu_v2/services/tpu/async_client.py index 536d90dc6730..04f1b5a9fe54 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v2/services/tpu/async_client.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_v2/services/tpu/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. @@ -566,11 +566,11 @@ async def sample_create_node(): ) # Make the request - operation = client.create_node(request=request) + operation = await client.create_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -703,11 +703,11 @@ async def sample_delete_node(): ) # Make the request - operation = client.delete_node(request=request) + operation = await client.delete_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -834,11 +834,11 @@ async def sample_stop_node(): ) # Make the request - operation = client.stop_node(request=request) + operation = await client.stop_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -934,11 +934,11 @@ async def sample_start_node(): ) # Make the request - operation = client.start_node(request=request) + operation = await client.start_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1039,11 +1039,11 @@ async def sample_update_node(): ) # Make the request - operation = client.update_node(request=request) + operation = await client.update_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1413,11 +1413,11 @@ async def sample_create_queued_resource(): ) # Make the request - operation = client.create_queued_resource(request=request) + operation = await client.create_queued_resource(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_delete_queued_resource(): ) # Make the request - operation = client.delete_queued_resource(request=request) + operation = await client.delete_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1684,11 +1684,11 @@ async def sample_reset_queued_resource(): ) # Make the request - operation = client.reset_queued_resource(request=request) + operation = await client.reset_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/__init__.py b/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/__init__.py index a8f01ad5360b..cd780ec23b07 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/__init__.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/__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.tpu import TpuAsyncClient, TpuClient from .types.cloud_tpu import ( @@ -94,28 +88,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.tpu_v2alpha1" - 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-tpu/google/cloud/tpu_v2alpha1/services/tpu/async_client.py b/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/services/tpu/async_client.py index 17a8c49f1134..ea3973c1e629 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/services/tpu/async_client.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/services/tpu/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. @@ -569,11 +569,11 @@ async def sample_create_node(): ) # Make the request - operation = client.create_node(request=request) + operation = await client.create_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -707,11 +707,11 @@ async def sample_delete_node(): ) # Make the request - operation = client.delete_node(request=request) + operation = await client.delete_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -838,11 +838,11 @@ async def sample_stop_node(): ) # Make the request - operation = client.stop_node(request=request) + operation = await client.stop_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -939,11 +939,11 @@ async def sample_start_node(): ) # Make the request - operation = client.start_node(request=request) + operation = await client.start_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1045,11 +1045,11 @@ async def sample_update_node(): ) # Make the request - operation = client.update_node(request=request) + operation = await client.update_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1182,11 +1182,11 @@ async def sample_perform_maintenance(): ) # Make the request - operation = client.perform_maintenance(request=request) + operation = await client.perform_maintenance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1521,11 +1521,11 @@ async def sample_create_queued_resource(): ) # Make the request - operation = client.create_queued_resource(request=request) + operation = await client.create_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1661,11 +1661,11 @@ async def sample_delete_queued_resource(): ) # Make the request - operation = client.delete_queued_resource(request=request) + operation = await client.delete_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1785,11 +1785,11 @@ async def sample_reset_queued_resource(): ) # Make the request - operation = client.reset_queued_resource(request=request) + operation = await client.reset_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1913,11 +1913,11 @@ async def sample_perform_maintenance_queued_resource(): ) # Make the request - operation = client.perform_maintenance_queued_resource(request=request) + operation = await client.perform_maintenance_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2757,11 +2757,11 @@ async def sample_simulate_maintenance_event(): ) # Make the request - operation = client.simulate_maintenance_event(request=request) + operation = await client.simulate_maintenance_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/noxfile.py b/packages/google-cloud-tpu/noxfile.py index b1e138c76761..96f8a06d311a 100644 --- a/packages/google-cloud-tpu/noxfile.py +++ b/packages/google-cloud-tpu/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-tpu/samples/generated_samples/tpu_v1_generated_tpu_create_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_create_node_async.py index 1280d3aadbe6..cd11a27730fd 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_create_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_create_node_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_node(): ) # Make the request - operation = client.create_node(request=request) + operation = await client.create_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_delete_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_delete_node_async.py index 2585f462dc22..036002ef636d 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_delete_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_delete_node_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_node(): ) # Make the request - operation = client.delete_node(request=request) + operation = await client.delete_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_reimage_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_reimage_node_async.py index 47296307bac9..5e83fbd1ab55 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_reimage_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_reimage_node_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_reimage_node(): request = tpu_v1.ReimageNodeRequest() # Make the request - operation = client.reimage_node(request=request) + operation = await client.reimage_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_start_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_start_node_async.py index 4b33f42ac012..af9ec6ca921e 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_start_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_start_node_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_start_node(): request = tpu_v1.StartNodeRequest() # Make the request - operation = client.start_node(request=request) + operation = await client.start_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_stop_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_stop_node_async.py index 6067e542dabf..a710043d9db8 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_stop_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v1_generated_tpu_stop_node_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_stop_node(): request = tpu_v1.StopNodeRequest() # Make the request - operation = client.stop_node(request=request) + operation = await client.stop_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_node_async.py index a3a4bcef7dfa..adc2a1a16cbb 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_node_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_node(): ) # Make the request - operation = client.create_node(request=request) + operation = await client.create_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_queued_resource_async.py index 89854c39c5d5..87d0121c4ce5 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_create_queued_resource_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_queued_resource(): ) # Make the request - operation = client.create_queued_resource(request=request) + operation = await client.create_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_node_async.py index bf3f435e9283..b023271c3a6f 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_node_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_node(): ) # Make the request - operation = client.delete_node(request=request) + operation = await client.delete_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_queued_resource_async.py index 72ef2935836b..665c8b70adbb 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_delete_queued_resource_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_queued_resource(): ) # Make the request - operation = client.delete_queued_resource(request=request) + operation = await client.delete_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_reset_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_reset_queued_resource_async.py index 9a0630ccfedd..f2633c5b9cf1 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_reset_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_reset_queued_resource_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_reset_queued_resource(): ) # Make the request - operation = client.reset_queued_resource(request=request) + operation = await client.reset_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_start_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_start_node_async.py index 2cca1ed0c163..ce8e4da2ecc1 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_start_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_start_node_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_node(): ) # Make the request - operation = client.start_node(request=request) + operation = await client.start_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_stop_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_stop_node_async.py index c608356adb41..90dd952872e4 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_stop_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_stop_node_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_node(): ) # Make the request - operation = client.stop_node(request=request) + operation = await client.stop_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_update_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_update_node_async.py index bfcd0affef9c..71170fec8a81 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_update_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2_generated_tpu_update_node_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_node(): ) # Make the request - operation = client.update_node(request=request) + operation = await client.update_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_node_async.py index cb2ce4dea74a..22139fe9ea43 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_node_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_node(): ) # Make the request - operation = client.create_node(request=request) + operation = await client.create_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_queued_resource_async.py index bd27f7f29b21..a5ed7d861337 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_create_queued_resource_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_queued_resource(): ) # Make the request - operation = client.create_queued_resource(request=request) + operation = await client.create_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_node_async.py index 250a3d906dbc..cefdbfc51b1f 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_node_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_node(): ) # Make the request - operation = client.delete_node(request=request) + operation = await client.delete_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_queued_resource_async.py index 7517f2f01b83..fca0924fecda 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_delete_queued_resource_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_queued_resource(): ) # Make the request - operation = client.delete_queued_resource(request=request) + operation = await client.delete_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_async.py index 2d4b28f179d4..fe14ad56a019 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_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. @@ -44,11 +44,11 @@ async def sample_perform_maintenance(): ) # Make the request - operation = client.perform_maintenance(request=request) + operation = await client.perform_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-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_queued_resource_async.py index afc221f6b016..83d8a901ea8a 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_perform_maintenance_queued_resource_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_perform_maintenance_queued_resource(): ) # Make the request - operation = client.perform_maintenance_queued_resource(request=request) + operation = await client.perform_maintenance_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_reset_queued_resource_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_reset_queued_resource_async.py index 66adffc95c23..971f276c79a1 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_reset_queued_resource_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_reset_queued_resource_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_reset_queued_resource(): ) # Make the request - operation = client.reset_queued_resource(request=request) + operation = await client.reset_queued_resource(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_simulate_maintenance_event_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_simulate_maintenance_event_async.py index 708797bc4cac..98e37e8c18ac 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_simulate_maintenance_event_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_simulate_maintenance_event_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_simulate_maintenance_event(): ) # Make the request - operation = client.simulate_maintenance_event(request=request) + operation = await client.simulate_maintenance_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_start_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_start_node_async.py index f14d43fe680d..1db7786d6476 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_start_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_start_node_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_node(): ) # Make the request - operation = client.start_node(request=request) + operation = await client.start_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_stop_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_stop_node_async.py index ff59ce518689..38c7de3a4fa5 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_stop_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_stop_node_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_node(): ) # Make the request - operation = client.stop_node(request=request) + operation = await client.stop_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_update_node_async.py b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_update_node_async.py index 6e92b743b75f..4a9735470d6d 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_update_node_async.py +++ b/packages/google-cloud-tpu/samples/generated_samples/tpu_v2alpha1_generated_tpu_update_node_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_node(): ) # Make the request - operation = client.update_node(request=request) + operation = await client.update_node(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-tpu/setup.py b/packages/google-cloud-tpu/setup.py index e931ef2b3908..42159f9f3018 100644 --- a/packages/google-cloud-tpu/setup.py +++ b/packages/google-cloud-tpu/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-tpu/testing/constraints-3.10.txt b/packages/google-cloud-tpu/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-tpu/testing/constraints-3.10.txt +++ b/packages/google-cloud-tpu/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-tpu/testing/constraints-3.9.txt b/packages/google-cloud-tpu/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-tpu/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-tpu/tests/unit/gapic/tpu_v1/test_tpu.py b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v1/test_tpu.py index 848695217802..1e86a282d28e 100644 --- a/packages/google-cloud-tpu/tests/unit/gapic/tpu_v1/test_tpu.py +++ b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v1/test_tpu.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1711,11 +1705,7 @@ async def test_list_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_nodes(request={}) - ).pages: + async for page_ in (await client.list_nodes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4046,11 +4036,7 @@ async def test_list_tensor_flow_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_tensor_flow_versions(request={}) - ).pages: + async for page_ in (await client.list_tensor_flow_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4946,11 +4932,7 @@ async def test_list_accelerator_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_accelerator_types(request={}) - ).pages: + async for page_ in (await client.list_accelerator_types(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-tpu/tests/unit/gapic/tpu_v2/test_tpu.py b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2/test_tpu.py index b4123760a9a1..b272560e4e09 100644 --- a/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2/test_tpu.py +++ b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2/test_tpu.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1737,11 +1731,7 @@ async def test_list_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_nodes(request={}) - ).pages: + async for page_ in (await client.list_nodes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4147,11 +4137,7 @@ async def test_list_queued_resources_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_queued_resources(request={}) - ).pages: + async for page_ in (await client.list_queued_resources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6361,11 +6347,7 @@ async def test_list_accelerator_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_accelerator_types(request={}) - ).pages: + async for page_ in (await client.list_accelerator_types(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7260,11 +7242,7 @@ async def test_list_runtime_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_runtime_versions(request={}) - ).pages: + async for page_ in (await client.list_runtime_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7979,7 +7957,7 @@ def test_list_nodes_rest_required_fields(request_type=cloud_tpu.ListNodesRequest expected_params = [("$alt", "json;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_nodes_rest_unset_required_fields(): @@ -8223,7 +8201,7 @@ def test_get_node_rest_required_fields(request_type=cloud_tpu.GetNodeRequest): expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -8402,7 +8380,7 @@ def test_create_node_rest_required_fields(request_type=cloud_tpu.CreateNodeReque expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -8588,7 +8566,7 @@ def test_delete_node_rest_required_fields(request_type=cloud_tpu.DeleteNodeReque expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -8763,7 +8741,7 @@ def test_stop_node_rest_required_fields(request_type=cloud_tpu.StopNodeRequest): expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -8883,7 +8861,7 @@ def test_start_node_rest_required_fields(request_type=cloud_tpu.StartNodeRequest expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -9000,7 +8978,7 @@ def test_update_node_rest_required_fields(request_type=cloud_tpu.UpdateNodeReque expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -9199,7 +9177,7 @@ def test_list_queued_resources_rest_required_fields( expected_params = [("$alt", "json;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_queued_resources_rest_unset_required_fields(): @@ -9452,7 +9430,7 @@ def test_get_queued_resource_rest_required_fields( expected_params = [("$alt", "json;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_queued_resource_rest_unset_required_fields(): @@ -9646,7 +9624,7 @@ def test_create_queued_resource_rest_required_fields( expected_params = [("$alt", "json;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_queued_resource_rest_unset_required_fields(): @@ -9852,7 +9830,7 @@ def test_delete_queued_resource_rest_required_fields( expected_params = [("$alt", "json;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_queued_resource_rest_unset_required_fields(): @@ -10045,7 +10023,7 @@ def test_reset_queued_resource_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reset_queued_resource_rest_unset_required_fields(): @@ -10229,7 +10207,7 @@ def test_generate_service_identity_rest_required_fields( expected_params = [("$alt", "json;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_service_identity_rest_unset_required_fields(): @@ -10363,7 +10341,7 @@ def test_list_accelerator_types_rest_required_fields( expected_params = [("$alt", "json;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_accelerator_types_rest_unset_required_fields(): @@ -10618,7 +10596,7 @@ def test_get_accelerator_type_rest_required_fields( expected_params = [("$alt", "json;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_accelerator_type_rest_unset_required_fields(): @@ -10812,7 +10790,7 @@ def test_list_runtime_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_runtime_versions_rest_unset_required_fields(): @@ -11067,7 +11045,7 @@ def test_get_runtime_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_runtime_version_rest_unset_required_fields(): @@ -11252,7 +11230,7 @@ def test_get_guest_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_get_guest_attributes_rest_unset_required_fields(): diff --git a/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py index 5360c05b20c7..48b3aa20d2b7 100644 --- a/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py +++ b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1717,11 +1711,7 @@ async def test_list_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_nodes(request={}) - ).pages: + async for page_ in (await client.list_nodes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4394,11 +4384,7 @@ async def test_list_queued_resources_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_queued_resources(request={}) - ).pages: + async for page_ in (await client.list_queued_resources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6869,11 +6855,7 @@ async def test_list_accelerator_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_accelerator_types(request={}) - ).pages: + async for page_ in (await client.list_accelerator_types(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7768,11 +7750,7 @@ async def test_list_runtime_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_runtime_versions(request={}) - ).pages: + async for page_ in (await client.list_runtime_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8821,11 +8799,7 @@ async def test_list_reservations_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_reservations(request={}) - ).pages: + async for page_ in (await client.list_reservations(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-trace/docs/conf.py b/packages/google-cloud-trace/docs/conf.py index d2b1d803cf15..9c8f2ebf08be 100644 --- a/packages/google-cloud-trace/docs/conf.py +++ b/packages/google-cloud-trace/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-trace" -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-trace/google/cloud/trace_v1/__init__.py b/packages/google-cloud-trace/google/cloud/trace_v1/__init__.py index b499e93e3214..61679a3445c2 100644 --- a/packages/google-cloud-trace/google/cloud/trace_v1/__init__.py +++ b/packages/google-cloud-trace/google/cloud/trace_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.trace_service import TraceServiceAsyncClient, TraceServiceClient from .types.trace import ( @@ -49,28 +43,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.trace_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-trace/google/cloud/trace_v2/__init__.py b/packages/google-cloud-trace/google/cloud/trace_v2/__init__.py index 388317837ed6..4b3f460d1ac4 100644 --- a/packages/google-cloud-trace/google/cloud/trace_v2/__init__.py +++ b/packages/google-cloud-trace/google/cloud/trace_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.trace_service import TraceServiceAsyncClient, TraceServiceClient from .types.trace import AttributeValue, Module, Span, StackTrace, TruncatableString @@ -42,28 +36,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.trace_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-trace/noxfile.py b/packages/google-cloud-trace/noxfile.py index bdc087de6a9a..0517ab1b7927 100644 --- a/packages/google-cloud-trace/noxfile.py +++ b/packages/google-cloud-trace/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-trace/setup.py b/packages/google-cloud-trace/setup.py index 170deaf6d9f7..045a80656a27 100644 --- a/packages/google-cloud-trace/setup.py +++ b/packages/google-cloud-trace/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-trace/testing/constraints-3.10.txt b/packages/google-cloud-trace/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-trace/testing/constraints-3.10.txt +++ b/packages/google-cloud-trace/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-trace/testing/constraints-3.9.txt b/packages/google-cloud-trace/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-trace/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-trace/tests/unit/gapic/trace_v1/test_trace_service.py b/packages/google-cloud-trace/tests/unit/gapic/trace_v1/test_trace_service.py index ea98b515beb3..533093f99d85 100644 --- a/packages/google-cloud-trace/tests/unit/gapic/trace_v1/test_trace_service.py +++ b/packages/google-cloud-trace/tests/unit/gapic/trace_v1/test_trace_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 @@ -1808,11 +1802,7 @@ async def test_list_traces_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_traces(request={}) - ).pages: + async for page_ in (await client.list_traces(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2592,7 +2582,7 @@ def test_list_traces_rest_required_fields(request_type=trace.ListTracesRequest): expected_params = [("$alt", "json;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_traces_rest_unset_required_fields(): @@ -2844,7 +2834,7 @@ def test_get_trace_rest_required_fields(request_type=trace.GetTraceRequest): expected_params = [("$alt", "json;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_trace_rest_unset_required_fields(): @@ -3027,7 +3017,7 @@ def test_patch_traces_rest_required_fields(request_type=trace.PatchTracesRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_patch_traces_rest_unset_required_fields(): diff --git a/packages/google-cloud-trace/tests/unit/gapic/trace_v2/test_trace_service.py b/packages/google-cloud-trace/tests/unit/gapic/trace_v2/test_trace_service.py index c5da3a35eb3f..652d485f2826 100644 --- a/packages/google-cloud-trace/tests/unit/gapic/trace_v2/test_trace_service.py +++ b/packages/google-cloud-trace/tests/unit/gapic/trace_v2/test_trace_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 @@ -1996,7 +1990,7 @@ def test_batch_write_spans_rest_required_fields( expected_params = [("$alt", "json;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_write_spans_rest_unset_required_fields(): @@ -2184,7 +2178,7 @@ def test_create_span_rest_required_fields(request_type=trace.Span): expected_params = [("$alt", "json;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_span_rest_unset_required_fields(): diff --git a/packages/google-cloud-translate/docs/conf.py b/packages/google-cloud-translate/docs/conf.py index d7a2c40f3b32..91990d6564eb 100644 --- a/packages/google-cloud-translate/docs/conf.py +++ b/packages/google-cloud-translate/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-translate" -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-translate/google/cloud/translate_v3/__init__.py b/packages/google-cloud-translate/google/cloud/translate_v3/__init__.py index 2596b102dc75..5d37c2dd5d73 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3/__init__.py +++ b/packages/google-cloud-translate/google/cloud/translate_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.translation_service import ( TranslationServiceAsyncClient, @@ -151,28 +145,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.translate_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-translate/google/cloud/translate_v3/services/translation_service/async_client.py b/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py index 00a0e5d68bf3..5d52b441f701 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3/services/translation_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. @@ -1156,11 +1156,11 @@ async def sample_batch_translate_text(): ) # Make the request - operation = client.batch_translate_text(request=request) + operation = await client.batch_translate_text(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1285,11 +1285,11 @@ async def sample_batch_translate_document(): ) # Make the request - operation = client.batch_translate_document(request=request) + operation = await client.batch_translate_document(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1482,11 +1482,11 @@ async def sample_create_glossary(): ) # Make the request - operation = client.create_glossary(request=request) + operation = await client.create_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1619,11 +1619,11 @@ async def sample_update_glossary(): ) # Make the request - operation = client.update_glossary(request=request) + operation = await client.update_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2000,11 +2000,11 @@ async def sample_delete_glossary(): ) # Make the request - operation = client.delete_glossary(request=request) + operation = await client.delete_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2706,11 +2706,11 @@ async def sample_create_dataset(): ) # Make the request - operation = client.create_dataset(request=request) + operation = await client.create_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3071,11 +3071,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4384,11 +4384,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) @@ -4531,11 +4531,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) @@ -4798,11 +4798,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) @@ -5163,11 +5163,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_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-translate/google/cloud/translate_v3beta1/__init__.py b/packages/google-cloud-translate/google/cloud/translate_v3beta1/__init__.py index b9db6ba05215..1983fb0586dc 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3beta1/__init__.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3beta1/__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.translation_service import ( TranslationServiceAsyncClient, @@ -85,28 +79,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.translate_v3beta1" - 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-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py b/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py index 42ab70f7cdb6..13dce190a0cc 100644 --- a/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py +++ b/packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_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. @@ -856,11 +856,11 @@ async def sample_batch_translate_text(): ) # Make the request - operation = client.batch_translate_text(request=request) + operation = await client.batch_translate_text(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -985,11 +985,11 @@ async def sample_batch_translate_document(): ) # Make the request - operation = client.batch_translate_document(request=request) + operation = await client.batch_translate_document(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1182,11 +1182,11 @@ async def sample_create_glossary(): ) # Make the request - operation = client.create_glossary(request=request) + operation = await client.create_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1593,11 +1593,11 @@ async def sample_delete_glossary(): ) # Make the request - operation = client.delete_glossary(request=request) + operation = await client.delete_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/noxfile.py b/packages/google-cloud-translate/noxfile.py index bfb500077117..fde92b7ced63 100644 --- a/packages/google-cloud-translate/noxfile.py +++ b/packages/google-cloud-translate/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-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py index dc0223622987..3285f47dc5b6 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_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. @@ -57,11 +57,11 @@ async def sample_batch_translate_document(): ) # Make the request - operation = client.batch_translate_document(request=request) + operation = await client.batch_translate_document(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py index ed6c65848bf2..3f10ef09c594 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_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. @@ -57,11 +57,11 @@ async def sample_batch_translate_text(): ) # Make the request - operation = client.batch_translate_text(request=request) + operation = await client.batch_translate_text(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_dataset_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_dataset_async.py index 42ba6ca10c09..7b277e71bf62 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_dataset_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_dataset_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_dataset(): ) # Make the request - operation = client.create_dataset(request=request) + operation = await client.create_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py index 17ed70124836..1f230fc312db 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_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_glossary(): ) # Make the request - operation = client.create_glossary(request=request) + operation = await client.create_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_model_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_model_async.py index da2f52aafb03..77326849bdae 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_create_model_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_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. @@ -44,11 +44,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-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_dataset_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_dataset_async.py index 6a95aae2737d..af8be64eb112 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_dataset_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_dataset_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_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py index 1ebba9e951f8..6501900eb061 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_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_glossary(): ) # Make the request - operation = client.delete_glossary(request=request) + operation = await client.delete_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_model_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_model_async.py index b69af9c68da8..aa1dd99833a9 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_model_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_delete_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_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_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-translate/samples/generated_samples/translate_v3_generated_translation_service_export_data_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_export_data_async.py index 73080d291126..dd8c17cebbfa 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_export_data_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_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-translate/samples/generated_samples/translate_v3_generated_translation_service_import_data_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_import_data_async.py index f817db3593a8..dfa99feb1cf6 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_import_data_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_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. @@ -44,11 +44,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-translate/samples/generated_samples/translate_v3_generated_translation_service_update_glossary_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_update_glossary_async.py index 1ff0e252f9b6..1bcca2f9b6e0 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_update_glossary_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3_generated_translation_service_update_glossary_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_glossary(): ) # Make the request - operation = client.update_glossary(request=request) + operation = await client.update_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py index ceec4f269de1..79375d209e6c 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_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. @@ -57,11 +57,11 @@ async def sample_batch_translate_document(): ) # Make the request - operation = client.batch_translate_document(request=request) + operation = await client.batch_translate_document(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py index f3a8da3573a5..b961e613ceae 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_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. @@ -57,11 +57,11 @@ async def sample_batch_translate_text(): ) # Make the request - operation = client.batch_translate_text(request=request) + operation = await client.batch_translate_text(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py index 22707779681b..e25b98697c98 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_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_glossary(): ) # Make the request - operation = client.create_glossary(request=request) + operation = await client.create_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py index f915e4dc9dcd..32447b246ea0 100644 --- a/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py +++ b/packages/google-cloud-translate/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_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_glossary(): ) # Make the request - operation = client.delete_glossary(request=request) + operation = await client.delete_glossary(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-translate/setup.py b/packages/google-cloud-translate/setup.py index dece2b384e33..9773395cfa8d 100644 --- a/packages/google-cloud-translate/setup.py +++ b/packages/google-cloud-translate/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,12 +39,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-core >= 2.0.0, <3.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'", @@ -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-translate/testing/constraints-3.10.txt b/packages/google-cloud-translate/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-translate/testing/constraints-3.10.txt +++ b/packages/google-cloud-translate/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-translate/testing/constraints-3.9.txt b/packages/google-cloud-translate/testing/constraints-3.9.txt deleted file mode 100644 index daf7d010cd30..000000000000 --- a/packages/google-cloud-translate/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 -google-cloud-core==2.0.0 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-translate/tests/unit/gapic/translate_v3/test_translation_service.py b/packages/google-cloud-translate/tests/unit/gapic/translate_v3/test_translation_service.py index 0f5530ca5d6c..33b59a6e944c 100644 --- a/packages/google-cloud-translate/tests/unit/gapic/translate_v3/test_translation_service.py +++ b/packages/google-cloud-translate/tests/unit/gapic/translate_v3/test_translation_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 @@ -4951,11 +4945,7 @@ async def test_list_glossaries_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_glossaries(request={}) - ).pages: + async for page_ in (await client.list_glossaries(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6503,11 +6493,7 @@ async def test_list_glossary_entries_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_glossary_entries(request={}) - ).pages: + async for page_ in (await client.list_glossary_entries(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8742,11 +8728,7 @@ async def test_list_datasets_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_datasets(request={}) - ).pages: + async for page_ in (await client.list_datasets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10680,11 +10662,7 @@ async def test_list_adaptive_mt_datasets_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_adaptive_mt_datasets(request={}) - ).pages: + async for page_ in (await client.list_adaptive_mt_datasets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12599,11 +12577,7 @@ async def test_list_adaptive_mt_files_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_adaptive_mt_files(request={}) - ).pages: + async for page_ in (await client.list_adaptive_mt_files(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13148,11 +13122,7 @@ async def test_list_adaptive_mt_sentences_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_adaptive_mt_sentences(request={}) - ).pages: + async for page_ in (await client.list_adaptive_mt_sentences(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -14391,11 +14361,7 @@ async def test_list_examples_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_examples(request={}) - ).pages: + async for page_ in (await client.list_examples(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15249,11 +15215,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 @@ -16052,7 +16014,7 @@ def test_translate_text_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_translate_text_rest_unset_required_fields(): @@ -16254,7 +16216,7 @@ def test_romanize_text_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_romanize_text_rest_unset_required_fields(): @@ -16443,7 +16405,7 @@ def test_detect_language_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_detect_language_rest_unset_required_fields(): @@ -16638,7 +16600,7 @@ def test_get_supported_languages_rest_required_fields( expected_params = [("$alt", "json;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_supported_languages_rest_unset_required_fields(): @@ -16839,7 +16801,7 @@ def test_translate_document_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_translate_document_rest_unset_required_fields(): @@ -16982,7 +16944,7 @@ def test_batch_translate_text_rest_required_fields( expected_params = [("$alt", "json;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_translate_text_rest_unset_required_fields(): @@ -17128,7 +17090,7 @@ def test_batch_translate_document_rest_required_fields( expected_params = [("$alt", "json;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_translate_document_rest_unset_required_fields(): @@ -17345,7 +17307,7 @@ def test_create_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -17529,7 +17491,7 @@ def test_update_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -17719,7 +17681,7 @@ def test_list_glossaries_rest_required_fields( expected_params = [("$alt", "json;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_glossaries_rest_unset_required_fields(): @@ -17968,7 +17930,7 @@ def test_get_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -18148,7 +18110,7 @@ def test_delete_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -18329,7 +18291,7 @@ def test_get_glossary_entry_rest_required_fields( expected_params = [("$alt", "json;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_glossary_entry_rest_unset_required_fields(): @@ -18523,7 +18485,7 @@ def test_list_glossary_entries_rest_required_fields( expected_params = [("$alt", "json;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_glossary_entries_rest_unset_required_fields(): @@ -18782,7 +18744,7 @@ def test_create_glossary_entry_rest_required_fields( expected_params = [("$alt", "json;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_glossary_entry_rest_unset_required_fields(): @@ -18973,7 +18935,7 @@ def test_update_glossary_entry_rest_required_fields( expected_params = [("$alt", "json;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_glossary_entry_rest_unset_required_fields(): @@ -19157,7 +19119,7 @@ def test_delete_glossary_entry_rest_required_fields( expected_params = [("$alt", "json;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_glossary_entry_rest_unset_required_fields(): @@ -19337,7 +19299,7 @@ def test_create_dataset_rest_required_fields( expected_params = [("$alt", "json;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_dataset_rest_unset_required_fields(): @@ -19522,7 +19484,7 @@ def test_get_dataset_rest_required_fields( expected_params = [("$alt", "json;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_dataset_rest_unset_required_fields(): @@ -19706,7 +19668,7 @@ def test_list_datasets_rest_required_fields( expected_params = [("$alt", "json;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_datasets_rest_unset_required_fields(): @@ -19955,7 +19917,7 @@ def test_delete_dataset_rest_required_fields( expected_params = [("$alt", "json;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_dataset_rest_unset_required_fields(): @@ -20136,7 +20098,7 @@ def test_create_adaptive_mt_dataset_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_dataset_rest_unset_required_fields(): @@ -20326,7 +20288,7 @@ def test_delete_adaptive_mt_dataset_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_dataset_rest_unset_required_fields(): @@ -20509,7 +20471,7 @@ def test_get_adaptive_mt_dataset_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_dataset_rest_unset_required_fields(): @@ -20702,7 +20664,7 @@ def test_list_adaptive_mt_datasets_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_datasets_rest_unset_required_fields(): @@ -20966,7 +20928,7 @@ def test_adaptive_mt_translate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_adaptive_mt_translate_rest_unset_required_fields(): @@ -21159,7 +21121,7 @@ def test_get_adaptive_mt_file_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_file_rest_unset_required_fields(): @@ -21341,7 +21303,7 @@ def test_delete_adaptive_mt_file_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_file_rest_unset_required_fields(): @@ -21525,7 +21487,7 @@ def test_import_adaptive_mt_file_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_file_rest_unset_required_fields(): @@ -21717,7 +21679,7 @@ def test_list_adaptive_mt_files_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_files_rest_unset_required_fields(): @@ -21982,7 +21944,7 @@ def test_list_adaptive_mt_sentences_rest_required_fields( expected_params = [("$alt", "json;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_adaptive_mt_sentences_rest_unset_required_fields(): @@ -22237,7 +22199,7 @@ def test_import_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_data_rest_unset_required_fields(): @@ -22435,7 +22397,7 @@ def test_export_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_export_data_rest_unset_required_fields(): @@ -22639,7 +22601,7 @@ def test_list_examples_rest_required_fields( expected_params = [("$alt", "json;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_examples_rest_unset_required_fields(): @@ -22895,7 +22857,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(): @@ -23088,7 +23050,7 @@ def test_list_models_rest_required_fields( expected_params = [("$alt", "json;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(): @@ -23337,7 +23299,7 @@ def test_get_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_get_model_rest_unset_required_fields(): @@ -23515,7 +23477,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(): diff --git a/packages/google-cloud-translate/tests/unit/gapic/translate_v3beta1/test_translation_service.py b/packages/google-cloud-translate/tests/unit/gapic/translate_v3beta1/test_translation_service.py index 16da7d2f1bda..ff5a74de3142 100644 --- a/packages/google-cloud-translate/tests/unit/gapic/translate_v3beta1/test_translation_service.py +++ b/packages/google-cloud-translate/tests/unit/gapic/translate_v3beta1/test_translation_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 @@ -4152,11 +4146,7 @@ async def test_list_glossaries_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_glossaries(request={}) - ).pages: + async for page_ in (await client.list_glossaries(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5179,7 +5169,7 @@ def test_translate_text_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_translate_text_rest_unset_required_fields(): @@ -5309,7 +5299,7 @@ def test_detect_language_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_detect_language_rest_unset_required_fields(): @@ -5503,7 +5493,7 @@ def test_get_supported_languages_rest_required_fields( expected_params = [("$alt", "json;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_supported_languages_rest_unset_required_fields(): @@ -5704,7 +5694,7 @@ def test_translate_document_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_translate_document_rest_unset_required_fields(): @@ -5847,7 +5837,7 @@ def test_batch_translate_text_rest_required_fields( expected_params = [("$alt", "json;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_translate_text_rest_unset_required_fields(): @@ -5993,7 +5983,7 @@ def test_batch_translate_document_rest_required_fields( expected_params = [("$alt", "json;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_translate_document_rest_unset_required_fields(): @@ -6210,7 +6200,7 @@ def test_create_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -6404,7 +6394,7 @@ def test_list_glossaries_rest_required_fields( expected_params = [("$alt", "json;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_glossaries_rest_unset_required_fields(): @@ -6656,7 +6646,7 @@ def test_get_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -6837,7 +6827,7 @@ def test_delete_glossary_rest_required_fields( expected_params = [("$alt", "json;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_glossary_rest_unset_required_fields(): @@ -7024,7 +7014,7 @@ def test_refine_text_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_refine_text_rest_unset_required_fields(): diff --git a/packages/google-cloud-vectorsearch/docs/conf.py b/packages/google-cloud-vectorsearch/docs/conf.py index df099a329cb5..edd989644ed1 100644 --- a/packages/google-cloud-vectorsearch/docs/conf.py +++ b/packages/google-cloud-vectorsearch/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-vectorsearch" -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-vectorsearch/google/cloud/vectorsearch_v1/__init__.py b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1/__init__.py index 0832eaa9b4b9..5e1efa6bdf92 100644 --- a/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1/__init__.py +++ b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_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.data_object_search_service import ( DataObjectSearchServiceAsyncClient, @@ -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.vectorsearch_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-vectorsearch/google/cloud/vectorsearch_v1/services/vector_search_service/async_client.py b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1/services/vector_search_service/async_client.py index 266b9367e237..3a14ce31ebbd 100644 --- a/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1/services/vector_search_service/async_client.py +++ b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1/services/vector_search_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. @@ -600,11 +600,11 @@ async def sample_create_collection(): ) # Make the request - operation = client.create_collection(request=request) + operation = await client.create_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -745,11 +745,11 @@ async def sample_update_collection(): ) # Make the request - operation = client.update_collection(request=request) + operation = await client.update_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -900,11 +900,11 @@ async def sample_delete_collection(): ) # Make the request - operation = client.delete_collection(request=request) + operation = await client.delete_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1269,11 +1269,11 @@ async def sample_create_index(): ) # Make the request - operation = client.create_index(request=request) + operation = await client.create_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1419,11 +1419,11 @@ async def sample_update_index(): ) # Make the request - operation = client.update_index(request=request) + operation = await client.update_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1569,11 +1569,11 @@ async def sample_delete_index(): ) # Make the request - operation = client.delete_index(request=request) + operation = await client.delete_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1709,11 +1709,11 @@ async def sample_import_data_objects(): ) # Make the request - operation = client.import_data_objects(request=request) + operation = await client.import_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1817,11 +1817,11 @@ async def sample_export_data_objects(): ) # Make the request - operation = client.export_data_objects(request=request) + operation = await client.export_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1beta/__init__.py b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1beta/__init__.py index 53db5a30cd44..7ccbf95e312d 100644 --- a/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1beta/__init__.py +++ b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_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.data_object_search_service import ( DataObjectSearchServiceAsyncClient, @@ -116,28 +110,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.vectorsearch_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-vectorsearch/google/cloud/vectorsearch_v1beta/services/vector_search_service/async_client.py b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1beta/services/vector_search_service/async_client.py index 1b20347191a0..b1b26da22b52 100644 --- a/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1beta/services/vector_search_service/async_client.py +++ b/packages/google-cloud-vectorsearch/google/cloud/vectorsearch_v1beta/services/vector_search_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. @@ -600,11 +600,11 @@ async def sample_create_collection(): ) # Make the request - operation = client.create_collection(request=request) + operation = await client.create_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -745,11 +745,11 @@ async def sample_update_collection(): ) # Make the request - operation = client.update_collection(request=request) + operation = await client.update_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -900,11 +900,11 @@ async def sample_delete_collection(): ) # Make the request - operation = client.delete_collection(request=request) + operation = await client.delete_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1269,11 +1269,11 @@ async def sample_create_index(): ) # Make the request - operation = client.create_index(request=request) + operation = await client.create_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1419,11 +1419,11 @@ async def sample_update_index(): ) # Make the request - operation = client.update_index(request=request) + operation = await client.update_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1569,11 +1569,11 @@ async def sample_delete_index(): ) # Make the request - operation = client.delete_index(request=request) + operation = await client.delete_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1709,11 +1709,11 @@ async def sample_import_data_objects(): ) # Make the request - operation = client.import_data_objects(request=request) + operation = await client.import_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1817,11 +1817,11 @@ async def sample_export_data_objects(): ) # Make the request - operation = client.export_data_objects(request=request) + operation = await client.export_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/noxfile.py b/packages/google-cloud-vectorsearch/noxfile.py index 034c9865c4bc..93059e1eb81b 100644 --- a/packages/google-cloud-vectorsearch/noxfile.py +++ b/packages/google-cloud-vectorsearch/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-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_collection_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_collection_async.py index 17218c573616..9ec6fc4048fd 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_collection_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_collection_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_collection(): ) # Make the request - operation = client.create_collection(request=request) + operation = await client.create_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_index_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_index_async.py index d65eb930568b..718ad1ab2dcc 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_index_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_create_index_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_index(): ) # Make the request - operation = client.create_index(request=request) + operation = await client.create_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_collection_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_collection_async.py index f936dca6dba1..3bb52aa53814 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_collection_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_collection_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_collection(): ) # Make the request - operation = client.delete_collection(request=request) + operation = await client.delete_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_index_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_index_async.py index c5dc3faf3d9d..b1f0af7901c3 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_index_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_delete_index_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_index(): ) # Make the request - operation = client.delete_index(request=request) + operation = await client.delete_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_export_data_objects_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_export_data_objects_async.py index 13e1456c3746..9ef36539df82 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_export_data_objects_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_export_data_objects_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_export_data_objects(): ) # Make the request - operation = client.export_data_objects(request=request) + operation = await client.export_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_import_data_objects_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_import_data_objects_async.py index 80bca128b139..dc4c83dc0076 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_import_data_objects_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_import_data_objects_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_data_objects(): ) # Make the request - operation = client.import_data_objects(request=request) + operation = await client.import_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_collection_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_collection_async.py index 1cd91302369d..90d619feb8b3 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_collection_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_collection_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_collection(): request = vectorsearch_v1.UpdateCollectionRequest() # Make the request - operation = client.update_collection(request=request) + operation = await client.update_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_index_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_index_async.py index e3c1890f2029..52ba91d9ebf0 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_index_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1_generated_vector_search_service_update_index_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_index(): ) # Make the request - operation = client.update_index(request=request) + operation = await client.update_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_collection_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_collection_async.py index 669ec926cf81..86789eed6784 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_collection_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_collection_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_collection(): ) # Make the request - operation = client.create_collection(request=request) + operation = await client.create_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_index_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_index_async.py index c5de967a2741..a8a0fca0dfea 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_index_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_create_index_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_index(): ) # Make the request - operation = client.create_index(request=request) + operation = await client.create_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_collection_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_collection_async.py index 03746158b497..6c342676c386 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_collection_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_collection_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_collection(): ) # Make the request - operation = client.delete_collection(request=request) + operation = await client.delete_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_index_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_index_async.py index b7c8c6be288f..d4b152bc23e5 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_index_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_delete_index_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_index(): ) # Make the request - operation = client.delete_index(request=request) + operation = await client.delete_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_export_data_objects_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_export_data_objects_async.py index 2ff5aa3ea030..4aa21fe8478c 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_export_data_objects_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_export_data_objects_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_export_data_objects(): ) # Make the request - operation = client.export_data_objects(request=request) + operation = await client.export_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_import_data_objects_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_import_data_objects_async.py index 4f37adeed5a7..3420a9ac1514 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_import_data_objects_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_import_data_objects_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_data_objects(): ) # Make the request - operation = client.import_data_objects(request=request) + operation = await client.import_data_objects(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_collection_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_collection_async.py index a73cdf53b6fc..32c36f5ae3db 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_collection_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_collection_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_collection(): request = vectorsearch_v1beta.UpdateCollectionRequest() # Make the request - operation = client.update_collection(request=request) + operation = await client.update_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_index_async.py b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_index_async.py index 5cc98c6cfcfd..57a9bd6e45fa 100644 --- a/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_index_async.py +++ b/packages/google-cloud-vectorsearch/samples/generated_samples/vectorsearch_v1beta_generated_vector_search_service_update_index_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_index(): ) # Make the request - operation = client.update_index(request=request) + operation = await client.update_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vectorsearch/setup.py b/packages/google-cloud-vectorsearch/setup.py index baab279f4475..e5a17d807792 100644 --- a/packages/google-cloud-vectorsearch/setup.py +++ b/packages/google-cloud-vectorsearch/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-vectorsearch/testing/constraints-3.10.txt b/packages/google-cloud-vectorsearch/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-vectorsearch/testing/constraints-3.10.txt +++ b/packages/google-cloud-vectorsearch/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-vectorsearch/testing/constraints-3.9.txt b/packages/google-cloud-vectorsearch/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-vectorsearch/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-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_search_service.py b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_search_service.py index 94bc625461dd..b0e18642a089 100644 --- a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_search_service.py +++ b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_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 @@ -1841,11 +1835,7 @@ async def test_search_data_objects_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_data_objects(request={}) - ).pages: + async for page_ in (await client.search_data_objects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2301,11 +2291,7 @@ async def test_query_data_objects_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.query_data_objects(request={}) - ).pages: + async for page_ in (await client.query_data_objects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2932,7 +2918,7 @@ def test_search_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_data_objects_rest_unset_required_fields(): @@ -3127,7 +3113,7 @@ def test_query_data_objects_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_query_data_objects_rest_unset_required_fields(): @@ -3321,7 +3307,7 @@ def test_aggregate_data_objects_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_aggregate_data_objects_rest_unset_required_fields(): @@ -3457,7 +3443,7 @@ def test_batch_search_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_search_data_objects_rest_unset_required_fields(): diff --git a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_service.py b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_service.py index ef641bf56037..6632e6bcf276 100644 --- a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_service.py +++ b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_data_object_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 @@ -3839,7 +3833,7 @@ def test_create_data_object_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_data_object_rest_unset_required_fields(): @@ -4040,7 +4034,7 @@ def test_batch_create_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_create_data_objects_rest_unset_required_fields(): @@ -4168,7 +4162,7 @@ def test_get_data_object_rest_required_fields( expected_params = [("$alt", "json;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_data_object_rest_unset_required_fields(): @@ -4350,7 +4344,7 @@ def test_update_data_object_rest_required_fields( expected_params = [("$alt", "json;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_data_object_rest_unset_required_fields(): @@ -4542,7 +4536,7 @@ def test_batch_update_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_data_objects_rest_unset_required_fields(): @@ -4745,7 +4739,7 @@ def test_delete_data_object_rest_required_fields( expected_params = [("$alt", "json;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_data_object_rest_unset_required_fields(): @@ -4926,7 +4920,7 @@ def test_batch_delete_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_delete_data_objects_rest_unset_required_fields(): diff --git a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_vector_search_service.py b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_vector_search_service.py index ffd5e2b09c86..b7a594b00a50 100644 --- a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_vector_search_service.py +++ b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1/test_vector_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 @@ -1908,11 +1902,7 @@ async def test_list_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_collections(request={}) - ).pages: + async for page_ in (await client.list_collections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3824,11 +3814,7 @@ async def test_list_indexes_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_indexes(request={}) - ).pages: + async for page_ in (await client.list_indexes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5878,7 +5864,7 @@ def test_list_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_collections_rest_unset_required_fields(): @@ -6129,7 +6115,7 @@ def test_get_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_collection_rest_unset_required_fields(): @@ -6333,7 +6319,7 @@ def test_create_collection_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_collection_rest_unset_required_fields(): @@ -6533,7 +6519,7 @@ def test_update_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_update_collection_rest_unset_required_fields(): @@ -6728,7 +6714,7 @@ def test_delete_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_delete_collection_rest_unset_required_fields(): @@ -6915,7 +6901,7 @@ def test_list_indexes_rest_required_fields( expected_params = [("$alt", "json;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_indexes_rest_unset_required_fields(): @@ -7170,7 +7156,7 @@ def test_get_index_rest_required_fields( expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -7372,7 +7358,7 @@ def test_create_index_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_index_rest_unset_required_fields(): @@ -7580,7 +7566,7 @@ def test_update_index_rest_required_fields( expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -7781,7 +7767,7 @@ def test_delete_index_rest_required_fields( expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -7965,7 +7951,7 @@ def test_import_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_objects_rest_unset_required_fields(): @@ -8091,7 +8077,7 @@ def test_export_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_objects_rest_unset_required_fields(): diff --git a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_search_service.py b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_search_service.py index 03237e238aa1..e037dfbbfd3c 100644 --- a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_search_service.py +++ b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_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 @@ -1841,11 +1835,7 @@ async def test_search_data_objects_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_data_objects(request={}) - ).pages: + async for page_ in (await client.search_data_objects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2301,11 +2291,7 @@ async def test_query_data_objects_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.query_data_objects(request={}) - ).pages: + async for page_ in (await client.query_data_objects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2932,7 +2918,7 @@ def test_search_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_data_objects_rest_unset_required_fields(): @@ -3127,7 +3113,7 @@ def test_query_data_objects_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_query_data_objects_rest_unset_required_fields(): @@ -3321,7 +3307,7 @@ def test_aggregate_data_objects_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_aggregate_data_objects_rest_unset_required_fields(): @@ -3457,7 +3443,7 @@ def test_batch_search_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_search_data_objects_rest_unset_required_fields(): diff --git a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_service.py b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_service.py index 05de52606c94..855570bf5f29 100644 --- a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_service.py +++ b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_data_object_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 @@ -3839,7 +3833,7 @@ def test_create_data_object_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_data_object_rest_unset_required_fields(): @@ -4040,7 +4034,7 @@ def test_batch_create_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_create_data_objects_rest_unset_required_fields(): @@ -4168,7 +4162,7 @@ def test_get_data_object_rest_required_fields( expected_params = [("$alt", "json;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_data_object_rest_unset_required_fields(): @@ -4350,7 +4344,7 @@ def test_update_data_object_rest_required_fields( expected_params = [("$alt", "json;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_data_object_rest_unset_required_fields(): @@ -4542,7 +4536,7 @@ def test_batch_update_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_data_objects_rest_unset_required_fields(): @@ -4745,7 +4739,7 @@ def test_delete_data_object_rest_required_fields( expected_params = [("$alt", "json;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_data_object_rest_unset_required_fields(): @@ -4926,7 +4920,7 @@ def test_batch_delete_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_delete_data_objects_rest_unset_required_fields(): diff --git a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_vector_search_service.py b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_vector_search_service.py index 49abfa3d0cf4..5b430a0974be 100644 --- a/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_vector_search_service.py +++ b/packages/google-cloud-vectorsearch/tests/unit/gapic/vectorsearch_v1beta/test_vector_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 @@ -1908,11 +1902,7 @@ async def test_list_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_collections(request={}) - ).pages: + async for page_ in (await client.list_collections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3824,11 +3814,7 @@ async def test_list_indexes_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_indexes(request={}) - ).pages: + async for page_ in (await client.list_indexes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5878,7 +5864,7 @@ def test_list_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_collections_rest_unset_required_fields(): @@ -6129,7 +6115,7 @@ def test_get_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_collection_rest_unset_required_fields(): @@ -6333,7 +6319,7 @@ def test_create_collection_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_collection_rest_unset_required_fields(): @@ -6533,7 +6519,7 @@ def test_update_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_update_collection_rest_unset_required_fields(): @@ -6728,7 +6714,7 @@ def test_delete_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_delete_collection_rest_unset_required_fields(): @@ -6915,7 +6901,7 @@ def test_list_indexes_rest_required_fields( expected_params = [("$alt", "json;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_indexes_rest_unset_required_fields(): @@ -7170,7 +7156,7 @@ def test_get_index_rest_required_fields( expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -7372,7 +7358,7 @@ def test_create_index_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_index_rest_unset_required_fields(): @@ -7580,7 +7566,7 @@ def test_update_index_rest_required_fields( expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -7781,7 +7767,7 @@ def test_delete_index_rest_required_fields( expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -7965,7 +7951,7 @@ def test_import_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_objects_rest_unset_required_fields(): @@ -8091,7 +8077,7 @@ def test_export_data_objects_rest_required_fields( expected_params = [("$alt", "json;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_objects_rest_unset_required_fields(): diff --git a/packages/google-cloud-video-live-stream/docs/conf.py b/packages/google-cloud-video-live-stream/docs/conf.py index f713d82112ec..34b3008d8565 100644 --- a/packages/google-cloud-video-live-stream/docs/conf.py +++ b/packages/google-cloud-video-live-stream/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-video-live-stream" -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-video-live-stream/google/cloud/video/live_stream_v1/__init__.py b/packages/google-cloud-video-live-stream/google/cloud/video/live_stream_v1/__init__.py index 6d91427fe0be..2f13f62540b1 100644 --- a/packages/google-cloud-video-live-stream/google/cloud/video/live_stream_v1/__init__.py +++ b/packages/google-cloud-video-live-stream/google/cloud/video/live_stream_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.livestream_service import ( LivestreamServiceAsyncClient, @@ -129,28 +123,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.video.live_stream_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-video-live-stream/google/cloud/video/live_stream_v1/services/livestream_service/async_client.py b/packages/google-cloud-video-live-stream/google/cloud/video/live_stream_v1/services/livestream_service/async_client.py index 9b4ced1d718f..e48ca645be3b 100644 --- a/packages/google-cloud-video-live-stream/google/cloud/video/live_stream_v1/services/livestream_service/async_client.py +++ b/packages/google-cloud-video-live-stream/google/cloud/video/live_stream_v1/services/livestream_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. @@ -368,11 +368,11 @@ async def sample_create_channel(): ) # Make the request - operation = client.create_channel(request=request) + operation = await client.create_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -765,11 +765,11 @@ async def sample_delete_channel(): ) # Make the request - operation = client.delete_channel(request=request) + operation = await client.delete_channel(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_channel(): ) # Make the request - operation = client.update_channel(request=request) + operation = await client.update_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1062,11 +1062,11 @@ async def sample_start_channel(): ) # Make the request - operation = client.start_channel(request=request) + operation = await client.start_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1192,11 +1192,11 @@ async def sample_stop_channel(): ) # Make the request - operation = client.stop_channel(request=request) + operation = await client.stop_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1322,11 +1322,11 @@ async def sample_start_distribution(): ) # Make the request - operation = client.start_distribution(request=request) + operation = await client.start_distribution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1463,11 +1463,11 @@ async def sample_stop_distribution(): ) # Make the request - operation = client.stop_distribution(request=request) + operation = await client.stop_distribution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1607,11 +1607,11 @@ async def sample_create_input(): ) # Make the request - operation = client.create_input(request=request) + operation = await client.create_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1994,11 +1994,11 @@ async def sample_delete_input(): ) # Make the request - operation = client.delete_input(request=request) + operation = await client.delete_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2128,11 +2128,11 @@ async def sample_update_input(): ) # Make the request - operation = client.update_input(request=request) + operation = await client.update_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3119,11 +3119,11 @@ async def sample_create_clip(): ) # Make the request - operation = client.create_clip(request=request) + operation = await client.create_clip(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3269,11 +3269,11 @@ async def sample_delete_clip(): ) # Make the request - operation = client.delete_clip(request=request) + operation = await client.delete_clip(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3410,11 +3410,11 @@ async def sample_create_dvr_session(): ) # Make the request - operation = client.create_dvr_session(request=request) + operation = await client.create_dvr_session(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3799,11 +3799,11 @@ async def sample_delete_dvr_session(): ) # Make the request - operation = client.delete_dvr_session(request=request) + operation = await client.delete_dvr_session(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3937,11 +3937,11 @@ async def sample_update_dvr_session(): ) # Make the request - operation = client.update_dvr_session(request=request) + operation = await client.update_dvr_session(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4085,11 +4085,11 @@ async def sample_create_asset(): ) # Make the request - operation = client.create_asset(request=request) + operation = await client.create_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4234,11 +4234,11 @@ async def sample_delete_asset(): ) # Make the request - operation = client.delete_asset(request=request) + operation = await client.delete_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4720,11 +4720,11 @@ async def sample_update_pool(): ) # Make the request - operation = client.update_pool(request=request) + operation = await client.update_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-video-live-stream/noxfile.py b/packages/google-cloud-video-live-stream/noxfile.py index e0e6b278aa58..08b8e3738be7 100644 --- a/packages/google-cloud-video-live-stream/noxfile.py +++ b/packages/google-cloud-video-live-stream/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-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_asset_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_asset_async.py index 7263ee0fdc27..1331e254aee4 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_asset_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_asset_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_asset(): ) # Make the request - operation = client.create_asset(request=request) + operation = await client.create_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_channel_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_channel_async.py index bfba79b4ff3d..e6cc2cb3c952 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_channel_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_channel_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_channel(): ) # Make the request - operation = client.create_channel(request=request) + operation = await client.create_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_clip_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_clip_async.py index 3252ac71f820..ba6b8d1149c4 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_clip_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_clip_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_clip(): ) # Make the request - operation = client.create_clip(request=request) + operation = await client.create_clip(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_dvr_session_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_dvr_session_async.py index 5d4f0dd89f47..8a0c1d6a5c8d 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_dvr_session_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_dvr_session_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_dvr_session(): ) # Make the request - operation = client.create_dvr_session(request=request) + operation = await client.create_dvr_session(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_input_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_input_async.py index 31dcf3b1322b..88f2b3234267 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_input_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_create_input_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_input(): ) # Make the request - operation = client.create_input(request=request) + operation = await client.create_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_asset_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_asset_async.py index 2b363fbe789b..a34591df8380 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_asset_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_asset_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_asset(): ) # Make the request - operation = client.delete_asset(request=request) + operation = await client.delete_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_channel_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_channel_async.py index 645d3b616999..06c0416daafe 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_channel_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_channel_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_channel(): ) # Make the request - operation = client.delete_channel(request=request) + operation = await client.delete_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_clip_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_clip_async.py index 4ebfb37cff20..2834b8f44cb0 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_clip_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_clip_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_clip(): ) # Make the request - operation = client.delete_clip(request=request) + operation = await client.delete_clip(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_dvr_session_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_dvr_session_async.py index 8dbc91f051ce..d6e7a904b3a4 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_dvr_session_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_dvr_session_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_dvr_session(): ) # Make the request - operation = client.delete_dvr_session(request=request) + operation = await client.delete_dvr_session(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_input_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_input_async.py index b47b81f3bde2..37acc9f1ac31 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_input_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_delete_input_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_input(): ) # Make the request - operation = client.delete_input(request=request) + operation = await client.delete_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_channel_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_channel_async.py index aca30174c8af..361721f76d4f 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_channel_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_channel_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_channel(): ) # Make the request - operation = client.start_channel(request=request) + operation = await client.start_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_distribution_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_distribution_async.py index 3673cf1900c4..bfecdebae552 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_distribution_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_start_distribution_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_distribution(): ) # Make the request - operation = client.start_distribution(request=request) + operation = await client.start_distribution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_channel_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_channel_async.py index 388af357edd0..78bc7a2117ec 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_channel_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_channel_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_channel(): ) # Make the request - operation = client.stop_channel(request=request) + operation = await client.stop_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_distribution_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_distribution_async.py index d70ce6b85ec9..f2101c62bc0e 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_distribution_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_stop_distribution_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_distribution(): ) # Make the request - operation = client.stop_distribution(request=request) + operation = await client.stop_distribution(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_channel_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_channel_async.py index d50af903df02..2c322d3146df 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_channel_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_channel_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_channel(): request = live_stream_v1.UpdateChannelRequest() # Make the request - operation = client.update_channel(request=request) + operation = await client.update_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_dvr_session_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_dvr_session_async.py index d54ad0a18c49..f4a802309ee1 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_dvr_session_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_dvr_session_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_dvr_session(): ) # Make the request - operation = client.update_dvr_session(request=request) + operation = await client.update_dvr_session(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_input_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_input_async.py index f050b403e881..031e32f31a6b 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_input_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_input_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_input(): request = live_stream_v1.UpdateInputRequest() # Make the request - operation = client.update_input(request=request) + operation = await client.update_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_pool_async.py b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_pool_async.py index ba6694ba00f3..40333ed1634c 100644 --- a/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_pool_async.py +++ b/packages/google-cloud-video-live-stream/samples/generated_samples/livestream_v1_generated_livestream_service_update_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_pool(): request = live_stream_v1.UpdatePoolRequest() # Make the request - operation = client.update_pool(request=request) + operation = await client.update_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-video-live-stream/setup.py b/packages/google-cloud-video-live-stream/setup.py index 563cdf45c8d9..85dee24f1d0a 100644 --- a/packages/google-cloud-video-live-stream/setup.py +++ b/packages/google-cloud-video-live-stream/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-video-live-stream/testing/constraints-3.10.txt b/packages/google-cloud-video-live-stream/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-video-live-stream/testing/constraints-3.10.txt +++ b/packages/google-cloud-video-live-stream/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-video-live-stream/testing/constraints-3.9.txt b/packages/google-cloud-video-live-stream/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-video-live-stream/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-video-live-stream/tests/unit/gapic/live_stream_v1/test_livestream_service.py b/packages/google-cloud-video-live-stream/tests/unit/gapic/live_stream_v1/test_livestream_service.py index 8f6168bb022c..47f2c70d5a8c 100644 --- a/packages/google-cloud-video-live-stream/tests/unit/gapic/live_stream_v1/test_livestream_service.py +++ b/packages/google-cloud-video-live-stream/tests/unit/gapic/live_stream_v1/test_livestream_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 @@ -2232,11 +2226,7 @@ async def test_list_channels_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_channels(request={}) - ).pages: + async for page_ in (await client.list_channels(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5469,11 +5459,7 @@ async def test_list_inputs_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_inputs(request={}) - ).pages: + async for page_ in (await client.list_inputs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7669,11 +7655,7 @@ async def test_list_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_events(request={}) - ).pages: + async for page_ in (await client.list_events(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8832,11 +8814,7 @@ async def test_list_clips_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_clips(request={}) - ).pages: + async for page_ in (await client.list_clips(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10757,11 +10735,7 @@ async def test_list_dvr_sessions_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_dvr_sessions(request={}) - ).pages: + async for page_ in (await client.list_dvr_sessions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13312,11 +13286,7 @@ async def test_list_assets_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_assets(request={}) - ).pages: + async for page_ in (await client.list_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -14104,7 +14074,7 @@ def test_create_channel_rest_required_fields(request_type=service.CreateChannelR ("$alt", "json;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_channel_rest_unset_required_fields(): @@ -14304,7 +14274,7 @@ def test_list_channels_rest_required_fields(request_type=service.ListChannelsReq expected_params = [("$alt", "json;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_channels_rest_unset_required_fields(): @@ -14550,7 +14520,7 @@ def test_get_channel_rest_required_fields(request_type=service.GetChannelRequest expected_params = [("$alt", "json;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_channel_rest_unset_required_fields(): @@ -14733,7 +14703,7 @@ def test_delete_channel_rest_required_fields(request_type=service.DeleteChannelR expected_params = [("$alt", "json;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_channel_rest_unset_required_fields(): @@ -14918,7 +14888,7 @@ def test_update_channel_rest_required_fields(request_type=service.UpdateChannelR expected_params = [("$alt", "json;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_channel_rest_unset_required_fields(): @@ -15106,7 +15076,7 @@ def test_start_channel_rest_required_fields(request_type=service.StartChannelReq expected_params = [("$alt", "json;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_channel_rest_unset_required_fields(): @@ -15282,7 +15252,7 @@ def test_stop_channel_rest_required_fields(request_type=service.StopChannelReque expected_params = [("$alt", "json;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_channel_rest_unset_required_fields(): @@ -15464,7 +15434,7 @@ def test_start_distribution_rest_required_fields( expected_params = [("$alt", "json;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_distribution_rest_unset_required_fields(): @@ -15646,7 +15616,7 @@ def test_stop_distribution_rest_required_fields( expected_params = [("$alt", "json;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_distribution_rest_unset_required_fields(): @@ -15844,7 +15814,7 @@ def test_create_input_rest_required_fields(request_type=service.CreateInputReque ("$alt", "json;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_input_rest_unset_required_fields(): @@ -16044,7 +16014,7 @@ def test_list_inputs_rest_required_fields(request_type=service.ListInputsRequest expected_params = [("$alt", "json;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_inputs_rest_unset_required_fields(): @@ -16290,7 +16260,7 @@ def test_get_input_rest_required_fields(request_type=service.GetInputRequest): expected_params = [("$alt", "json;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_input_rest_unset_required_fields(): @@ -16468,7 +16438,7 @@ def test_delete_input_rest_required_fields(request_type=service.DeleteInputReque expected_params = [("$alt", "json;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_input_rest_unset_required_fields(): @@ -16645,7 +16615,7 @@ def test_update_input_rest_required_fields(request_type=service.UpdateInputReque expected_params = [("$alt", "json;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_input_rest_unset_required_fields(): @@ -16832,7 +16802,7 @@ def test_preview_input_rest_required_fields(request_type=service.PreviewInputReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_preview_input_rest_unset_required_fields(): @@ -17029,7 +16999,7 @@ def test_create_event_rest_required_fields(request_type=service.CreateEventReque ("$alt", "json;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_event_rest_unset_required_fields(): @@ -17234,7 +17204,7 @@ def test_list_events_rest_required_fields(request_type=service.ListEventsRequest expected_params = [("$alt", "json;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_events_rest_unset_required_fields(): @@ -17485,7 +17455,7 @@ def test_get_event_rest_required_fields(request_type=service.GetEventRequest): expected_params = [("$alt", "json;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_event_rest_unset_required_fields(): @@ -17662,7 +17632,7 @@ def test_delete_event_rest_required_fields(request_type=service.DeleteEventReque expected_params = [("$alt", "json;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_event_rest_unset_required_fields(): @@ -17847,7 +17817,7 @@ def test_list_clips_rest_required_fields(request_type=service.ListClipsRequest): expected_params = [("$alt", "json;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_clips_rest_unset_required_fields(): @@ -18098,7 +18068,7 @@ def test_get_clip_rest_required_fields(request_type=service.GetClipRequest): expected_params = [("$alt", "json;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_clip_rest_unset_required_fields(): @@ -18298,7 +18268,7 @@ def test_create_clip_rest_required_fields(request_type=service.CreateClipRequest ("$alt", "json;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_clip_rest_unset_required_fields(): @@ -18495,7 +18465,7 @@ def test_delete_clip_rest_required_fields(request_type=service.DeleteClipRequest expected_params = [("$alt", "json;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_clip_rest_unset_required_fields(): @@ -18699,7 +18669,7 @@ def test_create_dvr_session_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_dvr_session_rest_unset_required_fields(): @@ -18906,7 +18876,7 @@ def test_list_dvr_sessions_rest_required_fields( expected_params = [("$alt", "json;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_dvr_sessions_rest_unset_required_fields(): @@ -19159,7 +19129,7 @@ def test_get_dvr_session_rest_required_fields( expected_params = [("$alt", "json;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_dvr_session_rest_unset_required_fields(): @@ -19346,7 +19316,7 @@ def test_delete_dvr_session_rest_required_fields( expected_params = [("$alt", "json;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_dvr_session_rest_unset_required_fields(): @@ -19532,7 +19502,7 @@ def test_update_dvr_session_rest_required_fields( expected_params = [("$alt", "json;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_dvr_session_rest_unset_required_fields(): @@ -19747,7 +19717,7 @@ def test_create_asset_rest_required_fields(request_type=service.CreateAssetReque ("$alt", "json;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_asset_rest_unset_required_fields(): @@ -19941,7 +19911,7 @@ def test_delete_asset_rest_required_fields(request_type=service.DeleteAssetReque expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -20114,7 +20084,7 @@ def test_get_asset_rest_required_fields(request_type=service.GetAssetRequest): expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -20298,7 +20268,7 @@ def test_list_assets_rest_required_fields(request_type=service.ListAssetsRequest expected_params = [("$alt", "json;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_assets_rest_unset_required_fields(): @@ -20544,7 +20514,7 @@ def test_get_pool_rest_required_fields(request_type=service.GetPoolRequest): expected_params = [("$alt", "json;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_pool_rest_unset_required_fields(): @@ -20723,7 +20693,7 @@ def test_update_pool_rest_required_fields(request_type=service.UpdatePoolRequest expected_params = [("$alt", "json;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_pool_rest_unset_required_fields(): diff --git a/packages/google-cloud-video-stitcher/docs/conf.py b/packages/google-cloud-video-stitcher/docs/conf.py index 22027e543ba7..3eedac1d6da9 100644 --- a/packages/google-cloud-video-stitcher/docs/conf.py +++ b/packages/google-cloud-video-stitcher/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-video-stitcher" -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-video-stitcher/google/cloud/video/stitcher_v1/__init__.py b/packages/google-cloud-video-stitcher/google/cloud/video/stitcher_v1/__init__.py index 36ff18f2800f..9a643521e403 100644 --- a/packages/google-cloud-video-stitcher/google/cloud/video/stitcher_v1/__init__.py +++ b/packages/google-cloud-video-stitcher/google/cloud/video/stitcher_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.video_stitcher_service import ( VideoStitcherServiceAsyncClient, @@ -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.video.stitcher_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-video-stitcher/google/cloud/video/stitcher_v1/services/video_stitcher_service/async_client.py b/packages/google-cloud-video-stitcher/google/cloud/video/stitcher_v1/services/video_stitcher_service/async_client.py index 4e22a61da1ef..142d2f91adf9 100644 --- a/packages/google-cloud-video-stitcher/google/cloud/video/stitcher_v1/services/video_stitcher_service/async_client.py +++ b/packages/google-cloud-video-stitcher/google/cloud/video/stitcher_v1/services/video_stitcher_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. @@ -393,11 +393,11 @@ async def sample_create_cdn_key(): ) # Make the request - operation = client.create_cdn_key(request=request) + operation = await client.create_cdn_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -792,11 +792,11 @@ async def sample_delete_cdn_key(): ) # Make the request - operation = client.delete_cdn_key(request=request) + operation = await client.delete_cdn_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -929,11 +929,11 @@ async def sample_update_cdn_key(): ) # Make the request - operation = client.update_cdn_key(request=request) + operation = await client.update_cdn_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2061,11 +2061,11 @@ async def sample_create_slate(): ) # Make the request - operation = client.create_slate(request=request) + operation = await client.create_slate(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2448,11 +2448,11 @@ async def sample_update_slate(): ) # Make the request - operation = client.update_slate(request=request) + operation = await client.update_slate(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2588,11 +2588,11 @@ async def sample_delete_slate(): ) # Make the request - operation = client.delete_slate(request=request) + operation = await client.delete_slate(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2978,11 +2978,11 @@ async def sample_create_live_config(): ) # Make the request - operation = client.create_live_config(request=request) + operation = await client.create_live_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3370,11 +3370,11 @@ async def sample_delete_live_config(): ) # Make the request - operation = client.delete_live_config(request=request) + operation = await client.delete_live_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3512,11 +3512,11 @@ async def sample_update_live_config(): ) # Make the request - operation = client.update_live_config(request=request) + operation = await client.update_live_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3662,11 +3662,11 @@ async def sample_create_vod_config(): ) # Make the request - operation = client.create_vod_config(request=request) + operation = await client.create_vod_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4054,11 +4054,11 @@ async def sample_delete_vod_config(): ) # Make the request - operation = client.delete_vod_config(request=request) + operation = await client.delete_vod_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4196,11 +4196,11 @@ async def sample_update_vod_config(): ) # Make the request - operation = client.update_vod_config(request=request) + operation = await client.update_vod_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/noxfile.py b/packages/google-cloud-video-stitcher/noxfile.py index 9390e58db0cb..0f3ac75e46b4 100644 --- a/packages/google-cloud-video-stitcher/noxfile.py +++ b/packages/google-cloud-video-stitcher/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-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_cdn_key_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_cdn_key_async.py index 4d50a92ac989..352df57464ee 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_cdn_key_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_cdn_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. @@ -45,11 +45,11 @@ async def sample_create_cdn_key(): ) # Make the request - operation = client.create_cdn_key(request=request) + operation = await client.create_cdn_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-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_live_config_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_live_config_async.py index 278323df2572..42966cc866b3 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_live_config_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_live_config_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_live_config(): ) # Make the request - operation = client.create_live_config(request=request) + operation = await client.create_live_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_slate_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_slate_async.py index a90a061b41e1..8e6c805ecc1c 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_slate_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_slate_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_slate(): ) # Make the request - operation = client.create_slate(request=request) + operation = await client.create_slate(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_vod_config_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_vod_config_async.py index 17cc3d445395..c6b28ee212f5 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_vod_config_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_create_vod_config_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_vod_config(): ) # Make the request - operation = client.create_vod_config(request=request) + operation = await client.create_vod_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_cdn_key_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_cdn_key_async.py index 05ebf5ba8e23..5b5c309025a2 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_cdn_key_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_cdn_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_cdn_key(): ) # Make the request - operation = client.delete_cdn_key(request=request) + operation = await client.delete_cdn_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-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_live_config_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_live_config_async.py index 7dfd5d376657..2ebcd323263d 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_live_config_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_live_config_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_live_config(): ) # Make the request - operation = client.delete_live_config(request=request) + operation = await client.delete_live_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_slate_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_slate_async.py index ecbd1d93c43b..b3239d01c85c 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_slate_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_slate_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_slate(): ) # Make the request - operation = client.delete_slate(request=request) + operation = await client.delete_slate(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_vod_config_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_vod_config_async.py index 5d38764c8d8c..6054a4e48b96 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_vod_config_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_delete_vod_config_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_vod_config(): ) # Make the request - operation = client.delete_vod_config(request=request) + operation = await client.delete_vod_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_cdn_key_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_cdn_key_async.py index b92db496d3df..6f8c9544d825 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_cdn_key_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_cdn_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. @@ -42,11 +42,11 @@ async def sample_update_cdn_key(): request = stitcher_v1.UpdateCdnKeyRequest() # Make the request - operation = client.update_cdn_key(request=request) + operation = await client.update_cdn_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-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_live_config_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_live_config_async.py index a50335113fdc..5b0973db02b0 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_live_config_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_live_config_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_live_config(): ) # Make the request - operation = client.update_live_config(request=request) + operation = await client.update_live_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_slate_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_slate_async.py index 6691f1f4c882..354139b9e6be 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_slate_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_slate_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_slate(): request = stitcher_v1.UpdateSlateRequest() # Make the request - operation = client.update_slate(request=request) + operation = await client.update_slate(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_vod_config_async.py b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_vod_config_async.py index 39ae79054c6e..d85bbf194645 100644 --- a/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_vod_config_async.py +++ b/packages/google-cloud-video-stitcher/samples/generated_samples/videostitcher_v1_generated_video_stitcher_service_update_vod_config_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_vod_config(): ) # Make the request - operation = client.update_vod_config(request=request) + operation = await client.update_vod_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-video-stitcher/setup.py b/packages/google-cloud-video-stitcher/setup.py index e25dc7077cd2..f538d245721b 100644 --- a/packages/google-cloud-video-stitcher/setup.py +++ b/packages/google-cloud-video-stitcher/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-video-stitcher/testing/constraints-3.10.txt b/packages/google-cloud-video-stitcher/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-video-stitcher/testing/constraints-3.10.txt +++ b/packages/google-cloud-video-stitcher/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-video-stitcher/testing/constraints-3.9.txt b/packages/google-cloud-video-stitcher/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-video-stitcher/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-video-stitcher/tests/unit/gapic/stitcher_v1/test_video_stitcher_service.py b/packages/google-cloud-video-stitcher/tests/unit/gapic/stitcher_v1/test_video_stitcher_service.py index d2884de87f4c..313287bfd44d 100644 --- a/packages/google-cloud-video-stitcher/tests/unit/gapic/stitcher_v1/test_video_stitcher_service.py +++ b/packages/google-cloud-video-stitcher/tests/unit/gapic/stitcher_v1/test_video_stitcher_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 @@ -2273,11 +2267,7 @@ async def test_list_cdn_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_cdn_keys(request={}) - ).pages: + async for page_ in (await client.list_cdn_keys(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4534,11 +4524,7 @@ async def test_list_vod_stitch_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 - await client.list_vod_stitch_details(request={}) - ).pages: + async for page_ in (await client.list_vod_stitch_details(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5424,11 +5410,7 @@ async def test_list_vod_ad_tag_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 - await client.list_vod_ad_tag_details(request={}) - ).pages: + async for page_ in (await client.list_vod_ad_tag_details(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6316,11 +6298,7 @@ async def test_list_live_ad_tag_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 - await client.list_live_ad_tag_details(request={}) - ).pages: + async for page_ in (await client.list_live_ad_tag_details(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7539,11 +7517,7 @@ async def test_list_slates_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_slates(request={}) - ).pages: + async for page_ in (await client.list_slates(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10146,11 +10120,7 @@ async def test_list_live_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_live_configs(request={}) - ).pages: + async for page_ in (await client.list_live_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12094,11 +12064,7 @@ async def test_list_vod_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_vod_configs(request={}) - ).pages: + async for page_ in (await client.list_vod_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13259,7 +13225,7 @@ def test_create_cdn_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_create_cdn_key_rest_unset_required_fields(): @@ -13460,7 +13426,7 @@ def test_list_cdn_keys_rest_required_fields( expected_params = [("$alt", "json;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_cdn_keys_rest_unset_required_fields(): @@ -13710,7 +13676,7 @@ def test_get_cdn_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_cdn_key_rest_unset_required_fields(): @@ -13888,7 +13854,7 @@ def test_delete_cdn_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_cdn_key_rest_unset_required_fields(): @@ -14062,7 +14028,7 @@ def test_update_cdn_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_cdn_key_rest_unset_required_fields(): @@ -14259,7 +14225,7 @@ def test_create_vod_session_rest_required_fields( expected_params = [("$alt", "json;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_vod_session_rest_unset_required_fields(): @@ -14447,7 +14413,7 @@ def test_get_vod_session_rest_required_fields( expected_params = [("$alt", "json;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_vod_session_rest_unset_required_fields(): @@ -14641,7 +14607,7 @@ def test_list_vod_stitch_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_vod_stitch_details_rest_unset_required_fields(): @@ -14902,7 +14868,7 @@ def test_get_vod_stitch_detail_rest_required_fields( expected_params = [("$alt", "json;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_vod_stitch_detail_rest_unset_required_fields(): @@ -15096,7 +15062,7 @@ def test_list_vod_ad_tag_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_vod_ad_tag_details_rest_unset_required_fields(): @@ -15357,7 +15323,7 @@ def test_get_vod_ad_tag_detail_rest_required_fields( expected_params = [("$alt", "json;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_vod_ad_tag_detail_rest_unset_required_fields(): @@ -15551,7 +15517,7 @@ def test_list_live_ad_tag_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_live_ad_tag_details_rest_unset_required_fields(): @@ -15812,7 +15778,7 @@ def test_get_live_ad_tag_detail_rest_required_fields( expected_params = [("$alt", "json;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_live_ad_tag_detail_rest_unset_required_fields(): @@ -16014,7 +15980,7 @@ def test_create_slate_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_slate_rest_unset_required_fields(): @@ -16216,7 +16182,7 @@ def test_list_slates_rest_required_fields( expected_params = [("$alt", "json;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_slates_rest_unset_required_fields(): @@ -16466,7 +16432,7 @@ def test_get_slate_rest_required_fields( expected_params = [("$alt", "json;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_slate_rest_unset_required_fields(): @@ -16642,7 +16608,7 @@ def test_update_slate_rest_required_fields( expected_params = [("$alt", "json;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_slate_rest_unset_required_fields(): @@ -16831,7 +16797,7 @@ def test_delete_slate_rest_required_fields( expected_params = [("$alt", "json;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_slate_rest_unset_required_fields(): @@ -17011,7 +16977,7 @@ def test_create_live_session_rest_required_fields( expected_params = [("$alt", "json;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_live_session_rest_unset_required_fields(): @@ -17201,7 +17167,7 @@ def test_get_live_session_rest_required_fields( expected_params = [("$alt", "json;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_live_session_rest_unset_required_fields(): @@ -17407,7 +17373,7 @@ def test_create_live_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_live_config_rest_unset_required_fields(): @@ -17614,7 +17580,7 @@ def test_list_live_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_live_configs_rest_unset_required_fields(): @@ -17865,7 +17831,7 @@ def test_get_live_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_live_config_rest_unset_required_fields(): @@ -18050,7 +18016,7 @@ def test_delete_live_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_live_config_rest_unset_required_fields(): @@ -18231,7 +18197,7 @@ def test_update_live_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_live_config_rest_unset_required_fields(): @@ -18445,7 +18411,7 @@ def test_create_vod_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_vod_config_rest_unset_required_fields(): @@ -18651,7 +18617,7 @@ def test_list_vod_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_vod_configs_rest_unset_required_fields(): @@ -18901,7 +18867,7 @@ def test_get_vod_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_vod_config_rest_unset_required_fields(): @@ -19083,7 +19049,7 @@ def test_delete_vod_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_vod_config_rest_unset_required_fields(): @@ -19261,7 +19227,7 @@ def test_update_vod_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_vod_config_rest_unset_required_fields(): diff --git a/packages/google-cloud-video-transcoder/docs/conf.py b/packages/google-cloud-video-transcoder/docs/conf.py index c33abeb24d0e..a64380aa7980 100644 --- a/packages/google-cloud-video-transcoder/docs/conf.py +++ b/packages/google-cloud-video-transcoder/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-video-transcoder" -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-video-transcoder/google/cloud/video/transcoder_v1/__init__.py b/packages/google-cloud-video-transcoder/google/cloud/video/transcoder_v1/__init__.py index deff318f34e2..010bea2804c5 100644 --- a/packages/google-cloud-video-transcoder/google/cloud/video/transcoder_v1/__init__.py +++ b/packages/google-cloud-video-transcoder/google/cloud/video/transcoder_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.transcoder_service import ( TranscoderServiceAsyncClient, @@ -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.video.transcoder_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-video-transcoder/noxfile.py b/packages/google-cloud-video-transcoder/noxfile.py index 96163f1cab4c..02f5630d5219 100644 --- a/packages/google-cloud-video-transcoder/noxfile.py +++ b/packages/google-cloud-video-transcoder/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-video-transcoder/setup.py b/packages/google-cloud-video-transcoder/setup.py index 3f9dc10d1ce3..1ca344e4033c 100644 --- a/packages/google-cloud-video-transcoder/setup.py +++ b/packages/google-cloud-video-transcoder/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-video-transcoder/testing/constraints-3.10.txt b/packages/google-cloud-video-transcoder/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-video-transcoder/testing/constraints-3.10.txt +++ b/packages/google-cloud-video-transcoder/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-video-transcoder/testing/constraints-3.9.txt b/packages/google-cloud-video-transcoder/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-video-transcoder/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-video-transcoder/tests/unit/gapic/transcoder_v1/test_transcoder_service.py b/packages/google-cloud-video-transcoder/tests/unit/gapic/transcoder_v1/test_transcoder_service.py index f38cba365b50..13a97d42a14a 100644 --- a/packages/google-cloud-video-transcoder/tests/unit/gapic/transcoder_v1/test_transcoder_service.py +++ b/packages/google-cloud-video-transcoder/tests/unit/gapic/transcoder_v1/test_transcoder_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 @@ -2230,11 +2224,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 @@ -3805,11 +3795,7 @@ async def test_list_job_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_job_templates(request={}) - ).pages: + async for page_ in (await client.list_job_templates(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4576,7 +4562,7 @@ def test_create_job_rest_required_fields(request_type=services.CreateJobRequest) expected_params = [("$alt", "json;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(): @@ -4770,7 +4756,7 @@ def test_list_jobs_rest_required_fields(request_type=services.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(): @@ -5016,7 +5002,7 @@ def test_get_job_rest_required_fields(request_type=services.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(): @@ -5190,7 +5176,7 @@ def test_delete_job_rest_required_fields(request_type=services.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(): @@ -5385,7 +5371,7 @@ def test_create_job_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_job_template_rest_unset_required_fields(): @@ -5589,7 +5575,7 @@ def test_list_job_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_job_templates_rest_unset_required_fields(): @@ -5840,7 +5826,7 @@ def test_get_job_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_job_template_rest_unset_required_fields(): @@ -6023,7 +6009,7 @@ def test_delete_job_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_job_template_rest_unset_required_fields(): diff --git a/packages/google-cloud-videointelligence/docs/conf.py b/packages/google-cloud-videointelligence/docs/conf.py index 3b40b8069676..48b95fbfe356 100644 --- a/packages/google-cloud-videointelligence/docs/conf.py +++ b/packages/google-cloud-videointelligence/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-videointelligence" -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-videointelligence/google/cloud/videointelligence_v1/__init__.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/__init__.py index 9a5c6dadced9..e9e9ee740f5f 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/__init__.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_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.video_intelligence_service import ( VideoIntelligenceServiceAsyncClient, @@ -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.videointelligence_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-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py index 1905b7fe51e7..e04786c718ff 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_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. @@ -345,11 +345,11 @@ async def sample_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/__init__.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/__init__.py index cd8f3312b689..1d37f3041354 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/__init__.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/__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.video_intelligence_service import ( VideoIntelligenceServiceAsyncClient, @@ -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.videointelligence_v1beta2" - 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-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py index a95da429f30c..41d10d071079 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_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. @@ -345,11 +345,11 @@ async def sample_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/__init__.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/__init__.py index a97e5aebfe6d..e26b9cdf6a01 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/__init__.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/__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.video_intelligence_service import ( VideoIntelligenceServiceAsyncClient, @@ -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.videointelligence_v1p1beta1" - 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-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py index e58d66fa4337..d46a63878cde 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_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. @@ -345,11 +345,11 @@ async def sample_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py index 818aca4b3c16..20a3ba3c4724 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/__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.video_intelligence_service import ( VideoIntelligenceServiceAsyncClient, @@ -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.videointelligence_v1p2beta1" - 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-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py index c5aca39317fa..0e94460903e1 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_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. @@ -345,11 +345,11 @@ async def sample_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/__init__.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/__init__.py index 43626a55775d..77686a4543a0 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/__init__.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/__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.streaming_video_intelligence_service import ( StreamingVideoIntelligenceServiceAsyncClient, @@ -108,28 +102,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.videointelligence_v1p3beta1" - 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-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py index e5f9fcbc03eb..23bba849702d 100644 --- a/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py +++ b/packages/google-cloud-videointelligence/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_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. @@ -345,11 +345,11 @@ async def sample_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/noxfile.py b/packages/google-cloud-videointelligence/noxfile.py index 2f016518235d..a132c5c194c7 100644 --- a/packages/google-cloud-videointelligence/noxfile.py +++ b/packages/google-cloud-videointelligence/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-videointelligence/samples/generated_samples/videointelligence_v1_generated_video_intelligence_service_annotate_video_async.py b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1_generated_video_intelligence_service_annotate_video_async.py index fb43efc3eeb4..032dce13a907 100644 --- a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1_generated_video_intelligence_service_annotate_video_async.py +++ b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1_generated_video_intelligence_service_annotate_video_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_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1beta2_generated_video_intelligence_service_annotate_video_async.py b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1beta2_generated_video_intelligence_service_annotate_video_async.py index 9ccf11288009..6a9ec7d75910 100644 --- a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1beta2_generated_video_intelligence_service_annotate_video_async.py +++ b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1beta2_generated_video_intelligence_service_annotate_video_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_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p1beta1_generated_video_intelligence_service_annotate_video_async.py b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p1beta1_generated_video_intelligence_service_annotate_video_async.py index a90de32c0b5a..20f306b5c20e 100644 --- a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p1beta1_generated_video_intelligence_service_annotate_video_async.py +++ b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p1beta1_generated_video_intelligence_service_annotate_video_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_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p2beta1_generated_video_intelligence_service_annotate_video_async.py b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p2beta1_generated_video_intelligence_service_annotate_video_async.py index a4ead25f9686..1107b78dabb1 100644 --- a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p2beta1_generated_video_intelligence_service_annotate_video_async.py +++ b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p2beta1_generated_video_intelligence_service_annotate_video_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_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p3beta1_generated_video_intelligence_service_annotate_video_async.py b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p3beta1_generated_video_intelligence_service_annotate_video_async.py index 2336808b186a..d35a603be0f8 100644 --- a/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p3beta1_generated_video_intelligence_service_annotate_video_async.py +++ b/packages/google-cloud-videointelligence/samples/generated_samples/videointelligence_v1p3beta1_generated_video_intelligence_service_annotate_video_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_annotate_video(): ) # Make the request - operation = client.annotate_video(request=request) + operation = await client.annotate_video(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-videointelligence/setup.py b/packages/google-cloud-videointelligence/setup.py index 3f7285ab3077..dcd2d1fddab8 100644 --- a/packages/google-cloud-videointelligence/setup.py +++ b/packages/google-cloud-videointelligence/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-videointelligence/testing/constraints-3.10.txt b/packages/google-cloud-videointelligence/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-videointelligence/testing/constraints-3.10.txt +++ b/packages/google-cloud-videointelligence/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-videointelligence/testing/constraints-3.9.txt b/packages/google-cloud-videointelligence/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-videointelligence/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-videointelligence/tests/unit/gapic/videointelligence_v1/test_video_intelligence_service.py b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1/test_video_intelligence_service.py index 364b5bbe718c..f286925cd0f2 100644 --- a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1/test_video_intelligence_service.py +++ b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1/test_video_intelligence_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 @@ -1777,7 +1771,7 @@ def test_annotate_video_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_annotate_video_rest_unset_required_fields(): diff --git a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1beta2/test_video_intelligence_service.py b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1beta2/test_video_intelligence_service.py index 0b7e0ead2583..d8ec19a6a0e6 100644 --- a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1beta2/test_video_intelligence_service.py +++ b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1beta2/test_video_intelligence_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 @@ -1777,7 +1771,7 @@ def test_annotate_video_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_annotate_video_rest_unset_required_fields(): diff --git a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p1beta1/test_video_intelligence_service.py b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p1beta1/test_video_intelligence_service.py index 46dce7dd9912..1c38d90350d0 100644 --- a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p1beta1/test_video_intelligence_service.py +++ b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p1beta1/test_video_intelligence_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 @@ -1777,7 +1771,7 @@ def test_annotate_video_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_annotate_video_rest_unset_required_fields(): diff --git a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p2beta1/test_video_intelligence_service.py b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p2beta1/test_video_intelligence_service.py index 589a51e9ca9b..4d45a2a2a2df 100644 --- a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p2beta1/test_video_intelligence_service.py +++ b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p2beta1/test_video_intelligence_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 @@ -1777,7 +1771,7 @@ def test_annotate_video_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_annotate_video_rest_unset_required_fields(): diff --git a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_streaming_video_intelligence_service.py b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_streaming_video_intelligence_service.py index 0b5b5ed24bf6..54949960d0a8 100644 --- a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_streaming_video_intelligence_service.py +++ b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_streaming_video_intelligence_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 Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest diff --git a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_video_intelligence_service.py b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_video_intelligence_service.py index 3797eb40cbdd..c11d2a20fb6f 100644 --- a/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_video_intelligence_service.py +++ b/packages/google-cloud-videointelligence/tests/unit/gapic/videointelligence_v1p3beta1/test_video_intelligence_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 Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest diff --git a/packages/google-cloud-vision/docs/conf.py b/packages/google-cloud-vision/docs/conf.py index ba1318fdcf3e..739818691b94 100644 --- a/packages/google-cloud-vision/docs/conf.py +++ b/packages/google-cloud-vision/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-vision" -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-vision/google/cloud/vision_v1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py index 06f9abdd8c32..ad4531c6cea7 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_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 google.cloud.vision_helpers import VisionHelpers from google.cloud.vision_helpers.decorators import add_single_feature_methods @@ -124,28 +118,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.vision_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-vision/google/cloud/vision_v1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py index 74fa29ef09a2..81be16aed81f 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/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. @@ -572,11 +572,11 @@ async def sample_async_batch_annotate_images(): ) # Make the request - operation = client.async_batch_annotate_images(request=request) + operation = await client.async_batch_annotate_images(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -710,11 +710,11 @@ async def sample_async_batch_annotate_files(): ) # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py index ae7e7609c46f..ab526413fc2b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/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. @@ -2563,11 +2563,11 @@ async def sample_import_product_sets(): ) # Make the request - operation = client.import_product_sets(request=request) + operation = await client.import_product_sets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2733,11 +2733,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-vision/google/cloud/vision_v1p1beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py index fe0424fc2aee..63385ec4b144 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p1beta1/__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 google.cloud.vision_helpers import VisionHelpers from google.cloud.vision_helpers.decorators import add_single_feature_methods @@ -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.vision_v1p1beta1" - 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-vision/google/cloud/vision_v1p2beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py index 9364752456ad..6c9a922ae9be 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/__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 google.cloud.vision_helpers import VisionHelpers from google.cloud.vision_helpers.decorators import add_single_feature_methods @@ -83,28 +77,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.vision_v1p2beta1" - 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-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py index a6142b0fcb4c..a6018022a100 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p2beta1/services/image_annotator/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. @@ -448,11 +448,11 @@ async def sample_async_batch_annotate_files(): ) # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py index 2a1457c9bd61..5f68e4357fe4 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/__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 google.cloud.vision_helpers import VisionHelpers from google.cloud.vision_helpers.decorators import add_single_feature_methods @@ -117,28 +111,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.vision_v1p3beta1" - 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-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py index a7bc8924f789..f1929082b250 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/image_annotator/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. @@ -451,11 +451,11 @@ async def sample_async_batch_annotate_files(): ) # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py index 5431df8c5c49..060e893e208b 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p3beta1/services/product_search/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. @@ -2581,11 +2581,11 @@ async def sample_import_product_sets(): ) # Make the request - operation = client.import_product_sets(request=request) + operation = await client.import_product_sets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py index ab660a25a1ec..415eedaa8838 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__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 google.cloud.vision_helpers import VisionHelpers from google.cloud.vision_helpers.decorators import add_single_feature_methods @@ -125,28 +119,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.vision_v1p4beta1" - 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-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py index 8ca1a453cb2c..7c1359cdae74 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/image_annotator/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. @@ -571,11 +571,11 @@ async def sample_async_batch_annotate_images(): ) # Make the request - operation = client.async_batch_annotate_images(request=request) + operation = await client.async_batch_annotate_images(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -709,11 +709,11 @@ async def sample_async_batch_annotate_files(): ) # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index f3422aeeb40f..ac59528d3d16 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1p4beta1/services/product_search/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. @@ -2566,11 +2566,11 @@ async def sample_import_product_sets(): ) # Make the request - operation = client.import_product_sets(request=request) + operation = await client.import_product_sets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2736,11 +2736,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-vision/noxfile.py b/packages/google-cloud-vision/noxfile.py index e4f47dc0acdb..d7a225b5c1c2 100644 --- a/packages/google-cloud-vision/noxfile.py +++ b/packages/google-cloud-vision/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", @@ -391,7 +390,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-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_files_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_files_async.py index 0288fce2c8fc..07664dc29295 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_files_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_files_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_async_batch_annotate_files(): request = vision_v1.AsyncBatchAnnotateFilesRequest() # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_images_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_images_async.py index 0953c8f53139..10275d7b414d 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_images_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_image_annotator_async_batch_annotate_images_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_async_batch_annotate_images(): request = vision_v1.AsyncBatchAnnotateImagesRequest() # Make the request - operation = client.async_batch_annotate_images(request=request) + operation = await client.async_batch_annotate_images(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_import_product_sets_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_import_product_sets_async.py index eab3bcbdcff0..36c5c7f85840 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_import_product_sets_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_import_product_sets_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_product_sets(): ) # Make the request - operation = client.import_product_sets(request=request) + operation = await client.import_product_sets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_purge_products_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_purge_products_async.py index 695f670055e3..da88e7a2f4ef 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_purge_products_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1_generated_product_search_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. @@ -44,11 +44,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-vision/samples/generated_samples/vision_v1p2beta1_generated_image_annotator_async_batch_annotate_files_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p2beta1_generated_image_annotator_async_batch_annotate_files_async.py index 8fd90858a501..afcd7519d67c 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p2beta1_generated_image_annotator_async_batch_annotate_files_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p2beta1_generated_image_annotator_async_batch_annotate_files_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_async_batch_annotate_files(): request = vision_v1p2beta1.AsyncBatchAnnotateFilesRequest() # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_image_annotator_async_batch_annotate_files_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_image_annotator_async_batch_annotate_files_async.py index fd876fdee2d4..a6d77ce0b276 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_image_annotator_async_batch_annotate_files_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_image_annotator_async_batch_annotate_files_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_async_batch_annotate_files(): request = vision_v1p3beta1.AsyncBatchAnnotateFilesRequest() # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_product_search_import_product_sets_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_product_search_import_product_sets_async.py index 1b8904dbad18..ccd8a3d3e24b 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_product_search_import_product_sets_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p3beta1_generated_product_search_import_product_sets_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_product_sets(): ) # Make the request - operation = client.import_product_sets(request=request) + operation = await client.import_product_sets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_files_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_files_async.py index e05ddd963c6e..d5cd11d6fd4d 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_files_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_files_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_async_batch_annotate_files(): request = vision_v1p4beta1.AsyncBatchAnnotateFilesRequest() # Make the request - operation = client.async_batch_annotate_files(request=request) + operation = await client.async_batch_annotate_files(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_images_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_images_async.py index 341975808b5f..b046a8c1d2de 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_images_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_image_annotator_async_batch_annotate_images_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_async_batch_annotate_images(): request = vision_v1p4beta1.AsyncBatchAnnotateImagesRequest() # Make the request - operation = client.async_batch_annotate_images(request=request) + operation = await client.async_batch_annotate_images(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_import_product_sets_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_import_product_sets_async.py index 4301c81b5a67..7c864aa7af93 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_import_product_sets_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_import_product_sets_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_product_sets(): ) # Make the request - operation = client.import_product_sets(request=request) + operation = await client.import_product_sets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_purge_products_async.py b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_purge_products_async.py index e9cddbb9b73a..8809ad46e781 100644 --- a/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_purge_products_async.py +++ b/packages/google-cloud-vision/samples/generated_samples/vision_v1p4beta1_generated_product_search_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. @@ -44,11 +44,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-vision/setup.py b/packages/google-cloud-vision/setup.py index a3442a397dd8..686939ed475d 100644 --- a/packages/google-cloud-vision/setup.py +++ b/packages/google-cloud-vision/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-vision/testing/constraints-3.10.txt b/packages/google-cloud-vision/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-vision/testing/constraints-3.10.txt +++ b/packages/google-cloud-vision/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-vision/testing/constraints-3.9.txt b/packages/google-cloud-vision/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-vision/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-vision/tests/unit/gapic/vision_v1/test_image_annotator.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_image_annotator.py index 423e77fcbee0..bfdf3ea605af 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_image_annotator.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_image_annotator.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2679,7 +2673,7 @@ def test_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;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_annotate_images_rest_unset_required_fields(): @@ -2863,7 +2857,7 @@ def test_batch_annotate_files_rest_required_fields( expected_params = [("$alt", "json;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_annotate_files_rest_unset_required_fields(): @@ -3053,7 +3047,7 @@ def test_async_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_async_batch_annotate_images_rest_unset_required_fields(): @@ -3251,7 +3245,7 @@ def test_async_batch_annotate_files_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_async_batch_annotate_files_rest_unset_required_fields(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_product_search.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_product_search.py index 667dfef677ac..91bcbffc635e 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_product_search.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1/test_product_search.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2224,11 +2218,7 @@ async def test_list_product_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 - await client.list_product_sets(request={}) - ).pages: + async for page_ in (await client.list_product_sets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4112,11 +4102,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 @@ -6357,11 +6343,7 @@ async def test_list_reference_images_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_reference_images(request={}) - ).pages: + async for page_ in (await client.list_reference_images(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7938,9 +7920,7 @@ async def test_list_products_in_product_set_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_products_in_product_set(request={}) ).pages: pages.append(page_) @@ -8771,7 +8751,7 @@ def test_create_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -8972,7 +8952,7 @@ def test_list_product_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_product_sets_rest_unset_required_fields(): @@ -9221,7 +9201,7 @@ def test_get_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9403,7 +9383,7 @@ def test_update_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9588,7 +9568,7 @@ def test_delete_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9769,7 +9749,7 @@ def test_create_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_create_product_rest_unset_required_fields(): @@ -9965,7 +9945,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(): @@ -10213,7 +10193,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(): @@ -10388,7 +10368,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(): @@ -10567,7 +10547,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(): @@ -10750,7 +10730,7 @@ def test_create_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -10944,7 +10924,7 @@ def test_delete_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -11136,7 +11116,7 @@ def test_list_reference_images_rest_required_fields( expected_params = [("$alt", "json;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_reference_images_rest_unset_required_fields(): @@ -11398,7 +11378,7 @@ def test_get_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -11585,7 +11565,7 @@ def test_add_product_to_product_set_rest_required_fields( expected_params = [("$alt", "json;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_product_to_product_set_rest_unset_required_fields(): @@ -11780,7 +11760,7 @@ def test_remove_product_from_product_set_rest_required_fields( expected_params = [("$alt", "json;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_product_from_product_set_rest_unset_required_fields(): @@ -11984,7 +11964,7 @@ def test_list_products_in_product_set_rest_required_fields( expected_params = [("$alt", "json;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_in_product_set_rest_unset_required_fields(): @@ -12246,7 +12226,7 @@ def test_import_product_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_import_product_sets_rest_unset_required_fields(): @@ -12442,7 +12422,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(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p1beta1/test_image_annotator.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p1beta1/test_image_annotator.py index fec95051bd71..b4b574403d2f 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p1beta1/test_image_annotator.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p1beta1/test_image_annotator.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1717,7 +1711,7 @@ def test_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;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_annotate_images_rest_unset_required_fields(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p2beta1/test_image_annotator.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p2beta1/test_image_annotator.py index e010d32bd034..7a4b1403ff73 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p2beta1/test_image_annotator.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p2beta1/test_image_annotator.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2037,7 +2031,7 @@ def test_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;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_annotate_images_rest_unset_required_fields(): @@ -2223,7 +2217,7 @@ def test_async_batch_annotate_files_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_async_batch_annotate_files_rest_unset_required_fields(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_image_annotator.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_image_annotator.py index 665cc434df93..96481189586d 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_image_annotator.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_image_annotator.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2040,7 +2034,7 @@ def test_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;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_annotate_images_rest_unset_required_fields(): @@ -2226,7 +2220,7 @@ def test_async_batch_annotate_files_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_async_batch_annotate_files_rest_unset_required_fields(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_product_search.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_product_search.py index 10e0408bf1dc..a3dcadeac5d4 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_product_search.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p3beta1/test_product_search.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2223,11 +2217,7 @@ async def test_list_product_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 - await client.list_product_sets(request={}) - ).pages: + async for page_ in (await client.list_product_sets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4111,11 +4101,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 @@ -6356,11 +6342,7 @@ async def test_list_reference_images_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_reference_images(request={}) - ).pages: + async for page_ in (await client.list_reference_images(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7937,9 +7919,7 @@ async def test_list_products_in_product_set_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_products_in_product_set(request={}) ).pages: pages.append(page_) @@ -8442,7 +8422,7 @@ def test_create_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -8643,7 +8623,7 @@ def test_list_product_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_product_sets_rest_unset_required_fields(): @@ -8892,7 +8872,7 @@ def test_get_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9074,7 +9054,7 @@ def test_update_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9259,7 +9239,7 @@ def test_delete_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9440,7 +9420,7 @@ def test_create_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_create_product_rest_unset_required_fields(): @@ -9637,7 +9617,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(): @@ -9886,7 +9866,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(): @@ -10062,7 +10042,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(): @@ -10241,7 +10221,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(): @@ -10425,7 +10405,7 @@ def test_create_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -10619,7 +10599,7 @@ def test_delete_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -10811,7 +10791,7 @@ def test_list_reference_images_rest_required_fields( expected_params = [("$alt", "json;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_reference_images_rest_unset_required_fields(): @@ -11073,7 +11053,7 @@ def test_get_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -11260,7 +11240,7 @@ def test_add_product_to_product_set_rest_required_fields( expected_params = [("$alt", "json;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_product_to_product_set_rest_unset_required_fields(): @@ -11455,7 +11435,7 @@ def test_remove_product_from_product_set_rest_required_fields( expected_params = [("$alt", "json;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_product_from_product_set_rest_unset_required_fields(): @@ -11659,7 +11639,7 @@ def test_list_products_in_product_set_rest_required_fields( expected_params = [("$alt", "json;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_in_product_set_rest_unset_required_fields(): @@ -11921,7 +11901,7 @@ def test_import_product_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_import_product_sets_rest_unset_required_fields(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_image_annotator.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_image_annotator.py index 23630d025eb0..2d323f21bd33 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_image_annotator.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_image_annotator.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2668,7 +2662,7 @@ def test_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;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_annotate_images_rest_unset_required_fields(): @@ -2852,7 +2846,7 @@ def test_batch_annotate_files_rest_required_fields( expected_params = [("$alt", "json;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_annotate_files_rest_unset_required_fields(): @@ -3042,7 +3036,7 @@ def test_async_batch_annotate_images_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_async_batch_annotate_images_rest_unset_required_fields(): @@ -3240,7 +3234,7 @@ def test_async_batch_annotate_files_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_async_batch_annotate_files_rest_unset_required_fields(): diff --git a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_product_search.py b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_product_search.py index 679ad59adaca..630f7b8fb82a 100644 --- a/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_product_search.py +++ b/packages/google-cloud-vision/tests/unit/gapic/vision_v1p4beta1/test_product_search.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2224,11 +2218,7 @@ async def test_list_product_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 - await client.list_product_sets(request={}) - ).pages: + async for page_ in (await client.list_product_sets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4112,11 +4102,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 @@ -6357,11 +6343,7 @@ async def test_list_reference_images_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_reference_images(request={}) - ).pages: + async for page_ in (await client.list_reference_images(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7938,9 +7920,7 @@ async def test_list_products_in_product_set_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_products_in_product_set(request={}) ).pages: pages.append(page_) @@ -8771,7 +8751,7 @@ def test_create_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -8972,7 +8952,7 @@ def test_list_product_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_product_sets_rest_unset_required_fields(): @@ -9221,7 +9201,7 @@ def test_get_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9403,7 +9383,7 @@ def test_update_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9588,7 +9568,7 @@ def test_delete_product_set_rest_required_fields( expected_params = [("$alt", "json;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_set_rest_unset_required_fields(): @@ -9769,7 +9749,7 @@ def test_create_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_create_product_rest_unset_required_fields(): @@ -9966,7 +9946,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(): @@ -10215,7 +10195,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(): @@ -10391,7 +10371,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(): @@ -10570,7 +10550,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(): @@ -10754,7 +10734,7 @@ def test_create_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -10948,7 +10928,7 @@ def test_delete_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -11140,7 +11120,7 @@ def test_list_reference_images_rest_required_fields( expected_params = [("$alt", "json;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_reference_images_rest_unset_required_fields(): @@ -11402,7 +11382,7 @@ def test_get_reference_image_rest_required_fields( expected_params = [("$alt", "json;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_reference_image_rest_unset_required_fields(): @@ -11589,7 +11569,7 @@ def test_add_product_to_product_set_rest_required_fields( expected_params = [("$alt", "json;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_product_to_product_set_rest_unset_required_fields(): @@ -11784,7 +11764,7 @@ def test_remove_product_from_product_set_rest_required_fields( expected_params = [("$alt", "json;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_product_from_product_set_rest_unset_required_fields(): @@ -11988,7 +11968,7 @@ def test_list_products_in_product_set_rest_required_fields( expected_params = [("$alt", "json;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_in_product_set_rest_unset_required_fields(): @@ -12250,7 +12230,7 @@ def test_import_product_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_import_product_sets_rest_unset_required_fields(): @@ -12446,7 +12426,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(): diff --git a/packages/google-cloud-visionai/docs/conf.py b/packages/google-cloud-visionai/docs/conf.py index bcd29cd6f588..38849ad302d0 100644 --- a/packages/google-cloud-visionai/docs/conf.py +++ b/packages/google-cloud-visionai/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-visionai" -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-visionai/google/cloud/visionai_v1/__init__.py b/packages/google-cloud-visionai/google/cloud/visionai_v1/__init__.py index b08b23a95c99..be5b2569f01d 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1/__init__.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_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.app_platform import AppPlatformAsyncClient, AppPlatformClient from .services.health_check_service import ( @@ -411,28 +405,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.visionai_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-visionai/google/cloud/visionai_v1/services/app_platform/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/app_platform/async_client.py index e251d011e6c1..a0dfd89c7994 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/app_platform/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/app_platform/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. @@ -580,11 +580,11 @@ async def sample_create_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -714,11 +714,11 @@ async def sample_update_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -852,11 +852,11 @@ async def sample_delete_application(): ) # Make the request - operation = client.delete_application(request=request) + operation = await client.delete_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -982,11 +982,11 @@ async def sample_deploy_application(): ) # Make the request - operation = client.deploy_application(request=request) + operation = await client.deploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1108,11 +1108,11 @@ async def sample_undeploy_application(): ) # Make the request - operation = client.undeploy_application(request=request) + operation = await client.undeploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1241,11 +1241,11 @@ async def sample_add_application_stream_input(): ) # Make the request - operation = client.add_application_stream_input(request=request) + operation = await client.add_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1374,11 +1374,11 @@ async def sample_remove_application_stream_input(): ) # Make the request - operation = client.remove_application_stream_input(request=request) + operation = await client.remove_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1507,11 +1507,11 @@ async def sample_update_application_stream_input(): ) # Make the request - operation = client.update_application_stream_input(request=request) + operation = await client.update_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1879,11 +1879,11 @@ async def sample_create_application_instances(): ) # Make the request - operation = client.create_application_instances(request=request) + operation = await client.create_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2013,11 +2013,11 @@ async def sample_delete_application_instances(): ) # Make the request - operation = client.delete_application_instances(request=request) + operation = await client.delete_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2150,11 +2150,11 @@ async def sample_update_application_instances(): ) # Make the request - operation = client.update_application_instances(request=request) + operation = await client.update_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2524,11 +2524,11 @@ async def sample_create_draft(): ) # Make the request - operation = client.create_draft(request=request) + operation = await client.create_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2667,11 +2667,11 @@ async def sample_update_draft(): ) # Make the request - operation = client.update_draft(request=request) + operation = await client.update_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2805,11 +2805,11 @@ async def sample_delete_draft(): ) # Make the request - operation = client.delete_draft(request=request) + operation = await client.delete_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3287,11 +3287,11 @@ async def sample_create_processor(): ) # Make the request - operation = client.create_processor(request=request) + operation = await client.create_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3429,11 +3429,11 @@ async def sample_update_processor(): ) # Make the request - operation = client.update_processor(request=request) + operation = await client.update_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3566,11 +3566,11 @@ async def sample_delete_processor(): ) # Make the request - operation = client.delete_processor(request=request) + operation = await client.delete_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/live_video_analytics/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/live_video_analytics/async_client.py index 3e901c5f3fdd..a3ed3420baed 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/live_video_analytics/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/live_video_analytics/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. @@ -841,11 +841,11 @@ async def sample_create_operator(): ) # Make the request - operation = client.create_operator(request=request) + operation = await client.create_operator(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -980,11 +980,11 @@ async def sample_update_operator(): ) # Make the request - operation = client.update_operator(request=request) + operation = await client.update_operator(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_delete_operator(): ) # Make the request - operation = client.delete_operator(request=request) + operation = await client.delete_operator(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1486,11 +1486,11 @@ async def sample_create_analysis(): ) # Make the request - operation = client.create_analysis(request=request) + operation = await client.create_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1625,11 +1625,11 @@ async def sample_update_analysis(): ) # Make the request - operation = client.update_analysis(request=request) + operation = await client.update_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1763,11 +1763,11 @@ async def sample_delete_analysis(): ) # Make the request - operation = client.delete_analysis(request=request) + operation = await client.delete_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2135,11 +2135,11 @@ async def sample_create_process(): ) # Make the request - operation = client.create_process(request=request) + operation = await client.create_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2278,11 +2278,11 @@ async def sample_update_process(): ) # Make the request - operation = client.update_process(request=request) + operation = await client.update_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2416,11 +2416,11 @@ async def sample_delete_process(): ) # Make the request - operation = client.delete_process(request=request) + operation = await client.delete_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2554,11 +2554,11 @@ async def sample_batch_run_process(): ) # Make the request - operation = client.batch_run_process(request=request) + operation = await client.batch_run_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/streams_service/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/streams_service/async_client.py index 5e1863240577..e813ab28ae5b 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/streams_service/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/streams_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. @@ -589,11 +589,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) @@ -728,11 +728,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) @@ -866,11 +866,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) @@ -1237,11 +1237,11 @@ async def sample_create_stream(): ) # Make the request - operation = client.create_stream(request=request) + operation = await client.create_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1377,11 +1377,11 @@ async def sample_update_stream(): ) # Make the request - operation = client.update_stream(request=request) + operation = await client.update_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1516,11 +1516,11 @@ async def sample_delete_stream(): ) # Make the request - operation = client.delete_stream(request=request) + operation = await client.delete_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1651,11 +1651,11 @@ async def sample_get_stream_thumbnail(): ) # Make the request - operation = client.get_stream_thumbnail(request=request) + operation = await client.get_stream_thumbnail(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2133,11 +2133,11 @@ async def sample_create_event(): ) # Make the request - operation = client.create_event(request=request) + operation = await client.create_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2272,11 +2272,11 @@ async def sample_update_event(): ) # Make the request - operation = client.update_event(request=request) + operation = await client.update_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2410,11 +2410,11 @@ async def sample_delete_event(): ) # Make the request - operation = client.delete_event(request=request) + operation = await client.delete_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2780,11 +2780,11 @@ async def sample_create_series(): ) # Make the request - operation = client.create_series(request=request) + operation = await client.create_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2924,11 +2924,11 @@ async def sample_update_series(): ) # Make the request - operation = client.update_series(request=request) + operation = await client.update_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3062,11 +3062,11 @@ async def sample_delete_series(): ) # Make the request - operation = client.delete_series(request=request) + operation = await client.delete_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3202,11 +3202,11 @@ async def sample_materialize_channel(): ) # Make the request - operation = client.materialize_channel(request=request) + operation = await client.materialize_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/warehouse/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/warehouse/async_client.py index 31b73fe546d3..5940993d8428 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1/services/warehouse/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1/services/warehouse/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. @@ -862,11 +862,11 @@ async def sample_delete_asset(): ) # Make the request - operation = client.delete_asset(request=request) + operation = await client.delete_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1005,11 +1005,11 @@ async def sample_upload_asset(): ) # Make the request - operation = client.upload_asset(request=request) + operation = await client.upload_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1194,11 +1194,11 @@ async def sample_analyze_asset(): ) # Make the request - operation = client.analyze_asset(request=request) + operation = await client.analyze_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1295,11 +1295,11 @@ async def sample_index_asset(): ) # Make the request - operation = client.index_asset(request=request) + operation = await client.index_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1396,11 +1396,11 @@ async def sample_remove_index_asset(): ) # Make the request - operation = client.remove_index_asset(request=request) + operation = await client.remove_index_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1630,11 +1630,11 @@ async def sample_create_index(): ) # Make the request - operation = client.create_index(request=request) + operation = await client.create_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1783,11 +1783,11 @@ async def sample_update_index(): ) # Make the request - operation = client.update_index(request=request) + operation = await client.update_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2164,11 +2164,11 @@ async def sample_delete_index(): ) # Make the request - operation = client.delete_index(request=request) + operation = await client.delete_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2301,11 +2301,11 @@ async def sample_create_corpus(): ) # Make the request - operation = client.create_corpus(request=request) + operation = await client.create_corpus(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2893,11 +2893,11 @@ async def sample_analyze_corpus(): ) # Make the request - operation = client.analyze_corpus(request=request) + operation = await client.analyze_corpus(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4445,11 +4445,11 @@ async def sample_import_assets(): ) # Make the request - operation = client.import_assets(request=request) + operation = await client.import_assets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5998,11 +5998,11 @@ async def sample_create_index_endpoint(): ) # Make the request - operation = client.create_index_endpoint(request=request) + operation = await client.create_index_endpoint(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6387,11 +6387,11 @@ async def sample_update_index_endpoint(): ) # Make the request - operation = client.update_index_endpoint(request=request) + operation = await client.update_index_endpoint(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6528,11 +6528,11 @@ async def sample_delete_index_endpoint(): ) # Make the request - operation = client.delete_index_endpoint(request=request) + operation = await client.delete_index_endpoint(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6662,11 +6662,11 @@ async def sample_deploy_index(): ) # Make the request - operation = client.deploy_index(request=request) + operation = await client.deploy_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6764,11 +6764,11 @@ async def sample_undeploy_index(): ) # Make the request - operation = client.undeploy_index(request=request) + operation = await client.undeploy_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6870,11 +6870,11 @@ async def sample_create_collection(): ) # Make the request - operation = client.create_collection(request=request) + operation = await client.create_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7019,11 +7019,11 @@ async def sample_delete_collection(): ) # Make the request - operation = client.delete_collection(request=request) + operation = await client.delete_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1/types/platform.py b/packages/google-cloud-visionai/google/cloud/visionai_v1/types/platform.py index e45d55832fa5..58ab8a5a030e 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1/types/platform.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1/types/platform.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -3452,13 +3452,11 @@ class VertexCustomConfig(proto.Message): 'appPlatformMetadata': { 'ingestionTime': DOUBLE; (UNIX timestamp) - 'application': STRING; + 'application': STRING; 'instanceId': STRING; 'node': STRING; 'processor': STRING; - } - dynamic_config_input_topic (str): Optional. By setting the configuration_input_topic, processor will subscribe to given topic, only pub/sub topic diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/__init__.py b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/__init__.py index ea4a0826b9e4..911275f59ea5 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/__init__.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/__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.app_platform import AppPlatformAsyncClient, AppPlatformClient from .services.live_video_analytics import ( @@ -286,28 +280,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.visionai_v1alpha1" - 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-visionai/google/cloud/visionai_v1alpha1/services/app_platform/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/app_platform/async_client.py index 5e8a50406c9e..30f72fd02c22 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/app_platform/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/app_platform/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. @@ -580,11 +580,11 @@ async def sample_create_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -714,11 +714,11 @@ async def sample_update_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -852,11 +852,11 @@ async def sample_delete_application(): ) # Make the request - operation = client.delete_application(request=request) + operation = await client.delete_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -982,11 +982,11 @@ async def sample_deploy_application(): ) # Make the request - operation = client.deploy_application(request=request) + operation = await client.deploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1108,11 +1108,11 @@ async def sample_undeploy_application(): ) # Make the request - operation = client.undeploy_application(request=request) + operation = await client.undeploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1241,11 +1241,11 @@ async def sample_add_application_stream_input(): ) # Make the request - operation = client.add_application_stream_input(request=request) + operation = await client.add_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1374,11 +1374,11 @@ async def sample_remove_application_stream_input(): ) # Make the request - operation = client.remove_application_stream_input(request=request) + operation = await client.remove_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1507,11 +1507,11 @@ async def sample_update_application_stream_input(): ) # Make the request - operation = client.update_application_stream_input(request=request) + operation = await client.update_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1877,11 +1877,11 @@ async def sample_create_application_instances(): ) # Make the request - operation = client.create_application_instances(request=request) + operation = await client.create_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2011,11 +2011,11 @@ async def sample_delete_application_instances(): ) # Make the request - operation = client.delete_application_instances(request=request) + operation = await client.delete_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2149,11 +2149,11 @@ async def sample_update_application_instances(): ) # Make the request - operation = client.update_application_instances(request=request) + operation = await client.update_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2523,11 +2523,11 @@ async def sample_create_draft(): ) # Make the request - operation = client.create_draft(request=request) + operation = await client.create_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2666,11 +2666,11 @@ async def sample_update_draft(): ) # Make the request - operation = client.update_draft(request=request) + operation = await client.update_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2804,11 +2804,11 @@ async def sample_delete_draft(): ) # Make the request - operation = client.delete_draft(request=request) + operation = await client.delete_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3286,11 +3286,11 @@ async def sample_create_processor(): ) # Make the request - operation = client.create_processor(request=request) + operation = await client.create_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3428,11 +3428,11 @@ async def sample_update_processor(): ) # Make the request - operation = client.update_processor(request=request) + operation = await client.update_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3565,11 +3565,11 @@ async def sample_delete_processor(): ) # Make the request - operation = client.delete_processor(request=request) + operation = await client.delete_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/live_video_analytics/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/live_video_analytics/async_client.py index 78f9023c8cc6..a6a6cb302bad 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/live_video_analytics/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/live_video_analytics/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. @@ -586,11 +586,11 @@ async def sample_create_analysis(): ) # Make the request - operation = client.create_analysis(request=request) + operation = await client.create_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -725,11 +725,11 @@ async def sample_update_analysis(): ) # Make the request - operation = client.update_analysis(request=request) + operation = await client.update_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -863,11 +863,11 @@ async def sample_delete_analysis(): ) # Make the request - operation = client.delete_analysis(request=request) + operation = await client.delete_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/streams_service/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/streams_service/async_client.py index 8d45e1baf6fd..7e6631971fd7 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/streams_service/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/streams_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. @@ -593,11 +593,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) @@ -732,11 +732,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) @@ -870,11 +870,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) @@ -1241,11 +1241,11 @@ async def sample_create_stream(): ) # Make the request - operation = client.create_stream(request=request) + operation = await client.create_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1381,11 +1381,11 @@ async def sample_update_stream(): ) # Make the request - operation = client.update_stream(request=request) + operation = await client.update_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1520,11 +1520,11 @@ async def sample_delete_stream(): ) # Make the request - operation = client.delete_stream(request=request) + operation = await client.delete_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1997,11 +1997,11 @@ async def sample_create_event(): ) # Make the request - operation = client.create_event(request=request) + operation = await client.create_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2136,11 +2136,11 @@ async def sample_update_event(): ) # Make the request - operation = client.update_event(request=request) + operation = await client.update_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2274,11 +2274,11 @@ async def sample_delete_event(): ) # Make the request - operation = client.delete_event(request=request) + operation = await client.delete_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2644,11 +2644,11 @@ async def sample_create_series(): ) # Make the request - operation = client.create_series(request=request) + operation = await client.create_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2788,11 +2788,11 @@ async def sample_update_series(): ) # Make the request - operation = client.update_series(request=request) + operation = await client.update_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2926,11 +2926,11 @@ async def sample_delete_series(): ) # Make the request - operation = client.delete_series(request=request) + operation = await client.delete_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3066,11 +3066,11 @@ async def sample_materialize_channel(): ) # Make the request - operation = client.materialize_channel(request=request) + operation = await client.materialize_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/warehouse/async_client.py b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/warehouse/async_client.py index a2303ef23e68..1eec9be155ec 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/warehouse/async_client.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/services/warehouse/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. @@ -850,11 +850,11 @@ async def sample_delete_asset(): ) # Make the request - operation = client.delete_asset(request=request) + operation = await client.delete_asset(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_create_corpus(): ) # Make the request - operation = client.create_corpus(request=request) + operation = await client.create_corpus(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/types/platform.py b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/types/platform.py index a9ef897d2a57..2a177c98c63e 100644 --- a/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/types/platform.py +++ b/packages/google-cloud-visionai/google/cloud/visionai_v1alpha1/types/platform.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -3258,13 +3258,11 @@ class VertexCustomConfig(proto.Message): 'appPlatformMetadata': { 'ingestionTime': DOUBLE; (UNIX timestamp) - 'application': STRING; + 'application': STRING; 'instanceId': STRING; 'node': STRING; 'processor': STRING; - } - """ max_prediction_fps: int = proto.Field( diff --git a/packages/google-cloud-visionai/noxfile.py b/packages/google-cloud-visionai/noxfile.py index b1c8a8cd5c33..9b20afa27e78 100644 --- a/packages/google-cloud-visionai/noxfile.py +++ b/packages/google-cloud-visionai/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-visionai/samples/generated_samples/visionai_v1_generated_app_platform_add_application_stream_input_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_add_application_stream_input_async.py index ed9655a1e4d5..b2bdc0c2b5c4 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_add_application_stream_input_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_add_application_stream_input_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_application_stream_input(): ) # Make the request - operation = client.add_application_stream_input(request=request) + operation = await client.add_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_async.py index 6bf078ac0d30..c0284b43a6c9 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_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_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_instances_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_instances_async.py index 7ea08e201e0b..ab3e16f31bc7 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_instances_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_application_instances_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_application_instances(): ) # Make the request - operation = client.create_application_instances(request=request) + operation = await client.create_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_draft_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_draft_async.py index 5dc142f2d9d8..4a363b674a07 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_draft_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_draft_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_draft(): ) # Make the request - operation = client.create_draft(request=request) + operation = await client.create_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_processor_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_processor_async.py index 3fbd528a0ded..e6768a0f010d 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_processor_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_create_processor_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_processor(): ) # Make the request - operation = client.create_processor(request=request) + operation = await client.create_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_async.py index 01bf4f99982c..c3fa195a9c50 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_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_application(): ) # Make the request - operation = client.delete_application(request=request) + operation = await client.delete_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_instances_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_instances_async.py index a7091471e36d..595eaa261a60 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_instances_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_application_instances_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_delete_application_instances(): ) # Make the request - operation = client.delete_application_instances(request=request) + operation = await client.delete_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_draft_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_draft_async.py index 68afc4a9f20b..bd76ae36e049 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_draft_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_draft_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_draft(): ) # Make the request - operation = client.delete_draft(request=request) + operation = await client.delete_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_processor_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_processor_async.py index be427d65d58a..2bb3cb29c8d8 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_processor_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_delete_processor_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_processor(): ) # Make the request - operation = client.delete_processor(request=request) + operation = await client.delete_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_deploy_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_deploy_application_async.py index cd362eccc75d..2bf9e56713a0 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_deploy_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_deploy_application_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_deploy_application(): ) # Make the request - operation = client.deploy_application(request=request) + operation = await client.deploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_remove_application_stream_input_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_remove_application_stream_input_async.py index a2847a2129e3..3744d3eebee9 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_remove_application_stream_input_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_remove_application_stream_input_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_remove_application_stream_input(): ) # Make the request - operation = client.remove_application_stream_input(request=request) + operation = await client.remove_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_undeploy_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_undeploy_application_async.py index 82c2ae3eec34..98d7b0bfb83f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_undeploy_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_undeploy_application_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_undeploy_application(): ) # Make the request - operation = client.undeploy_application(request=request) + operation = await client.undeploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_async.py index 41594aef1f80..2230877292a4 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_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_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_instances_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_instances_async.py index 7eae9cf3456f..e77852559aed 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_instances_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_instances_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_update_application_instances(): ) # Make the request - operation = client.update_application_instances(request=request) + operation = await client.update_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_stream_input_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_stream_input_async.py index f4e959ef8444..c1e4bbaa66fd 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_stream_input_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_application_stream_input_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_update_application_stream_input(): ) # Make the request - operation = client.update_application_stream_input(request=request) + operation = await client.update_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_draft_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_draft_async.py index f23857a7b6f2..3f8471aa0b2f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_draft_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_draft_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_draft(): ) # Make the request - operation = client.update_draft(request=request) + operation = await client.update_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_processor_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_processor_async.py index d6d8d5288869..0db2e983feeb 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_processor_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_app_platform_update_processor_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_processor(): ) # Make the request - operation = client.update_processor(request=request) + operation = await client.update_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_batch_run_process_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_batch_run_process_async.py index 0fc56c3cddc2..c28e385986bd 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_batch_run_process_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_batch_run_process_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_batch_run_process(): ) # Make the request - operation = client.batch_run_process(request=request) + operation = await client.batch_run_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_analysis_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_analysis_async.py index 244a86b5ff2c..52e44d4f1248 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_analysis_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_analysis_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_analysis(): ) # Make the request - operation = client.create_analysis(request=request) + operation = await client.create_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_operator_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_operator_async.py index 349b825d8fad..db4bc6ed7bee 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_operator_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_operator_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_operator(): ) # Make the request - operation = client.create_operator(request=request) + operation = await client.create_operator(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_process_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_process_async.py index acb791e3ab90..3b80ca9309f8 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_process_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_create_process_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_process(): ) # Make the request - operation = client.create_process(request=request) + operation = await client.create_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_analysis_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_analysis_async.py index 77a948f8042f..e367d58c21fb 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_analysis_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_analysis_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_analysis(): ) # Make the request - operation = client.delete_analysis(request=request) + operation = await client.delete_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_operator_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_operator_async.py index 56aa370c4651..d25debb75cfa 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_operator_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_operator_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_operator(): ) # Make the request - operation = client.delete_operator(request=request) + operation = await client.delete_operator(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_process_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_process_async.py index d52754ea8d30..8835eb71be56 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_process_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_delete_process_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_process(): ) # Make the request - operation = client.delete_process(request=request) + operation = await client.delete_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_analysis_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_analysis_async.py index c4afd8b7d670..7100d59e1e0e 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_analysis_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_analysis_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_analysis(): request = visionai_v1.UpdateAnalysisRequest() # Make the request - operation = client.update_analysis(request=request) + operation = await client.update_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_operator_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_operator_async.py index b7298413f01b..8762000128fc 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_operator_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_operator_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_operator(): request = visionai_v1.UpdateOperatorRequest() # Make the request - operation = client.update_operator(request=request) + operation = await client.update_operator(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_process_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_process_async.py index ddf5dcd651e7..7084e01a1a53 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_process_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_live_video_analytics_update_process_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_process(): ) # Make the request - operation = client.update_process(request=request) + operation = await client.update_process(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_cluster_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_cluster_async.py index c96a4ba02b1d..5d6f56f36a68 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_cluster_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_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. @@ -45,11 +45,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-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_event_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_event_async.py index 0f7834a9b68a..2b085149e2a1 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_event_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_event_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_event(): ) # Make the request - operation = client.create_event(request=request) + operation = await client.create_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_series_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_series_async.py index acbc8c26dbc2..a074caf2ffee 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_series_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_series_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_series(): ) # Make the request - operation = client.create_series(request=request) + operation = await client.create_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_stream_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_stream_async.py index 5d225c0b5658..6a84b1a916a0 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_stream_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_create_stream_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_stream(): ) # Make the request - operation = client.create_stream(request=request) + operation = await client.create_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_cluster_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_cluster_async.py index 7bcf4c6368fa..602a83fcd79f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_cluster_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_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-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_event_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_event_async.py index b6e4caf80026..45961e097c48 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_event_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_event_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_event(): ) # Make the request - operation = client.delete_event(request=request) + operation = await client.delete_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_series_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_series_async.py index 3d148c211da5..0a70a15fefdf 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_series_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_series_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_series(): ) # Make the request - operation = client.delete_series(request=request) + operation = await client.delete_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_stream_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_stream_async.py index 879185fca1f0..fc35151f38b6 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_stream_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_delete_stream_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_stream(): ) # Make the request - operation = client.delete_stream(request=request) + operation = await client.delete_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_get_stream_thumbnail_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_get_stream_thumbnail_async.py index 27cac9e58285..cc03dd08871b 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_get_stream_thumbnail_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_get_stream_thumbnail_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_get_stream_thumbnail(): ) # Make the request - operation = client.get_stream_thumbnail(request=request) + operation = await client.get_stream_thumbnail(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_materialize_channel_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_materialize_channel_async.py index d0162f7e6bbe..4c3c72406d5a 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_materialize_channel_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_materialize_channel_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_materialize_channel(): ) # Make the request - operation = client.materialize_channel(request=request) + operation = await client.materialize_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_cluster_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_cluster_async.py index e1579f41d0ac..a001b0148e72 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_cluster_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_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. @@ -42,11 +42,11 @@ async def sample_update_cluster(): request = visionai_v1.UpdateClusterRequest() # 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-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_event_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_event_async.py index 98007d0563a7..23f59c09256e 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_event_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_event_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_event(): request = visionai_v1.UpdateEventRequest() # Make the request - operation = client.update_event(request=request) + operation = await client.update_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_series_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_series_async.py index 7695fbf3ee7a..1c671e19f4f8 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_series_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_series_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_series(): ) # Make the request - operation = client.update_series(request=request) + operation = await client.update_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_stream_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_stream_async.py index bf50dd9e70ec..aa8a749c2c74 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_stream_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1_generated_streams_service_update_stream_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_stream(): request = visionai_v1.UpdateStreamRequest() # Make the request - operation = client.update_stream(request=request) + operation = await client.update_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_add_application_stream_input_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_add_application_stream_input_async.py index ec2bc3207384..cff1c5430124 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_add_application_stream_input_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_add_application_stream_input_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_application_stream_input(): ) # Make the request - operation = client.add_application_stream_input(request=request) + operation = await client.add_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_async.py index 3458ab463959..405fe62016f2 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_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_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_instances_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_instances_async.py index 20e259090d6d..458bd1e5d642 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_instances_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_application_instances_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_application_instances(): ) # Make the request - operation = client.create_application_instances(request=request) + operation = await client.create_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_draft_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_draft_async.py index bf276d1cdadb..5c6404c89bc7 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_draft_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_draft_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_draft(): ) # Make the request - operation = client.create_draft(request=request) + operation = await client.create_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_processor_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_processor_async.py index 48d2391991b3..265988ff2bc3 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_processor_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_create_processor_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_processor(): ) # Make the request - operation = client.create_processor(request=request) + operation = await client.create_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_async.py index 96ceeb22e990..c7545704457c 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_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_application(): ) # Make the request - operation = client.delete_application(request=request) + operation = await client.delete_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_instances_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_instances_async.py index b05916405d60..df4f11ceaf09 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_instances_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_application_instances_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_delete_application_instances(): ) # Make the request - operation = client.delete_application_instances(request=request) + operation = await client.delete_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_draft_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_draft_async.py index a9f66c0183f0..f3278cc8fe1f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_draft_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_draft_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_draft(): ) # Make the request - operation = client.delete_draft(request=request) + operation = await client.delete_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_processor_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_processor_async.py index 40339f6789b7..34b70276303a 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_processor_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_delete_processor_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_processor(): ) # Make the request - operation = client.delete_processor(request=request) + operation = await client.delete_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_deploy_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_deploy_application_async.py index 9d063e5383de..2def225b2e58 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_deploy_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_deploy_application_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_deploy_application(): ) # Make the request - operation = client.deploy_application(request=request) + operation = await client.deploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_remove_application_stream_input_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_remove_application_stream_input_async.py index 5748ed503629..4c69b77b5ffe 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_remove_application_stream_input_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_remove_application_stream_input_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_remove_application_stream_input(): ) # Make the request - operation = client.remove_application_stream_input(request=request) + operation = await client.remove_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_undeploy_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_undeploy_application_async.py index a2246be165ef..e4ef571e0b9b 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_undeploy_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_undeploy_application_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_undeploy_application(): ) # Make the request - operation = client.undeploy_application(request=request) + operation = await client.undeploy_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_async.py index 12c738d4f75c..e848d6a9f702 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_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_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_instances_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_instances_async.py index 7bed86e10c76..26752162b483 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_instances_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_instances_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_update_application_instances(): ) # Make the request - operation = client.update_application_instances(request=request) + operation = await client.update_application_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_stream_input_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_stream_input_async.py index 2f7e61621d98..edaec5fe280d 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_stream_input_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_application_stream_input_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_update_application_stream_input(): ) # Make the request - operation = client.update_application_stream_input(request=request) + operation = await client.update_application_stream_input(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_draft_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_draft_async.py index e3d7fcd9f13c..45caba9222c3 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_draft_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_draft_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_draft(): ) # Make the request - operation = client.update_draft(request=request) + operation = await client.update_draft(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_processor_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_processor_async.py index de3003ca20f1..5d34d117121d 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_processor_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_app_platform_update_processor_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_processor(): ) # Make the request - operation = client.update_processor(request=request) + operation = await client.update_processor(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_create_analysis_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_create_analysis_async.py index f4639160006f..b9b4f8d0c92a 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_create_analysis_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_create_analysis_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_analysis(): ) # Make the request - operation = client.create_analysis(request=request) + operation = await client.create_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_delete_analysis_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_delete_analysis_async.py index d7301430086a..7e7f11f96b5f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_delete_analysis_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_delete_analysis_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_analysis(): ) # Make the request - operation = client.delete_analysis(request=request) + operation = await client.delete_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_update_analysis_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_update_analysis_async.py index b8c442730bf1..23732948e970 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_update_analysis_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_live_video_analytics_update_analysis_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_analysis(): request = visionai_v1alpha1.UpdateAnalysisRequest() # Make the request - operation = client.update_analysis(request=request) + operation = await client.update_analysis(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_cluster_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_cluster_async.py index 125538cfce6d..1ac89ac68b47 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_cluster_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_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. @@ -45,11 +45,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-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_event_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_event_async.py index 8c9dd3fb71b3..8f4b689d5667 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_event_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_event_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_event(): ) # Make the request - operation = client.create_event(request=request) + operation = await client.create_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_series_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_series_async.py index 848a3b24b2be..7eaf4399b95c 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_series_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_series_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_series(): ) # Make the request - operation = client.create_series(request=request) + operation = await client.create_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_stream_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_stream_async.py index 7048ede767f7..1b685a6f99b9 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_stream_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_create_stream_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_stream(): ) # Make the request - operation = client.create_stream(request=request) + operation = await client.create_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_cluster_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_cluster_async.py index d289bdcf1c0a..dd77ec290b38 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_cluster_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_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-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_event_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_event_async.py index fe4a2e7839ba..c872ce4f285a 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_event_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_event_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_event(): ) # Make the request - operation = client.delete_event(request=request) + operation = await client.delete_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_series_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_series_async.py index 1162f00cd3ee..4bcc08984383 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_series_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_series_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_series(): ) # Make the request - operation = client.delete_series(request=request) + operation = await client.delete_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_stream_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_stream_async.py index db858031ca48..c8905e99412f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_stream_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_delete_stream_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_stream(): ) # Make the request - operation = client.delete_stream(request=request) + operation = await client.delete_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_materialize_channel_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_materialize_channel_async.py index 20683816f2bf..69b90aaffc62 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_materialize_channel_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_materialize_channel_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_materialize_channel(): ) # Make the request - operation = client.materialize_channel(request=request) + operation = await client.materialize_channel(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_cluster_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_cluster_async.py index 927ac50ccd1a..4d41171b7224 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_cluster_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_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. @@ -42,11 +42,11 @@ async def sample_update_cluster(): request = visionai_v1alpha1.UpdateClusterRequest() # 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-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_event_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_event_async.py index 06ed755196cf..4cc0032931b0 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_event_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_event_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_event(): request = visionai_v1alpha1.UpdateEventRequest() # Make the request - operation = client.update_event(request=request) + operation = await client.update_event(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_series_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_series_async.py index ed489b468048..0d2e22428e01 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_series_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_series_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_series(): ) # Make the request - operation = client.update_series(request=request) + operation = await client.update_series(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_stream_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_stream_async.py index 6be9123e463b..1848edbacf86 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_stream_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_streams_service_update_stream_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_stream(): request = visionai_v1alpha1.UpdateStreamRequest() # Make the request - operation = client.update_stream(request=request) + operation = await client.update_stream(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_create_corpus_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_create_corpus_async.py index 6b1d81c9ac80..a17833867d18 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_create_corpus_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_create_corpus_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_corpus(): ) # Make the request - operation = client.create_corpus(request=request) + operation = await client.create_corpus(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_delete_asset_async.py b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_delete_asset_async.py index fc4d181e95e1..0b3744903d2c 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_delete_asset_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/visionai_v1alpha1_generated_warehouse_delete_asset_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_asset(): ) # Make the request - operation = client.delete_asset(request=request) + operation = await client.delete_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_asset_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_asset_async.py index 1ed8efc0906a..538cc2327272 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_asset_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_asset_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_analyze_asset(): ) # Make the request - operation = client.analyze_asset(request=request) + operation = await client.analyze_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_corpus_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_corpus_async.py index 07381ccaf3f9..4cc05233d912 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_corpus_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_analyze_corpus_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_analyze_corpus(): ) # Make the request - operation = client.analyze_corpus(request=request) + operation = await client.analyze_corpus(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_collection_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_collection_async.py index 222ac45f53cd..00da353487bf 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_collection_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_collection_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_collection(): ) # Make the request - operation = client.create_collection(request=request) + operation = await client.create_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_corpus_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_corpus_async.py index 80a67fba4024..60f5b0858753 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_corpus_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_corpus_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_corpus(): ) # Make the request - operation = client.create_corpus(request=request) + operation = await client.create_corpus(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_async.py index 5fe2ec472a46..f6cf79ff4299 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_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_index(): ) # Make the request - operation = client.create_index(request=request) + operation = await client.create_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_endpoint_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_endpoint_async.py index 834f1c1c0c81..01117d074219 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_endpoint_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_create_index_endpoint_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_index_endpoint(): ) # Make the request - operation = client.create_index_endpoint(request=request) + operation = await client.create_index_endpoint(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_asset_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_asset_async.py index 87c5c1d378ec..70fec73e2326 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_asset_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_asset_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_asset(): ) # Make the request - operation = client.delete_asset(request=request) + operation = await client.delete_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_collection_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_collection_async.py index e1088c5b5f53..00225bedb4c1 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_collection_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_collection_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_collection(): ) # Make the request - operation = client.delete_collection(request=request) + operation = await client.delete_collection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_async.py index cbef92c59131..875104448d01 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_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_index(): ) # Make the request - operation = client.delete_index(request=request) + operation = await client.delete_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_endpoint_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_endpoint_async.py index 70db546c9ab6..343d8058c3d3 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_endpoint_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_delete_index_endpoint_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_index_endpoint(): ) # Make the request - operation = client.delete_index_endpoint(request=request) + operation = await client.delete_index_endpoint(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_deploy_index_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_deploy_index_async.py index 29f3d06ad034..49bcefc0f7de 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_deploy_index_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_deploy_index_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_deploy_index(): ) # Make the request - operation = client.deploy_index(request=request) + operation = await client.deploy_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_import_assets_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_import_assets_async.py index e4eea845a869..f57b5f11a46f 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_import_assets_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_import_assets_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_import_assets(): ) # Make the request - operation = client.import_assets(request=request) + operation = await client.import_assets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_index_asset_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_index_asset_async.py index 41973777510e..df3b05fa0717 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_index_asset_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_index_asset_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_index_asset(): ) # Make the request - operation = client.index_asset(request=request) + operation = await client.index_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_remove_index_asset_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_remove_index_asset_async.py index ce9bcaa4c07b..02b318d46759 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_remove_index_asset_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_remove_index_asset_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_remove_index_asset(): ) # Make the request - operation = client.remove_index_asset(request=request) + operation = await client.remove_index_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_undeploy_index_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_undeploy_index_async.py index ca18f68d17f0..e9983d6424ed 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_undeploy_index_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_undeploy_index_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_undeploy_index(): ) # Make the request - operation = client.undeploy_index(request=request) + operation = await client.undeploy_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_async.py index 49613293c6d2..72b3a5271376 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_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_index(): ) # Make the request - operation = client.update_index(request=request) + operation = await client.update_index(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_endpoint_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_endpoint_async.py index 9f30ff3a3ba5..1c171e3a660e 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_endpoint_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_update_index_endpoint_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_index_endpoint(): request = visionai_v1.UpdateIndexEndpointRequest() # Make the request - operation = client.update_index_endpoint(request=request) + operation = await client.update_index_endpoint(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_upload_asset_async.py b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_upload_asset_async.py index 2e0b4c97e865..256bc88ea417 100644 --- a/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_upload_asset_async.py +++ b/packages/google-cloud-visionai/samples/generated_samples/warehouse-visionai_v1_generated_warehouse_upload_asset_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_upload_asset(): ) # Make the request - operation = client.upload_asset(request=request) + operation = await client.upload_asset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-visionai/setup.py b/packages/google-cloud-visionai/setup.py index 729cee5e6c26..af5d376bb11b 100644 --- a/packages/google-cloud-visionai/setup.py +++ b/packages/google-cloud-visionai/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-visionai/testing/constraints-3.10.txt b/packages/google-cloud-visionai/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-visionai/testing/constraints-3.10.txt +++ b/packages/google-cloud-visionai/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-visionai/testing/constraints-3.9.txt b/packages/google-cloud-visionai/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-visionai/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-visionai/tests/unit/gapic/visionai_v1/test_app_platform.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_app_platform.py index 9b43b3536e94..4f8715fdd833 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_app_platform.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_app_platform.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1832,11 +1826,7 @@ async def test_list_applications_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_applications(request={}) - ).pages: + async for page_ in (await client.list_applications(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5500,11 +5490,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 @@ -7443,11 +7429,7 @@ async def test_list_drafts_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_drafts(request={}) - ).pages: + async for page_ in (await client.list_drafts(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9312,11 +9294,7 @@ async def test_list_processors_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_processors(request={}) - ).pages: + async for page_ in (await client.list_processors(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11171,7 +11149,7 @@ def test_list_applications_rest_required_fields( expected_params = [("$alt", "json;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_applications_rest_unset_required_fields(): @@ -11420,7 +11398,7 @@ def test_get_application_rest_required_fields( expected_params = [("$alt", "json;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_application_rest_unset_required_fields(): @@ -11626,7 +11604,7 @@ def test_create_application_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_application_rest_unset_required_fields(): @@ -11826,7 +11804,7 @@ def test_update_application_rest_required_fields( expected_params = [("$alt", "json;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_application_rest_unset_required_fields(): @@ -12028,7 +12006,7 @@ def test_delete_application_rest_required_fields( expected_params = [("$alt", "json;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_application_rest_unset_required_fields(): @@ -12220,7 +12198,7 @@ def test_deploy_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_application_rest_unset_required_fields(): @@ -12404,7 +12382,7 @@ def test_undeploy_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_application_rest_unset_required_fields(): @@ -12589,7 +12567,7 @@ def test_add_application_stream_input_rest_required_fields( expected_params = [("$alt", "json;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_application_stream_input_rest_unset_required_fields(): @@ -12774,7 +12752,7 @@ def test_remove_application_stream_input_rest_required_fields( expected_params = [("$alt", "json;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_application_stream_input_rest_unset_required_fields(): @@ -12961,7 +12939,7 @@ def test_update_application_stream_input_rest_required_fields( expected_params = [("$alt", "json;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_application_stream_input_rest_unset_required_fields(): @@ -13150,7 +13128,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(): @@ -13401,7 +13379,7 @@ def test_get_instance_rest_required_fields(request_type=platform.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(): @@ -13588,7 +13566,7 @@ def test_create_application_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_create_application_instances_rest_unset_required_fields(): @@ -13785,7 +13763,7 @@ def test_delete_application_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_delete_application_instances_rest_unset_required_fields(): @@ -13978,7 +13956,7 @@ def test_update_application_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_update_application_instances_rest_unset_required_fields(): @@ -14173,7 +14151,7 @@ def test_list_drafts_rest_required_fields(request_type=platform.ListDraftsReques expected_params = [("$alt", "json;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_drafts_rest_unset_required_fields(): @@ -14424,7 +14402,7 @@ def test_get_draft_rest_required_fields(request_type=platform.GetDraftRequest): expected_params = [("$alt", "json;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_draft_rest_unset_required_fields(): @@ -14624,7 +14602,7 @@ def test_create_draft_rest_required_fields(request_type=platform.CreateDraftRequ ("$alt", "json;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_draft_rest_unset_required_fields(): @@ -14823,7 +14801,7 @@ def test_update_draft_rest_required_fields(request_type=platform.UpdateDraftRequ expected_params = [("$alt", "json;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_draft_rest_unset_required_fields(): @@ -15015,7 +14993,7 @@ def test_delete_draft_rest_required_fields(request_type=platform.DeleteDraftRequ expected_params = [("$alt", "json;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_draft_rest_unset_required_fields(): @@ -15202,7 +15180,7 @@ def test_list_processors_rest_required_fields( expected_params = [("$alt", "json;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_processors_rest_unset_required_fields(): @@ -15456,7 +15434,7 @@ def test_list_prebuilt_processors_rest_required_fields( expected_params = [("$alt", "json;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_prebuilt_processors_rest_unset_required_fields(): @@ -15632,7 +15610,7 @@ def test_get_processor_rest_required_fields(request_type=platform.GetProcessorRe expected_params = [("$alt", "json;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_processor_rest_unset_required_fields(): @@ -15835,7 +15813,7 @@ def test_create_processor_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_processor_rest_unset_required_fields(): @@ -16034,7 +16012,7 @@ def test_update_processor_rest_required_fields( expected_params = [("$alt", "json;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_processor_rest_unset_required_fields(): @@ -16229,7 +16207,7 @@ def test_delete_processor_rest_required_fields( expected_params = [("$alt", "json;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_processor_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_health_check_service.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_health_check_service.py index ca3211677732..4004674345a3 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_health_check_service.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_health_check_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 diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_live_video_analytics.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_live_video_analytics.py index a282a532496c..a9ae32ae44e8 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_live_video_analytics.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_live_video_analytics.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1909,11 +1903,7 @@ async def test_list_public_operators_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_public_operators(request={}) - ).pages: + async for page_ in (await client.list_public_operators(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2782,11 +2772,7 @@ async def test_list_operators_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_operators(request={}) - ).pages: + async for page_ in (await client.list_operators(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4653,11 +4639,7 @@ async def test_list_analyses_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_analyses(request={}) - ).pages: + async for page_ in (await client.list_analyses(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6524,11 +6506,7 @@ async def test_list_processes_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_processes(request={}) - ).pages: + async for page_ in (await client.list_processes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8375,7 +8353,7 @@ def test_list_public_operators_rest_required_fields( expected_params = [("$alt", "json;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_public_operators_rest_unset_required_fields(): @@ -8632,7 +8610,7 @@ def test_resolve_operator_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_resolve_operator_info_rest_unset_required_fields(): @@ -8829,7 +8807,7 @@ def test_list_operators_rest_required_fields( expected_params = [("$alt", "json;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_operators_rest_unset_required_fields(): @@ -9075,7 +9053,7 @@ def test_get_operator_rest_required_fields(request_type=lva_service.GetOperatorR expected_params = [("$alt", "json;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_operator_rest_unset_required_fields(): @@ -9276,7 +9254,7 @@ def test_create_operator_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_operator_rest_unset_required_fields(): @@ -9473,7 +9451,7 @@ def test_update_operator_rest_required_fields( expected_params = [("$alt", "json;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_operator_rest_unset_required_fields(): @@ -9669,7 +9647,7 @@ def test_delete_operator_rest_required_fields( expected_params = [("$alt", "json;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_operator_rest_unset_required_fields(): @@ -9855,7 +9833,7 @@ def test_list_analyses_rest_required_fields( expected_params = [("$alt", "json;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_analyses_rest_unset_required_fields(): @@ -10106,7 +10084,7 @@ def test_get_analysis_rest_required_fields(request_type=lva_service.GetAnalysisR expected_params = [("$alt", "json;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_analysis_rest_unset_required_fields(): @@ -10308,7 +10286,7 @@ def test_create_analysis_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_analysis_rest_unset_required_fields(): @@ -10508,7 +10486,7 @@ def test_update_analysis_rest_required_fields( expected_params = [("$alt", "json;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_analysis_rest_unset_required_fields(): @@ -10706,7 +10684,7 @@ def test_delete_analysis_rest_required_fields( expected_params = [("$alt", "json;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_analysis_rest_unset_required_fields(): @@ -10893,7 +10871,7 @@ def test_list_processes_rest_required_fields( expected_params = [("$alt", "json;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_processes_rest_unset_required_fields(): @@ -11144,7 +11122,7 @@ def test_get_process_rest_required_fields(request_type=lva_service.GetProcessReq expected_params = [("$alt", "json;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_process_rest_unset_required_fields(): @@ -11346,7 +11324,7 @@ def test_create_process_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_process_rest_unset_required_fields(): @@ -11546,7 +11524,7 @@ def test_update_process_rest_required_fields( expected_params = [("$alt", "json;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_process_rest_unset_required_fields(): @@ -11744,7 +11722,7 @@ def test_delete_process_rest_required_fields( expected_params = [("$alt", "json;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_process_rest_unset_required_fields(): @@ -11926,7 +11904,7 @@ def test_batch_run_process_rest_required_fields( expected_params = [("$alt", "json;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_run_process_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streaming_service.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streaming_service.py index cd02d81e2a78..b3f3d066c2d2 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streaming_service.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streaming_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 diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streams_service.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streams_service.py index bfa51ff9b2a8..facc56e20dbd 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streams_service.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_streams_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 @@ -1845,11 +1839,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 @@ -3720,11 +3710,7 @@ async def test_list_streams_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_streams(request={}) - ).pages: + async for page_ in (await client.list_streams(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6302,11 +6288,7 @@ async def test_list_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_events(request={}) - ).pages: + async for page_ in (await client.list_events(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8171,11 +8153,7 @@ async def test_list_series_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_series(request={}) - ).pages: + async for page_ in (await client.list_series(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10014,7 +9992,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(): @@ -10264,7 +10242,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(): @@ -10463,7 +10441,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(): @@ -10660,7 +10638,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(): @@ -10856,7 +10834,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(): @@ -11040,7 +11018,7 @@ def test_list_streams_rest_required_fields( expected_params = [("$alt", "json;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_streams_rest_unset_required_fields(): @@ -11293,7 +11271,7 @@ def test_get_stream_rest_required_fields(request_type=streams_service.GetStreamR expected_params = [("$alt", "json;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_stream_rest_unset_required_fields(): @@ -11495,7 +11473,7 @@ def test_create_stream_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_stream_rest_unset_required_fields(): @@ -11695,7 +11673,7 @@ def test_update_stream_rest_required_fields( expected_params = [("$alt", "json;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_stream_rest_unset_required_fields(): @@ -11893,7 +11871,7 @@ def test_delete_stream_rest_required_fields( expected_params = [("$alt", "json;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_stream_rest_unset_required_fields(): @@ -12081,7 +12059,7 @@ def test_get_stream_thumbnail_rest_required_fields( expected_params = [("$alt", "json;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_stream_thumbnail_rest_unset_required_fields(): @@ -12277,7 +12255,7 @@ def test_generate_stream_hls_token_rest_required_fields( expected_params = [("$alt", "json;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_stream_hls_token_rest_unset_required_fields(): @@ -12466,7 +12444,7 @@ def test_list_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_events_rest_unset_required_fields(): @@ -12719,7 +12697,7 @@ def test_get_event_rest_required_fields(request_type=streams_service.GetEventReq expected_params = [("$alt", "json;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_event_rest_unset_required_fields(): @@ -12921,7 +12899,7 @@ def test_create_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_create_event_rest_unset_required_fields(): @@ -13121,7 +13099,7 @@ def test_update_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_update_event_rest_unset_required_fields(): @@ -13319,7 +13297,7 @@ def test_delete_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_delete_event_rest_unset_required_fields(): @@ -13506,7 +13484,7 @@ def test_list_series_rest_required_fields( expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -13759,7 +13737,7 @@ def test_get_series_rest_required_fields(request_type=streams_service.GetSeriesR expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -13961,7 +13939,7 @@ def test_create_series_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_series_rest_unset_required_fields(): @@ -14161,7 +14139,7 @@ def test_update_series_rest_required_fields( expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -14359,7 +14337,7 @@ def test_delete_series_rest_required_fields( expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -14563,7 +14541,7 @@ def test_materialize_channel_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_materialize_channel_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_warehouse.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_warehouse.py index 67aedc999d3f..6b1c052d87bd 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_warehouse.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1/test_warehouse.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2779,11 +2773,7 @@ async def test_list_assets_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_assets(request={}) - ).pages: + async for page_ in (await client.list_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4907,11 +4897,7 @@ async def test_view_indexed_assets_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.view_indexed_assets(request={}) - ).pages: + async for page_ in (await client.view_indexed_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6446,11 +6432,7 @@ async def test_list_indexes_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_indexes(request={}) - ).pages: + async for page_ in (await client.list_indexes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8313,11 +8295,7 @@ async def test_list_corpora_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_corpora(request={}) - ).pages: + async for page_ in (await client.list_corpora(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10774,11 +10752,7 @@ async def test_list_data_schemas_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_data_schemas(request={}) - ).pages: + async for page_ in (await client.list_data_schemas(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11981,11 +11955,7 @@ async def test_list_annotations_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_annotations(request={}) - ).pages: + async for page_ in (await client.list_annotations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15448,11 +15418,7 @@ async def test_list_search_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_search_configs(request={}) - ).pages: + async for page_ in (await client.list_search_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -17401,11 +17367,7 @@ async def test_list_search_hypernyms_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_search_hypernyms(request={}) - ).pages: + async for page_ in (await client.list_search_hypernyms(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -17840,11 +17802,7 @@ async def test_search_assets_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_assets(request={}) - ).pages: + async for page_ in (await client.search_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -18302,11 +18260,7 @@ async def test_search_index_endpoint_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_index_endpoint(request={}) - ).pages: + async for page_ in (await client.search_index_endpoint(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -19578,11 +19532,7 @@ async def test_list_index_endpoints_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_index_endpoints(request={}) - ).pages: + async for page_ in (await client.list_index_endpoints(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -22679,11 +22629,7 @@ async def test_list_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_collections(request={}) - ).pages: + async for page_ in (await client.list_collections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -23888,11 +23834,7 @@ async def test_view_collection_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.view_collection_items(request={}) - ).pages: + async for page_ in (await client.view_collection_items(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -24007,7 +23949,7 @@ def test_create_asset_rest_required_fields(request_type=warehouse.CreateAssetReq expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -24195,7 +24137,7 @@ def test_update_asset_rest_required_fields(request_type=warehouse.UpdateAssetReq expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -24377,7 +24319,7 @@ def test_get_asset_rest_required_fields(request_type=warehouse.GetAssetRequest): expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -24563,7 +24505,7 @@ def test_list_assets_rest_required_fields(request_type=warehouse.ListAssetsReque expected_params = [("$alt", "json;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_assets_rest_unset_required_fields(): @@ -24814,7 +24756,7 @@ def test_delete_asset_rest_required_fields(request_type=warehouse.DeleteAssetReq expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -24992,7 +24934,7 @@ def test_upload_asset_rest_required_fields(request_type=warehouse.UploadAssetReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_upload_asset_rest_unset_required_fields(): @@ -25118,7 +25060,7 @@ def test_generate_retrieval_url_rest_required_fields( expected_params = [("$alt", "json;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_retrieval_url_rest_unset_required_fields(): @@ -25238,7 +25180,7 @@ def test_analyze_asset_rest_required_fields(request_type=warehouse.AnalyzeAssetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_asset_rest_unset_required_fields(): @@ -25358,7 +25300,7 @@ def test_index_asset_rest_required_fields(request_type=warehouse.IndexAssetReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_index_asset_rest_unset_required_fields(): @@ -25484,7 +25426,7 @@ def test_remove_index_asset_rest_required_fields( expected_params = [("$alt", "json;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_index_asset_rest_unset_required_fields(): @@ -25616,7 +25558,7 @@ def test_view_indexed_assets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_view_indexed_assets_rest_unset_required_fields(): @@ -25872,7 +25814,7 @@ def test_create_index_rest_required_fields(request_type=warehouse.CreateIndexReq expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -26059,7 +26001,7 @@ def test_update_index_rest_required_fields(request_type=warehouse.UpdateIndexReq expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -26247,7 +26189,7 @@ def test_get_index_rest_required_fields(request_type=warehouse.GetIndexRequest): expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -26432,7 +26374,7 @@ def test_list_indexes_rest_required_fields(request_type=warehouse.ListIndexesReq expected_params = [("$alt", "json;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_indexes_rest_unset_required_fields(): @@ -26682,7 +26624,7 @@ def test_delete_index_rest_required_fields(request_type=warehouse.DeleteIndexReq expected_params = [("$alt", "json;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_index_rest_unset_required_fields(): @@ -26860,7 +26802,7 @@ def test_create_corpus_rest_required_fields(request_type=warehouse.CreateCorpusR expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -27043,7 +26985,7 @@ def test_get_corpus_rest_required_fields(request_type=warehouse.GetCorpusRequest expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -27216,7 +27158,7 @@ def test_update_corpus_rest_required_fields(request_type=warehouse.UpdateCorpusR expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -27404,7 +27346,7 @@ def test_list_corpora_rest_required_fields(request_type=warehouse.ListCorporaReq expected_params = [("$alt", "json;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_corpora_rest_unset_required_fields(): @@ -27646,7 +27588,7 @@ def test_delete_corpus_rest_required_fields(request_type=warehouse.DeleteCorpusR expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -27823,7 +27765,7 @@ def test_analyze_corpus_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_corpus_rest_unset_required_fields(): @@ -27948,7 +27890,7 @@ def test_create_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -28140,7 +28082,7 @@ def test_update_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -28324,7 +28266,7 @@ def test_get_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -28505,7 +28447,7 @@ def test_delete_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -28692,7 +28634,7 @@ def test_list_data_schemas_rest_required_fields( expected_params = [("$alt", "json;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_data_schemas_rest_unset_required_fields(): @@ -28948,7 +28890,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(): @@ -29140,7 +29082,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(): @@ -29481,7 +29423,7 @@ def test_update_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_update_annotation_rest_unset_required_fields(): @@ -29664,7 +29606,7 @@ def test_delete_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_delete_annotation_rest_unset_required_fields(): @@ -29852,7 +29794,7 @@ def test_clip_asset_rest_required_fields(request_type=warehouse.ClipAssetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_clip_asset_rest_unset_required_fields(): @@ -29983,7 +29925,7 @@ def test_generate_hls_uri_rest_required_fields( expected_params = [("$alt", "json;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_hls_uri_rest_unset_required_fields(): @@ -30103,7 +30045,7 @@ def test_import_assets_rest_required_fields(request_type=warehouse.ImportAssetsR expected_params = [("$alt", "json;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_assets_rest_unset_required_fields(): @@ -30243,7 +30185,7 @@ def test_create_search_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_search_config_rest_unset_required_fields(): @@ -30438,7 +30380,7 @@ def test_update_search_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_search_config_rest_unset_required_fields(): @@ -30624,7 +30566,7 @@ def test_get_search_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_search_config_rest_unset_required_fields(): @@ -30805,7 +30747,7 @@ def test_delete_search_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_search_config_rest_unset_required_fields(): @@ -30994,7 +30936,7 @@ def test_list_search_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_search_configs_rest_unset_required_fields(): @@ -31255,7 +31197,7 @@ def test_create_search_hypernym_rest_required_fields( expected_params = [("$alt", "json;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_search_hypernym_rest_unset_required_fields(): @@ -31450,7 +31392,7 @@ def test_update_search_hypernym_rest_required_fields( expected_params = [("$alt", "json;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_search_hypernym_rest_unset_required_fields(): @@ -31638,7 +31580,7 @@ def test_get_search_hypernym_rest_required_fields( expected_params = [("$alt", "json;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_search_hypernym_rest_unset_required_fields(): @@ -31820,7 +31762,7 @@ def test_delete_search_hypernym_rest_required_fields( expected_params = [("$alt", "json;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_search_hypernym_rest_unset_required_fields(): @@ -32010,7 +31952,7 @@ def test_list_search_hypernyms_rest_required_fields( expected_params = [("$alt", "json;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_search_hypernyms_rest_unset_required_fields(): @@ -32262,7 +32204,7 @@ def test_search_assets_rest_required_fields(request_type=warehouse.SearchAssetsR expected_params = [("$alt", "json;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_assets_rest_unset_required_fields(): @@ -32451,7 +32393,7 @@ def test_search_index_endpoint_rest_required_fields( expected_params = [("$alt", "json;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_index_endpoint_rest_unset_required_fields(): @@ -32645,7 +32587,7 @@ def test_create_index_endpoint_rest_required_fields( expected_params = [("$alt", "json;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_index_endpoint_rest_unset_required_fields(): @@ -32837,7 +32779,7 @@ def test_get_index_endpoint_rest_required_fields( expected_params = [("$alt", "json;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_index_endpoint_rest_unset_required_fields(): @@ -33029,7 +32971,7 @@ def test_list_index_endpoints_rest_required_fields( expected_params = [("$alt", "json;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_index_endpoints_rest_unset_required_fields(): @@ -33283,7 +33225,7 @@ def test_update_index_endpoint_rest_required_fields( expected_params = [("$alt", "json;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_index_endpoint_rest_unset_required_fields(): @@ -33479,7 +33421,7 @@ def test_delete_index_endpoint_rest_required_fields( expected_params = [("$alt", "json;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_index_endpoint_rest_unset_required_fields(): @@ -33657,7 +33599,7 @@ def test_deploy_index_rest_required_fields(request_type=warehouse.DeployIndexReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_index_rest_unset_required_fields(): @@ -33787,7 +33729,7 @@ def test_undeploy_index_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_index_rest_unset_required_fields(): @@ -33913,7 +33855,7 @@ def test_create_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_create_collection_rest_unset_required_fields(): @@ -34106,7 +34048,7 @@ def test_delete_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_delete_collection_rest_unset_required_fields(): @@ -34284,7 +34226,7 @@ def test_get_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_collection_rest_unset_required_fields(): @@ -34464,7 +34406,7 @@ def test_update_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_update_collection_rest_unset_required_fields(): @@ -34657,7 +34599,7 @@ def test_list_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_collections_rest_unset_required_fields(): @@ -34908,7 +34850,7 @@ def test_add_collection_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_add_collection_item_rest_unset_required_fields(): @@ -35091,7 +35033,7 @@ def test_remove_collection_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_remove_collection_item_rest_unset_required_fields(): @@ -35285,7 +35227,7 @@ def test_view_collection_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_view_collection_items_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_app_platform.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_app_platform.py index e6a11b3921ea..dcd6bdae65f6 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_app_platform.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_app_platform.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1831,11 +1825,7 @@ async def test_list_applications_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_applications(request={}) - ).pages: + async for page_ in (await client.list_applications(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5495,11 +5485,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 @@ -7434,11 +7420,7 @@ async def test_list_drafts_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_drafts(request={}) - ).pages: + async for page_ in (await client.list_drafts(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9303,11 +9285,7 @@ async def test_list_processors_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_processors(request={}) - ).pages: + async for page_ in (await client.list_processors(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11150,7 +11128,7 @@ def test_list_applications_rest_required_fields( expected_params = [("$alt", "json;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_applications_rest_unset_required_fields(): @@ -11399,7 +11377,7 @@ def test_get_application_rest_required_fields( expected_params = [("$alt", "json;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_application_rest_unset_required_fields(): @@ -11605,7 +11583,7 @@ def test_create_application_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_application_rest_unset_required_fields(): @@ -11805,7 +11783,7 @@ def test_update_application_rest_required_fields( expected_params = [("$alt", "json;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_application_rest_unset_required_fields(): @@ -12007,7 +11985,7 @@ def test_delete_application_rest_required_fields( expected_params = [("$alt", "json;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_application_rest_unset_required_fields(): @@ -12199,7 +12177,7 @@ def test_deploy_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_application_rest_unset_required_fields(): @@ -12383,7 +12361,7 @@ def test_undeploy_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_application_rest_unset_required_fields(): @@ -12568,7 +12546,7 @@ def test_add_application_stream_input_rest_required_fields( expected_params = [("$alt", "json;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_application_stream_input_rest_unset_required_fields(): @@ -12753,7 +12731,7 @@ def test_remove_application_stream_input_rest_required_fields( expected_params = [("$alt", "json;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_application_stream_input_rest_unset_required_fields(): @@ -12940,7 +12918,7 @@ def test_update_application_stream_input_rest_required_fields( expected_params = [("$alt", "json;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_application_stream_input_rest_unset_required_fields(): @@ -13129,7 +13107,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(): @@ -13380,7 +13358,7 @@ def test_get_instance_rest_required_fields(request_type=platform.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(): @@ -13567,7 +13545,7 @@ def test_create_application_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_create_application_instances_rest_unset_required_fields(): @@ -13764,7 +13742,7 @@ def test_delete_application_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_delete_application_instances_rest_unset_required_fields(): @@ -13957,7 +13935,7 @@ def test_update_application_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_update_application_instances_rest_unset_required_fields(): @@ -14152,7 +14130,7 @@ def test_list_drafts_rest_required_fields(request_type=platform.ListDraftsReques expected_params = [("$alt", "json;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_drafts_rest_unset_required_fields(): @@ -14403,7 +14381,7 @@ def test_get_draft_rest_required_fields(request_type=platform.GetDraftRequest): expected_params = [("$alt", "json;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_draft_rest_unset_required_fields(): @@ -14603,7 +14581,7 @@ def test_create_draft_rest_required_fields(request_type=platform.CreateDraftRequ ("$alt", "json;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_draft_rest_unset_required_fields(): @@ -14802,7 +14780,7 @@ def test_update_draft_rest_required_fields(request_type=platform.UpdateDraftRequ expected_params = [("$alt", "json;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_draft_rest_unset_required_fields(): @@ -14994,7 +14972,7 @@ def test_delete_draft_rest_required_fields(request_type=platform.DeleteDraftRequ expected_params = [("$alt", "json;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_draft_rest_unset_required_fields(): @@ -15181,7 +15159,7 @@ def test_list_processors_rest_required_fields( expected_params = [("$alt", "json;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_processors_rest_unset_required_fields(): @@ -15436,7 +15414,7 @@ def test_list_prebuilt_processors_rest_required_fields( expected_params = [("$alt", "json;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_prebuilt_processors_rest_unset_required_fields(): @@ -15612,7 +15590,7 @@ def test_get_processor_rest_required_fields(request_type=platform.GetProcessorRe expected_params = [("$alt", "json;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_processor_rest_unset_required_fields(): @@ -15816,7 +15794,7 @@ def test_create_processor_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_processor_rest_unset_required_fields(): @@ -16016,7 +15994,7 @@ def test_update_processor_rest_required_fields( expected_params = [("$alt", "json;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_processor_rest_unset_required_fields(): @@ -16211,7 +16189,7 @@ def test_delete_processor_rest_required_fields( expected_params = [("$alt", "json;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_processor_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_live_video_analytics.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_live_video_analytics.py index fc25270b03e2..bab2c55b8b18 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_live_video_analytics.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_live_video_analytics.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1886,11 +1880,7 @@ async def test_list_analyses_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_analyses(request={}) - ).pages: + async for page_ in (await client.list_analyses(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3353,7 +3343,7 @@ def test_list_analyses_rest_required_fields( expected_params = [("$alt", "json;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_analyses_rest_unset_required_fields(): @@ -3604,7 +3594,7 @@ def test_get_analysis_rest_required_fields(request_type=lva_service.GetAnalysisR expected_params = [("$alt", "json;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_analysis_rest_unset_required_fields(): @@ -3806,7 +3796,7 @@ def test_create_analysis_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_analysis_rest_unset_required_fields(): @@ -4006,7 +3996,7 @@ def test_update_analysis_rest_required_fields( expected_params = [("$alt", "json;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_analysis_rest_unset_required_fields(): @@ -4204,7 +4194,7 @@ def test_delete_analysis_rest_required_fields( expected_params = [("$alt", "json;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_analysis_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streaming_service.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streaming_service.py index a3bc05559e3c..8b79719af4ff 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streaming_service.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streaming_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 diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streams_service.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streams_service.py index 1665af72256b..240d5b31a7a3 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streams_service.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_streams_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 @@ -1849,11 +1843,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 @@ -3724,11 +3714,7 @@ async def test_list_streams_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_streams(request={}) - ).pages: + async for page_ in (await client.list_streams(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5944,11 +5930,7 @@ async def test_list_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_events(request={}) - ).pages: + async for page_ in (await client.list_events(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7813,11 +7795,7 @@ async def test_list_series_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_series(request={}) - ).pages: + async for page_ in (await client.list_series(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9656,7 +9634,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(): @@ -9907,7 +9885,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(): @@ -10107,7 +10085,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(): @@ -10305,7 +10283,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(): @@ -10501,7 +10479,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(): @@ -10686,7 +10664,7 @@ def test_list_streams_rest_required_fields( expected_params = [("$alt", "json;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_streams_rest_unset_required_fields(): @@ -10939,7 +10917,7 @@ def test_get_stream_rest_required_fields(request_type=streams_service.GetStreamR expected_params = [("$alt", "json;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_stream_rest_unset_required_fields(): @@ -11141,7 +11119,7 @@ def test_create_stream_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_stream_rest_unset_required_fields(): @@ -11341,7 +11319,7 @@ def test_update_stream_rest_required_fields( expected_params = [("$alt", "json;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_stream_rest_unset_required_fields(): @@ -11539,7 +11517,7 @@ def test_delete_stream_rest_required_fields( expected_params = [("$alt", "json;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_stream_rest_unset_required_fields(): @@ -11725,7 +11703,7 @@ def test_generate_stream_hls_token_rest_required_fields( expected_params = [("$alt", "json;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_stream_hls_token_rest_unset_required_fields(): @@ -11914,7 +11892,7 @@ def test_list_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_events_rest_unset_required_fields(): @@ -12167,7 +12145,7 @@ def test_get_event_rest_required_fields(request_type=streams_service.GetEventReq expected_params = [("$alt", "json;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_event_rest_unset_required_fields(): @@ -12369,7 +12347,7 @@ def test_create_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_create_event_rest_unset_required_fields(): @@ -12569,7 +12547,7 @@ def test_update_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_update_event_rest_unset_required_fields(): @@ -12767,7 +12745,7 @@ def test_delete_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_delete_event_rest_unset_required_fields(): @@ -12954,7 +12932,7 @@ def test_list_series_rest_required_fields( expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -13207,7 +13185,7 @@ def test_get_series_rest_required_fields(request_type=streams_service.GetSeriesR expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -13409,7 +13387,7 @@ def test_create_series_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_series_rest_unset_required_fields(): @@ -13609,7 +13587,7 @@ def test_update_series_rest_required_fields( expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -13807,7 +13785,7 @@ def test_delete_series_rest_required_fields( expected_params = [("$alt", "json;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_series_rest_unset_required_fields(): @@ -14011,7 +13989,7 @@ def test_materialize_channel_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_materialize_channel_rest_unset_required_fields(): diff --git a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_warehouse.py b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_warehouse.py index d6554ab4f193..64edeb8c3e19 100644 --- a/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_warehouse.py +++ b/packages/google-cloud-visionai/tests/unit/gapic/visionai_v1alpha1/test_warehouse.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2777,11 +2771,7 @@ async def test_list_assets_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_assets(request={}) - ).pages: + async for page_ in (await client.list_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4618,11 +4608,7 @@ async def test_list_corpora_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_corpora(request={}) - ).pages: + async for page_ in (await client.list_corpora(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6834,11 +6820,7 @@ async def test_list_data_schemas_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_data_schemas(request={}) - ).pages: + async for page_ in (await client.list_data_schemas(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8041,11 +8023,7 @@ async def test_list_annotations_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_annotations(request={}) - ).pages: + async for page_ in (await client.list_annotations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11261,11 +11239,7 @@ async def test_list_search_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_search_configs(request={}) - ).pages: + async for page_ in (await client.list_search_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11698,11 +11672,7 @@ async def test_search_assets_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_assets(request={}) - ).pages: + async for page_ in (await client.search_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11817,7 +11787,7 @@ def test_create_asset_rest_required_fields(request_type=warehouse.CreateAssetReq expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -12005,7 +11975,7 @@ def test_update_asset_rest_required_fields(request_type=warehouse.UpdateAssetReq expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -12187,7 +12157,7 @@ def test_get_asset_rest_required_fields(request_type=warehouse.GetAssetRequest): expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -12372,7 +12342,7 @@ def test_list_assets_rest_required_fields(request_type=warehouse.ListAssetsReque expected_params = [("$alt", "json;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_assets_rest_unset_required_fields(): @@ -12622,7 +12592,7 @@ def test_delete_asset_rest_required_fields(request_type=warehouse.DeleteAssetReq expected_params = [("$alt", "json;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_asset_rest_unset_required_fields(): @@ -12800,7 +12770,7 @@ def test_create_corpus_rest_required_fields(request_type=warehouse.CreateCorpusR expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -12984,7 +12954,7 @@ def test_get_corpus_rest_required_fields(request_type=warehouse.GetCorpusRequest expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -13158,7 +13128,7 @@ def test_update_corpus_rest_required_fields(request_type=warehouse.UpdateCorpusR expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -13345,7 +13315,7 @@ def test_list_corpora_rest_required_fields(request_type=warehouse.ListCorporaReq expected_params = [("$alt", "json;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_corpora_rest_unset_required_fields(): @@ -13587,7 +13557,7 @@ def test_delete_corpus_rest_required_fields(request_type=warehouse.DeleteCorpusR expected_params = [("$alt", "json;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_corpus_rest_unset_required_fields(): @@ -13768,7 +13738,7 @@ def test_create_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -13960,7 +13930,7 @@ def test_update_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -14144,7 +14114,7 @@ def test_get_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -14325,7 +14295,7 @@ def test_delete_data_schema_rest_required_fields( expected_params = [("$alt", "json;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_data_schema_rest_unset_required_fields(): @@ -14512,7 +14482,7 @@ def test_list_data_schemas_rest_required_fields( expected_params = [("$alt", "json;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_data_schemas_rest_unset_required_fields(): @@ -14768,7 +14738,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(): @@ -14960,7 +14930,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(): @@ -15301,7 +15271,7 @@ def test_update_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_update_annotation_rest_unset_required_fields(): @@ -15484,7 +15454,7 @@ def test_delete_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_delete_annotation_rest_unset_required_fields(): @@ -15672,7 +15642,7 @@ def test_clip_asset_rest_required_fields(request_type=warehouse.ClipAssetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_clip_asset_rest_unset_required_fields(): @@ -15803,7 +15773,7 @@ def test_generate_hls_uri_rest_required_fields( expected_params = [("$alt", "json;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_hls_uri_rest_unset_required_fields(): @@ -15951,7 +15921,7 @@ def test_create_search_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_search_config_rest_unset_required_fields(): @@ -16146,7 +16116,7 @@ def test_update_search_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_search_config_rest_unset_required_fields(): @@ -16332,7 +16302,7 @@ def test_get_search_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_search_config_rest_unset_required_fields(): @@ -16513,7 +16483,7 @@ def test_delete_search_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_search_config_rest_unset_required_fields(): @@ -16702,7 +16672,7 @@ def test_list_search_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_search_configs_rest_unset_required_fields(): @@ -16954,7 +16924,7 @@ def test_search_assets_rest_required_fields(request_type=warehouse.SearchAssetsR expected_params = [("$alt", "json;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_assets_rest_unset_required_fields(): diff --git a/packages/google-cloud-vm-migration/docs/conf.py b/packages/google-cloud-vm-migration/docs/conf.py index c8808a57497c..8d55c14e6988 100644 --- a/packages/google-cloud-vm-migration/docs/conf.py +++ b/packages/google-cloud-vm-migration/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-vm-migration" -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-vm-migration/google/cloud/vmmigration_v1/__init__.py b/packages/google-cloud-vm-migration/google/cloud/vmmigration_v1/__init__.py index 7b9a32cd8cc4..2c93ea92ac72 100644 --- a/packages/google-cloud-vm-migration/google/cloud/vmmigration_v1/__init__.py +++ b/packages/google-cloud-vm-migration/google/cloud/vmmigration_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.vm_migration import VmMigrationAsyncClient, VmMigrationClient from .types.vmmigration import ( @@ -225,28 +219,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.vmmigration_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-vm-migration/google/cloud/vmmigration_v1/services/vm_migration/async_client.py b/packages/google-cloud-vm-migration/google/cloud/vmmigration_v1/services/vm_migration/async_client.py index b00c18841768..dfeb145501ff 100644 --- a/packages/google-cloud-vm-migration/google/cloud/vmmigration_v1/services/vm_migration/async_client.py +++ b/packages/google-cloud-vm-migration/google/cloud/vmmigration_v1/services/vm_migration/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. @@ -616,11 +616,11 @@ async def sample_create_source(): ) # Make the request - operation = client.create_source(request=request) + operation = await client.create_source(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -753,11 +753,11 @@ async def sample_update_source(): ) # Make the request - operation = client.update_source(request=request) + operation = await client.update_source(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -891,11 +891,11 @@ async def sample_delete_source(): ) # Make the request - operation = client.delete_source(request=request) + operation = await client.delete_source(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1524,11 +1524,11 @@ async def sample_create_utilization_report(): ) # Make the request - operation = client.create_utilization_report(request=request) + operation = await client.create_utilization_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1672,11 +1672,11 @@ async def sample_delete_utilization_report(): ) # Make the request - operation = client.delete_utilization_report(request=request) + operation = await client.delete_utilization_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2057,11 +2057,11 @@ async def sample_create_datacenter_connector(): ) # Make the request - operation = client.create_datacenter_connector(request=request) + operation = await client.create_datacenter_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2205,11 +2205,11 @@ async def sample_delete_datacenter_connector(): ) # Make the request - operation = client.delete_datacenter_connector(request=request) + operation = await client.delete_datacenter_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2338,11 +2338,11 @@ async def sample_upgrade_appliance(): ) # Make the request - operation = client.upgrade_appliance(request=request) + operation = await client.upgrade_appliance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2445,11 +2445,11 @@ async def sample_create_migrating_vm(): ) # Make the request - operation = client.create_migrating_vm(request=request) + operation = await client.create_migrating_vm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2821,11 +2821,11 @@ async def sample_update_migrating_vm(): ) # Make the request - operation = client.update_migrating_vm(request=request) + operation = await client.update_migrating_vm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2959,11 +2959,11 @@ async def sample_delete_migrating_vm(): ) # Make the request - operation = client.delete_migrating_vm(request=request) + operation = await client.delete_migrating_vm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3094,11 +3094,11 @@ async def sample_start_migration(): ) # Make the request - operation = client.start_migration(request=request) + operation = await client.start_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3226,11 +3226,11 @@ async def sample_resume_migration(): ) # Make the request - operation = client.resume_migration(request=request) + operation = await client.resume_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3332,11 +3332,11 @@ async def sample_pause_migration(): ) # Make the request - operation = client.pause_migration(request=request) + operation = await client.pause_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3438,11 +3438,11 @@ async def sample_finalize_migration(): ) # Make the request - operation = client.finalize_migration(request=request) + operation = await client.finalize_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3565,11 +3565,11 @@ async def sample_extend_migration(): ) # Make the request - operation = client.extend_migration(request=request) + operation = await client.extend_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3672,11 +3672,11 @@ async def sample_create_clone_job(): ) # Make the request - operation = client.create_clone_job(request=request) + operation = await client.create_clone_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3821,11 +3821,11 @@ async def sample_cancel_clone_job(): ) # Make the request - operation = client.cancel_clone_job(request=request) + operation = await client.cancel_clone_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4199,11 +4199,11 @@ async def sample_create_cutover_job(): ) # Make the request - operation = client.create_cutover_job(request=request) + operation = await client.create_cutover_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4338,11 +4338,11 @@ async def sample_cancel_cutover_job(): ) # Make the request - operation = client.cancel_cutover_job(request=request) + operation = await client.cancel_cutover_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4943,11 +4943,11 @@ async def sample_create_group(): ) # Make the request - operation = client.create_group(request=request) + operation = await client.create_group(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5080,11 +5080,11 @@ async def sample_update_group(): ) # Make the request - operation = client.update_group(request=request) + operation = await client.update_group(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5218,11 +5218,11 @@ async def sample_delete_group(): ) # Make the request - operation = client.delete_group(request=request) + operation = await client.delete_group(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5349,11 +5349,11 @@ async def sample_add_group_migration(): ) # Make the request - operation = client.add_group_migration(request=request) + operation = await client.add_group_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5475,11 +5475,11 @@ async def sample_remove_group_migration(): ) # Make the request - operation = client.remove_group_migration(request=request) + operation = await client.remove_group_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5852,11 +5852,11 @@ async def sample_create_target_project(): ) # Make the request - operation = client.create_target_project(request=request) + operation = await client.create_target_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5996,11 +5996,11 @@ async def sample_update_target_project(): ) # Make the request - operation = client.update_target_project(request=request) + operation = await client.update_target_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6137,11 +6137,11 @@ async def sample_delete_target_project(): ) # Make the request - operation = client.delete_target_project(request=request) + operation = await client.delete_target_project(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6752,11 +6752,11 @@ async def sample_create_image_import(): ) # Make the request - operation = client.create_image_import(request=request) + operation = await client.create_image_import(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6895,11 +6895,11 @@ async def sample_delete_image_import(): ) # Make the request - operation = client.delete_image_import(request=request) + operation = await client.delete_image_import(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7262,11 +7262,11 @@ async def sample_cancel_image_import_job(): ) # Make the request - operation = client.cancel_image_import_job(request=request) + operation = await client.cancel_image_import_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7398,11 +7398,11 @@ async def sample_create_disk_migration_job(): ) # Make the request - operation = client.create_disk_migration_job(request=request) + operation = await client.create_disk_migration_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7790,11 +7790,11 @@ async def sample_update_disk_migration_job(): ) # Make the request - operation = client.update_disk_migration_job(request=request) + operation = await client.update_disk_migration_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7932,11 +7932,11 @@ async def sample_delete_disk_migration_job(): ) # Make the request - operation = client.delete_disk_migration_job(request=request) + operation = await client.delete_disk_migration_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8065,11 +8065,11 @@ async def sample_run_disk_migration_job(): ) # Make the request - operation = client.run_disk_migration_job(request=request) + operation = await client.run_disk_migration_job(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8192,11 +8192,11 @@ async def sample_cancel_disk_migration_job(): ) # Make the request - operation = client.cancel_disk_migration_job(request=request) + operation = await client.cancel_disk_migration_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-vm-migration/noxfile.py b/packages/google-cloud-vm-migration/noxfile.py index 5c4d7cf6a3f5..a1212ef8bccb 100644 --- a/packages/google-cloud-vm-migration/noxfile.py +++ b/packages/google-cloud-vm-migration/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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_add_group_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_add_group_migration_async.py index a5c87bfbdab1..5e893abaa963 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_add_group_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_add_group_migration_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_group_migration(): ) # Make the request - operation = client.add_group_migration(request=request) + operation = await client.add_group_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_clone_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_clone_job_async.py index e3a7b21958ba..5fbbca3b25ce 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_clone_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_clone_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_cancel_clone_job(): ) # Make the request - operation = client.cancel_clone_job(request=request) + operation = await client.cancel_clone_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_cutover_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_cutover_job_async.py index cd92444247c0..bf296ddf2f90 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_cutover_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_cutover_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_cancel_cutover_job(): ) # Make the request - operation = client.cancel_cutover_job(request=request) + operation = await client.cancel_cutover_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_disk_migration_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_disk_migration_job_async.py index 38ac9005edcd..080c0a313da2 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_disk_migration_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_disk_migration_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_cancel_disk_migration_job(): ) # Make the request - operation = client.cancel_disk_migration_job(request=request) + operation = await client.cancel_disk_migration_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_image_import_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_image_import_job_async.py index ed96d85d234d..52232e6df0e1 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_image_import_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_cancel_image_import_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_cancel_image_import_job(): ) # Make the request - operation = client.cancel_image_import_job(request=request) + operation = await client.cancel_image_import_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_clone_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_clone_job_async.py index 02c90af3e092..530142507572 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_clone_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_clone_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. @@ -45,11 +45,11 @@ async def sample_create_clone_job(): ) # Make the request - operation = client.create_clone_job(request=request) + operation = await client.create_clone_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_cutover_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_cutover_job_async.py index 90e49291e707..4b16107b347d 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_cutover_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_cutover_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. @@ -45,11 +45,11 @@ async def sample_create_cutover_job(): ) # Make the request - operation = client.create_cutover_job(request=request) + operation = await client.create_cutover_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_datacenter_connector_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_datacenter_connector_async.py index 6f519eac0151..f4b82cf4730a 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_datacenter_connector_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_datacenter_connector_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_datacenter_connector(): ) # Make the request - operation = client.create_datacenter_connector(request=request) + operation = await client.create_datacenter_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_disk_migration_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_disk_migration_job_async.py index 0dceb2ca59cf..425a46b219f1 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_disk_migration_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_disk_migration_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. @@ -54,11 +54,11 @@ async def sample_create_disk_migration_job(): ) # Make the request - operation = client.create_disk_migration_job(request=request) + operation = await client.create_disk_migration_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_group_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_group_async.py index b44b04ed3a37..cf561eddc32d 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_group_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_group_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_group(): ) # Make the request - operation = client.create_group(request=request) + operation = await client.create_group(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_image_import_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_image_import_async.py index 6b6a9b07d131..9698e022026a 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_image_import_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_image_import_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_image_import(): ) # Make the request - operation = client.create_image_import(request=request) + operation = await client.create_image_import(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_migrating_vm_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_migrating_vm_async.py index 1dcf2703cbc0..7cef1bee9c47 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_migrating_vm_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_migrating_vm_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_migrating_vm(): ) # Make the request - operation = client.create_migrating_vm(request=request) + operation = await client.create_migrating_vm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_async.py index 57868c1e08c8..6ca95f00611f 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_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_source(): ) # Make the request - operation = client.create_source(request=request) + operation = await client.create_source(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_project_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_project_async.py index c4f698b659bb..32cfd3bf7e1d 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_project_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_target_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. @@ -49,11 +49,11 @@ async def sample_create_target_project(): ) # Make the request - operation = client.create_target_project(request=request) + operation = await client.create_target_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_async.py index d489b47984c9..e05c6a7db3ef 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_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_utilization_report(): ) # Make the request - operation = client.create_utilization_report(request=request) + operation = await client.create_utilization_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_datacenter_connector_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_datacenter_connector_async.py index 02d71e7e02a1..db3be3e45ac6 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_datacenter_connector_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_datacenter_connector_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_datacenter_connector(): ) # Make the request - operation = client.delete_datacenter_connector(request=request) + operation = await client.delete_datacenter_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_disk_migration_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_disk_migration_job_async.py index 376156c9db2e..55d52e526035 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_disk_migration_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_disk_migration_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_disk_migration_job(): ) # Make the request - operation = client.delete_disk_migration_job(request=request) + operation = await client.delete_disk_migration_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_group_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_group_async.py index 039a1a63f89a..afb9c1321880 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_group_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_group_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_group(): ) # Make the request - operation = client.delete_group(request=request) + operation = await client.delete_group(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_image_import_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_image_import_async.py index 83633e766ded..bbd3159d6e39 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_image_import_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_image_import_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_image_import(): ) # Make the request - operation = client.delete_image_import(request=request) + operation = await client.delete_image_import(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_migrating_vm_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_migrating_vm_async.py index fdc31b68b6fe..9f24c9b629ba 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_migrating_vm_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_migrating_vm_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_migrating_vm(): ) # Make the request - operation = client.delete_migrating_vm(request=request) + operation = await client.delete_migrating_vm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_source_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_source_async.py index 33a546ef6a92..c6cbb109509a 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_source_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_source_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_source(): ) # Make the request - operation = client.delete_source(request=request) + operation = await client.delete_source(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_target_project_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_target_project_async.py index 8f228bd925f9..c7c1ab54d112 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_target_project_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_target_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_target_project(): ) # Make the request - operation = client.delete_target_project(request=request) + operation = await client.delete_target_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_utilization_report_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_utilization_report_async.py index d76f41fe5ef1..a8bba3724c9a 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_utilization_report_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_delete_utilization_report_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_utilization_report(): ) # Make the request - operation = client.delete_utilization_report(request=request) + operation = await client.delete_utilization_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_extend_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_extend_migration_async.py index 8b342b7ef310..9def91d75098 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_extend_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_extend_migration_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_extend_migration(): ) # Make the request - operation = client.extend_migration(request=request) + operation = await client.extend_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_finalize_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_finalize_migration_async.py index c142b02093fa..04e09486443c 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_finalize_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_finalize_migration_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_finalize_migration(): ) # Make the request - operation = client.finalize_migration(request=request) + operation = await client.finalize_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_pause_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_pause_migration_async.py index a949a508ee34..ab2d2b5d0bab 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_pause_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_pause_migration_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_migration(): ) # Make the request - operation = client.pause_migration(request=request) + operation = await client.pause_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_remove_group_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_remove_group_migration_async.py index 26170b8aa0c5..1770abef7486 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_remove_group_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_remove_group_migration_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_remove_group_migration(): ) # Make the request - operation = client.remove_group_migration(request=request) + operation = await client.remove_group_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_resume_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_resume_migration_async.py index 23f0e982aa52..68f879eb74cf 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_resume_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_resume_migration_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_migration(): ) # Make the request - operation = client.resume_migration(request=request) + operation = await client.resume_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_run_disk_migration_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_run_disk_migration_job_async.py index d4913a751f29..81e0a232d6a0 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_run_disk_migration_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_run_disk_migration_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_disk_migration_job(): ) # Make the request - operation = client.run_disk_migration_job(request=request) + operation = await client.run_disk_migration_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_start_migration_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_start_migration_async.py index be1aa2eaefef..a101f3fa28a0 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_start_migration_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_start_migration_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_migration(): ) # Make the request - operation = client.start_migration(request=request) + operation = await client.start_migration(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_disk_migration_job_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_disk_migration_job_async.py index 8677b22dd311..2d6a1c13b5e5 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_disk_migration_job_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_disk_migration_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. @@ -52,11 +52,11 @@ async def sample_update_disk_migration_job(): ) # Make the request - operation = client.update_disk_migration_job(request=request) + operation = await client.update_disk_migration_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_group_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_group_async.py index c88cdfb61dba..52a23ef63055 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_group_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_group_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_group(): request = vmmigration_v1.UpdateGroupRequest() # Make the request - operation = client.update_group(request=request) + operation = await client.update_group(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_migrating_vm_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_migrating_vm_async.py index 36fb68d59ee8..c427bbf4822f 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_migrating_vm_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_migrating_vm_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_migrating_vm(): request = vmmigration_v1.UpdateMigratingVmRequest() # Make the request - operation = client.update_migrating_vm(request=request) + operation = await client.update_migrating_vm(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_source_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_source_async.py index 272a74df27dd..e4bb49295b1a 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_source_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_source_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_source(): request = vmmigration_v1.UpdateSourceRequest() # Make the request - operation = client.update_source(request=request) + operation = await client.update_source(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_target_project_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_target_project_async.py index 45b8045097b8..5bbc5bd3ddd5 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_target_project_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_update_target_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. @@ -47,11 +47,11 @@ async def sample_update_target_project(): ) # Make the request - operation = client.update_target_project(request=request) + operation = await client.update_target_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-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_upgrade_appliance_async.py b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_upgrade_appliance_async.py index ee31226e69b4..5976e0ea130b 100644 --- a/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_upgrade_appliance_async.py +++ b/packages/google-cloud-vm-migration/samples/generated_samples/vmmigration_v1_generated_vm_migration_upgrade_appliance_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_upgrade_appliance(): ) # Make the request - operation = client.upgrade_appliance(request=request) + operation = await client.upgrade_appliance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vm-migration/setup.py b/packages/google-cloud-vm-migration/setup.py index 9e418fc50b15..f856c2220548 100644 --- a/packages/google-cloud-vm-migration/setup.py +++ b/packages/google-cloud-vm-migration/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-vm-migration/testing/constraints-3.10.txt b/packages/google-cloud-vm-migration/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-vm-migration/testing/constraints-3.10.txt +++ b/packages/google-cloud-vm-migration/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-vm-migration/testing/constraints-3.9.txt b/packages/google-cloud-vm-migration/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-vm-migration/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-vm-migration/tests/unit/gapic/vmmigration_v1/test_vm_migration.py b/packages/google-cloud-vm-migration/tests/unit/gapic/vmmigration_v1/test_vm_migration.py index 4b9f8374e92d..c7af5d993320 100644 --- a/packages/google-cloud-vm-migration/tests/unit/gapic/vmmigration_v1/test_vm_migration.py +++ b/packages/google-cloud-vm-migration/tests/unit/gapic/vmmigration_v1/test_vm_migration.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1805,11 +1799,7 @@ async def test_list_sources_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_sources(request={}) - ).pages: + async for page_ in (await client.list_sources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4041,11 +4031,7 @@ async def test_fetch_storage_inventory_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.fetch_storage_inventory(request={}) - ).pages: + async for page_ in (await client.fetch_storage_inventory(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4598,11 +4584,7 @@ async def test_list_utilization_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_utilization_reports(request={}) - ).pages: + async for page_ in (await client.list_utilization_reports(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6234,11 +6216,7 @@ async def test_list_datacenter_connectors_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_datacenter_connectors(request={}) - ).pages: + async for page_ in (await client.list_datacenter_connectors(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8548,11 +8526,7 @@ async def test_list_migrating_vms_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_migrating_vms(request={}) - ).pages: + async for page_ in (await client.list_migrating_vms(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12261,11 +12235,7 @@ async def test_list_clone_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_clone_jobs(request={}) - ).pages: + async for page_ in (await client.list_clone_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13877,11 +13847,7 @@ async def test_list_cutover_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_cutover_jobs(request={}) - ).pages: + async for page_ in (await client.list_cutover_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -14739,11 +14705,7 @@ async def test_list_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_groups(request={}) - ).pages: + async for page_ in (await client.list_groups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -17340,11 +17302,7 @@ async def test_list_target_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_target_projects(request={}) - ).pages: + async for page_ in (await client.list_target_projects(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -19318,11 +19276,7 @@ async def test_list_replication_cycles_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_replication_cycles(request={}) - ).pages: + async for page_ in (await client.list_replication_cycles(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -20225,11 +20179,7 @@ async def test_list_image_imports_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_imports(request={}) - ).pages: + async for page_ in (await client.list_image_imports(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -21829,11 +21779,7 @@ async def test_list_image_import_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_image_import_jobs(request={}) - ).pages: + async for page_ in (await client.list_image_import_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -23476,11 +23422,7 @@ async def test_list_disk_migration_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_disk_migration_jobs(request={}) - ).pages: + async for page_ in (await client.list_disk_migration_jobs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -25291,7 +25233,7 @@ def test_list_sources_rest_required_fields(request_type=vmmigration.ListSourcesR ("$alt", "json;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_sources_rest_unset_required_fields(): @@ -25542,7 +25484,7 @@ def test_get_source_rest_required_fields(request_type=vmmigration.GetSourceReque expected_params = [("$alt", "json;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_source_rest_unset_required_fields(): @@ -25741,7 +25683,7 @@ def test_create_source_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_source_rest_unset_required_fields(): @@ -25942,7 +25884,7 @@ def test_update_source_rest_required_fields( expected_params = [("$alt", "json;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_source_rest_unset_required_fields(): @@ -26137,7 +26079,7 @@ def test_delete_source_rest_required_fields( expected_params = [("$alt", "json;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_source_rest_unset_required_fields(): @@ -26314,7 +26256,7 @@ def test_fetch_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_fetch_inventory_rest_unset_required_fields(): @@ -26508,7 +26450,7 @@ def test_fetch_storage_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_fetch_storage_inventory_rest_unset_required_fields(): @@ -26798,7 +26740,7 @@ def test_list_utilization_reports_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_utilization_reports_rest_unset_required_fields(): @@ -27066,7 +27008,7 @@ def test_get_utilization_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_utilization_report_rest_unset_required_fields(): @@ -27276,7 +27218,7 @@ def test_create_utilization_report_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_utilization_report_rest_unset_required_fields(): @@ -27480,7 +27422,7 @@ def test_delete_utilization_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_delete_utilization_report_rest_unset_required_fields(): @@ -27685,7 +27627,7 @@ def test_list_datacenter_connectors_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_datacenter_connectors_rest_unset_required_fields(): @@ -27950,7 +27892,7 @@ def test_get_datacenter_connector_rest_required_fields( expected_params = [("$alt", "json;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_datacenter_connector_rest_unset_required_fields(): @@ -28160,7 +28102,7 @@ def test_create_datacenter_connector_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_datacenter_connector_rest_unset_required_fields(): @@ -28368,7 +28310,7 @@ def test_delete_datacenter_connector_rest_required_fields( expected_params = [("$alt", "json;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_datacenter_connector_rest_unset_required_fields(): @@ -28550,7 +28492,7 @@ def test_upgrade_appliance_rest_required_fields( expected_params = [("$alt", "json;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_appliance_rest_unset_required_fields(): @@ -28696,7 +28638,7 @@ def test_create_migrating_vm_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_migrating_vm_rest_unset_required_fields(): @@ -28927,7 +28869,7 @@ def test_list_migrating_vms_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_migrating_vms_rest_unset_required_fields(): @@ -29192,7 +29134,7 @@ def test_get_migrating_vm_rest_required_fields( expected_params = [("$alt", "json;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_migrating_vm_rest_unset_required_fields(): @@ -29380,7 +29322,7 @@ def test_update_migrating_vm_rest_required_fields( expected_params = [("$alt", "json;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_migrating_vm_rest_unset_required_fields(): @@ -29583,7 +29525,7 @@ def test_delete_migrating_vm_rest_required_fields( expected_params = [("$alt", "json;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_migrating_vm_rest_unset_required_fields(): @@ -29763,7 +29705,7 @@ def test_start_migration_rest_required_fields( expected_params = [("$alt", "json;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_migration_rest_unset_required_fields(): @@ -29945,7 +29887,7 @@ def test_resume_migration_rest_required_fields( expected_params = [("$alt", "json;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_migration_rest_unset_required_fields(): @@ -30067,7 +30009,7 @@ def test_pause_migration_rest_required_fields( expected_params = [("$alt", "json;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_migration_rest_unset_required_fields(): @@ -30193,7 +30135,7 @@ def test_finalize_migration_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_finalize_migration_rest_unset_required_fields(): @@ -30375,7 +30317,7 @@ def test_extend_migration_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_extend_migration_rest_unset_required_fields(): @@ -30519,7 +30461,7 @@ def test_create_clone_job_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_clone_job_rest_unset_required_fields(): @@ -30727,7 +30669,7 @@ def test_cancel_clone_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_clone_job_rest_unset_required_fields(): @@ -30927,7 +30869,7 @@ def test_list_clone_jobs_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_clone_jobs_rest_unset_required_fields(): @@ -31185,7 +31127,7 @@ def test_get_clone_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_get_clone_job_rest_unset_required_fields(): @@ -31391,7 +31333,7 @@ def test_create_cutover_job_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_cutover_job_rest_unset_required_fields(): @@ -31601,7 +31543,7 @@ def test_cancel_cutover_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_cutover_job_rest_unset_required_fields(): @@ -31803,7 +31745,7 @@ def test_list_cutover_jobs_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_cutover_jobs_rest_unset_required_fields(): @@ -32063,7 +32005,7 @@ def test_get_cutover_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_get_cutover_job_rest_unset_required_fields(): @@ -32263,7 +32205,7 @@ def test_list_groups_rest_required_fields(request_type=vmmigration.ListGroupsReq ("$alt", "json;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_groups_rest_unset_required_fields(): @@ -32514,7 +32456,7 @@ def test_get_group_rest_required_fields(request_type=vmmigration.GetGroupRequest expected_params = [("$alt", "json;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_group_rest_unset_required_fields(): @@ -32711,7 +32653,7 @@ def test_create_group_rest_required_fields(request_type=vmmigration.CreateGroupR ("$alt", "json;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_group_rest_unset_required_fields(): @@ -32906,7 +32848,7 @@ def test_update_group_rest_required_fields(request_type=vmmigration.UpdateGroupR expected_params = [("$alt", "json;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_group_rest_unset_required_fields(): @@ -33095,7 +33037,7 @@ def test_delete_group_rest_required_fields(request_type=vmmigration.DeleteGroupR expected_params = [("$alt", "json;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_group_rest_unset_required_fields(): @@ -33276,7 +33218,7 @@ def test_add_group_migration_rest_required_fields( expected_params = [("$alt", "json;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_group_migration_rest_unset_required_fields(): @@ -33459,7 +33401,7 @@ def test_remove_group_migration_rest_required_fields( expected_params = [("$alt", "json;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_group_migration_rest_unset_required_fields(): @@ -33661,7 +33603,7 @@ def test_list_target_projects_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_target_projects_rest_unset_required_fields(): @@ -33921,7 +33863,7 @@ def test_get_target_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_target_project_rest_unset_required_fields(): @@ -34128,7 +34070,7 @@ def test_create_target_project_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_target_project_rest_unset_required_fields(): @@ -34331,7 +34273,7 @@ def test_update_target_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_target_project_rest_unset_required_fields(): @@ -34529,7 +34471,7 @@ def test_delete_target_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_target_project_rest_unset_required_fields(): @@ -34734,7 +34676,7 @@ def test_list_replication_cycles_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_replication_cycles_rest_unset_required_fields(): @@ -34999,7 +34941,7 @@ def test_get_replication_cycle_rest_required_fields( expected_params = [("$alt", "json;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_replication_cycle_rest_unset_required_fields(): @@ -35192,7 +35134,7 @@ def test_list_image_imports_rest_required_fields( expected_params = [("$alt", "json;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_image_imports_rest_unset_required_fields(): @@ -35445,7 +35387,7 @@ def test_get_image_import_rest_required_fields( expected_params = [("$alt", "json;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_image_import_rest_unset_required_fields(): @@ -35651,7 +35593,7 @@ def test_create_image_import_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_image_import_rest_unset_required_fields(): @@ -35856,7 +35798,7 @@ def test_delete_image_import_rest_required_fields( expected_params = [("$alt", "json;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_image_import_rest_unset_required_fields(): @@ -36048,7 +35990,7 @@ def test_list_image_import_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_image_import_jobs_rest_unset_required_fields(): @@ -36307,7 +36249,7 @@ def test_get_image_import_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_get_image_import_job_rest_unset_required_fields(): @@ -36494,7 +36436,7 @@ def test_cancel_image_import_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_image_import_job_rest_unset_required_fields(): @@ -36701,7 +36643,7 @@ def test_create_disk_migration_job_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_disk_migration_job_rest_unset_required_fields(): @@ -36919,7 +36861,7 @@ def test_list_disk_migration_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_disk_migration_jobs_rest_unset_required_fields(): @@ -37179,7 +37121,7 @@ def test_get_disk_migration_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_get_disk_migration_job_rest_unset_required_fields(): @@ -37368,7 +37310,7 @@ def test_update_disk_migration_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_update_disk_migration_job_rest_unset_required_fields(): @@ -37572,7 +37514,7 @@ def test_delete_disk_migration_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_delete_disk_migration_job_rest_unset_required_fields(): @@ -37757,7 +37699,7 @@ def test_run_disk_migration_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_run_disk_migration_job_rest_unset_required_fields(): @@ -37942,7 +37884,7 @@ def test_cancel_disk_migration_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_disk_migration_job_rest_unset_required_fields(): diff --git a/packages/google-cloud-vmwareengine/docs/conf.py b/packages/google-cloud-vmwareengine/docs/conf.py index c0f4fd428ff4..21a749dcc12e 100644 --- a/packages/google-cloud-vmwareengine/docs/conf.py +++ b/packages/google-cloud-vmwareengine/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-vmwareengine" -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-vmwareengine/google/cloud/vmwareengine_v1/__init__.py b/packages/google-cloud-vmwareengine/google/cloud/vmwareengine_v1/__init__.py index dd5dbf338ca0..72640fb1d286 100644 --- a/packages/google-cloud-vmwareengine/google/cloud/vmwareengine_v1/__init__.py +++ b/packages/google-cloud-vmwareengine/google/cloud/vmwareengine_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.vmware_engine import VmwareEngineAsyncClient, VmwareEngineClient from .types.vmwareengine import ( @@ -163,28 +157,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.vmwareengine_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-vmwareengine/google/cloud/vmwareengine_v1/services/vmware_engine/async_client.py b/packages/google-cloud-vmwareengine/google/cloud/vmwareengine_v1/services/vmware_engine/async_client.py index 4a55c8dd9fa6..ef137d5ecfd9 100644 --- a/packages/google-cloud-vmwareengine/google/cloud/vmwareengine_v1/services/vmware_engine/async_client.py +++ b/packages/google-cloud-vmwareengine/google/cloud/vmwareengine_v1/services/vmware_engine/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. @@ -653,11 +653,11 @@ async def sample_create_private_cloud(): ) # Make the request - operation = client.create_private_cloud(request=request) + operation = await client.create_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -823,11 +823,11 @@ async def sample_update_private_cloud(): ) # Make the request - operation = client.update_private_cloud(request=request) + operation = await client.update_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -980,11 +980,11 @@ async def sample_delete_private_cloud(): ) # Make the request - operation = client.delete_private_cloud(request=request) + operation = await client.delete_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1114,11 +1114,11 @@ async def sample_undelete_private_cloud(): ) # Make the request - operation = client.undelete_private_cloud(request=request) + operation = await client.undelete_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1493,11 +1493,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) @@ -1658,11 +1658,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) @@ -1802,11 +1802,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) @@ -2572,11 +2572,11 @@ async def sample_create_external_address(): ) # Make the request - operation = client.create_external_address(request=request) + operation = await client.create_external_address(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2738,11 +2738,11 @@ async def sample_update_external_address(): ) # Make the request - operation = client.update_external_address(request=request) + operation = await client.update_external_address(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2884,11 +2884,11 @@ async def sample_delete_external_address(): ) # Make the request - operation = client.delete_external_address(request=request) + operation = await client.delete_external_address(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3272,11 +3272,11 @@ async def sample_update_subnet(): ) # Make the request - operation = client.update_subnet(request=request) + operation = await client.update_subnet(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3669,11 +3669,11 @@ async def sample_create_external_access_rule(): ) # Make the request - operation = client.create_external_access_rule(request=request) + operation = await client.create_external_access_rule(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3833,11 +3833,11 @@ async def sample_update_external_access_rule(): ) # Make the request - operation = client.update_external_access_rule(request=request) + operation = await client.update_external_access_rule(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3976,11 +3976,11 @@ async def sample_delete_external_access_rule(): ) # Make the request - operation = client.delete_external_access_rule(request=request) + operation = await client.delete_external_access_rule(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4370,11 +4370,11 @@ async def sample_create_logging_server(): ) # Make the request - operation = client.create_logging_server(request=request) + operation = await client.create_logging_server(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4537,11 +4537,11 @@ async def sample_update_logging_server(): ) # Make the request - operation = client.update_logging_server(request=request) + operation = await client.update_logging_server(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4677,11 +4677,11 @@ async def sample_delete_logging_server(): ) # Make the request - operation = client.delete_logging_server(request=request) + operation = await client.delete_logging_server(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5288,11 +5288,11 @@ async def sample_reset_nsx_credentials(): ) # Make the request - operation = client.reset_nsx_credentials(request=request) + operation = await client.reset_nsx_credentials(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5422,11 +5422,11 @@ async def sample_reset_vcenter_credentials(): ) # Make the request - operation = client.reset_vcenter_credentials(request=request) + operation = await client.reset_vcenter_credentials(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -5679,11 +5679,11 @@ async def sample_update_dns_forwarding(): ) # Make the request - operation = client.update_dns_forwarding(request=request) + operation = await client.update_dns_forwarding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6082,11 +6082,11 @@ async def sample_create_network_peering(): ) # Make the request - operation = client.create_network_peering(request=request) + operation = await client.create_network_peering(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6245,11 +6245,11 @@ async def sample_delete_network_peering(): ) # Make the request - operation = client.delete_network_peering(request=request) + operation = await client.delete_network_peering(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6391,11 +6391,11 @@ async def sample_update_network_peering(): ) # Make the request - operation = client.update_network_peering(request=request) + operation = await client.update_network_peering(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6671,11 +6671,11 @@ async def sample_create_hcx_activation_key(): ) # Make the request - operation = client.create_hcx_activation_key(request=request) + operation = await client.create_hcx_activation_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7354,11 +7354,11 @@ async def sample_create_network_policy(): ) # Make the request - operation = client.create_network_policy(request=request) + operation = await client.create_network_policy(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7534,11 +7534,11 @@ async def sample_update_network_policy(): ) # Make the request - operation = client.update_network_policy(request=request) + operation = await client.update_network_policy(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -7681,11 +7681,11 @@ async def sample_delete_network_policy(): ) # Make the request - operation = client.delete_network_policy(request=request) + operation = await client.delete_network_policy(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8094,11 +8094,11 @@ async def sample_create_management_dns_zone_binding(): ) # Make the request - operation = client.create_management_dns_zone_binding(request=request) + operation = await client.create_management_dns_zone_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8271,11 +8271,11 @@ async def sample_update_management_dns_zone_binding(): ) # Make the request - operation = client.update_management_dns_zone_binding(request=request) + operation = await client.update_management_dns_zone_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8427,11 +8427,11 @@ async def sample_delete_management_dns_zone_binding(): ) # Make the request - operation = client.delete_management_dns_zone_binding(request=request) + operation = await client.delete_management_dns_zone_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8567,11 +8567,11 @@ async def sample_repair_management_dns_zone_binding(): ) # Make the request - operation = client.repair_management_dns_zone_binding(request=request) + operation = await client.repair_management_dns_zone_binding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8713,11 +8713,11 @@ async def sample_create_vmware_engine_network(): ) # Make the request - operation = client.create_vmware_engine_network(request=request) + operation = await client.create_vmware_engine_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -8887,11 +8887,11 @@ async def sample_update_vmware_engine_network(): ) # Make the request - operation = client.update_vmware_engine_network(request=request) + operation = await client.update_vmware_engine_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -9034,11 +9034,11 @@ async def sample_delete_vmware_engine_network(): ) # Make the request - operation = client.delete_vmware_engine_network(request=request) + operation = await client.delete_vmware_engine_network(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -9437,11 +9437,11 @@ async def sample_create_private_connection(): ) # Make the request - operation = client.create_private_connection(request=request) + operation = await client.create_private_connection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -9855,11 +9855,11 @@ async def sample_update_private_connection(): ) # Make the request - operation = client.update_private_connection(request=request) + operation = await client.update_private_connection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -10000,11 +10000,11 @@ async def sample_delete_private_connection(): ) # Make the request - operation = client.delete_private_connection(request=request) + operation = await client.delete_private_connection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -10283,11 +10283,11 @@ async def sample_grant_dns_bind_permission(): ) # Make the request - operation = client.grant_dns_bind_permission(request=request) + operation = await client.grant_dns_bind_permission(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -10561,11 +10561,11 @@ async def sample_revoke_dns_bind_permission(): ) # Make the request - operation = client.revoke_dns_bind_permission(request=request) + operation = await client.revoke_dns_bind_permission(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/noxfile.py b/packages/google-cloud-vmwareengine/noxfile.py index 944adaac0a87..10bb92e1a387 100644 --- a/packages/google-cloud-vmwareengine/noxfile.py +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_cluster_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_cluster_async.py index dfdb30fab5e6..419f2e7c0a2c 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_cluster_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_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. @@ -45,11 +45,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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_access_rule_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_access_rule_async.py index b333e6ab9a8f..8607d555fa1e 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_access_rule_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_access_rule_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_external_access_rule(): ) # Make the request - operation = client.create_external_access_rule(request=request) + operation = await client.create_external_access_rule(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_address_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_address_async.py index d668209a7a40..78e9ede23858 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_address_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_external_address_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_external_address(): ) # Make the request - operation = client.create_external_address(request=request) + operation = await client.create_external_address(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_hcx_activation_key_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_hcx_activation_key_async.py index 6ac5174509f3..6d4856da9a11 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_hcx_activation_key_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_hcx_activation_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. @@ -45,11 +45,11 @@ async def sample_create_hcx_activation_key(): ) # Make the request - operation = client.create_hcx_activation_key(request=request) + operation = await client.create_hcx_activation_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_logging_server_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_logging_server_async.py index 085e6564cd9f..34bb50e8e231 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_logging_server_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_logging_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. @@ -52,11 +52,11 @@ async def sample_create_logging_server(): ) # Make the request - operation = client.create_logging_server(request=request) + operation = await client.create_logging_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_management_dns_zone_binding_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_management_dns_zone_binding_async.py index 18e29cda099c..3f85cfbbc3cd 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_management_dns_zone_binding_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_management_dns_zone_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. @@ -49,11 +49,11 @@ async def sample_create_management_dns_zone_binding(): ) # Make the request - operation = client.create_management_dns_zone_binding(request=request) + operation = await client.create_management_dns_zone_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_peering_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_peering_async.py index d3f345acd593..072256c7bac5 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_peering_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_peering_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_network_peering(): ) # Make the request - operation = client.create_network_peering(request=request) + operation = await client.create_network_peering(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_policy_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_policy_async.py index 41cd0d926c07..83ee75ceb0d5 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_policy_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_network_policy_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_network_policy(): ) # Make the request - operation = client.create_network_policy(request=request) + operation = await client.create_network_policy(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_cloud_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_cloud_async.py index edbe9102d9c8..50dcc33806ef 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_cloud_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_cloud_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_private_cloud(): ) # Make the request - operation = client.create_private_cloud(request=request) + operation = await client.create_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_connection_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_connection_async.py index a919039801c7..4cf84c732b9b 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_connection_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_private_connection_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_private_connection(): ) # Make the request - operation = client.create_private_connection(request=request) + operation = await client.create_private_connection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_vmware_engine_network_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_vmware_engine_network_async.py index 30b88ab4a645..8a3b4f52d9e8 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_vmware_engine_network_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_create_vmware_engine_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_vmware_engine_network(): ) # Make the request - operation = client.create_vmware_engine_network(request=request) + operation = await client.create_vmware_engine_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_cluster_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_cluster_async.py index 0fecb69057b6..c1431a246ef6 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_cluster_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_access_rule_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_access_rule_async.py index 37570ce31b24..39a972c736f1 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_access_rule_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_access_rule_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_external_access_rule(): ) # Make the request - operation = client.delete_external_access_rule(request=request) + operation = await client.delete_external_access_rule(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_address_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_address_async.py index 9cda203ce8df..6e5879610fd8 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_address_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_external_address_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_external_address(): ) # Make the request - operation = client.delete_external_address(request=request) + operation = await client.delete_external_address(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_logging_server_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_logging_server_async.py index 21eb83c67bfe..1d10498d917f 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_logging_server_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_logging_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. @@ -44,11 +44,11 @@ async def sample_delete_logging_server(): ) # Make the request - operation = client.delete_logging_server(request=request) + operation = await client.delete_logging_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_management_dns_zone_binding_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_management_dns_zone_binding_async.py index 15d6759d4de2..3fc2e795f212 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_management_dns_zone_binding_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_management_dns_zone_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_management_dns_zone_binding(): ) # Make the request - operation = client.delete_management_dns_zone_binding(request=request) + operation = await client.delete_management_dns_zone_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_peering_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_peering_async.py index 9eb8e29a0060..cd11373310cd 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_peering_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_peering_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_network_peering(): ) # Make the request - operation = client.delete_network_peering(request=request) + operation = await client.delete_network_peering(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_policy_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_policy_async.py index 67ec2440fbf0..56b6220ed300 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_policy_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_network_policy_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_network_policy(): ) # Make the request - operation = client.delete_network_policy(request=request) + operation = await client.delete_network_policy(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_cloud_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_cloud_async.py index a2eb0881ac13..4f3310af966a 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_cloud_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_cloud_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_private_cloud(): ) # Make the request - operation = client.delete_private_cloud(request=request) + operation = await client.delete_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_connection_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_connection_async.py index 6c4e7510b7c1..9c22d5b6c62d 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_connection_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_private_connection_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_private_connection(): ) # Make the request - operation = client.delete_private_connection(request=request) + operation = await client.delete_private_connection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_vmware_engine_network_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_vmware_engine_network_async.py index e058579c7077..a53bf0e785dd 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_vmware_engine_network_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_delete_vmware_engine_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_vmware_engine_network(): ) # Make the request - operation = client.delete_vmware_engine_network(request=request) + operation = await client.delete_vmware_engine_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_grant_dns_bind_permission_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_grant_dns_bind_permission_async.py index 01b58dcace05..bdc89c71cc4c 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_grant_dns_bind_permission_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_grant_dns_bind_permission_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_grant_dns_bind_permission(): ) # Make the request - operation = client.grant_dns_bind_permission(request=request) + operation = await client.grant_dns_bind_permission(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_repair_management_dns_zone_binding_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_repair_management_dns_zone_binding_async.py index f15490df889b..21cfb517b42b 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_repair_management_dns_zone_binding_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_repair_management_dns_zone_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_repair_management_dns_zone_binding(): ) # Make the request - operation = client.repair_management_dns_zone_binding(request=request) + operation = await client.repair_management_dns_zone_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_nsx_credentials_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_nsx_credentials_async.py index 2b1388136405..053312c39ab3 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_nsx_credentials_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_nsx_credentials_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_reset_nsx_credentials(): ) # Make the request - operation = client.reset_nsx_credentials(request=request) + operation = await client.reset_nsx_credentials(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_vcenter_credentials_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_vcenter_credentials_async.py index cc986b350599..56aab9a24388 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_vcenter_credentials_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_reset_vcenter_credentials_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_reset_vcenter_credentials(): ) # Make the request - operation = client.reset_vcenter_credentials(request=request) + operation = await client.reset_vcenter_credentials(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_revoke_dns_bind_permission_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_revoke_dns_bind_permission_async.py index 65c7d4191c37..57bf754f5f11 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_revoke_dns_bind_permission_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_revoke_dns_bind_permission_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_revoke_dns_bind_permission(): ) # Make the request - operation = client.revoke_dns_bind_permission(request=request) + operation = await client.revoke_dns_bind_permission(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_undelete_private_cloud_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_undelete_private_cloud_async.py index 5a6f77e34d93..6a9e943bf180 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_undelete_private_cloud_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_undelete_private_cloud_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_private_cloud(): ) # Make the request - operation = client.undelete_private_cloud(request=request) + operation = await client.undelete_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_cluster_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_cluster_async.py index 196d4e9ca81c..6e9948573181 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_cluster_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_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. @@ -42,11 +42,11 @@ async def sample_update_cluster(): request = vmwareengine_v1.UpdateClusterRequest() # 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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_dns_forwarding_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_dns_forwarding_async.py index 4eff4db32317..f51f435f40f1 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_dns_forwarding_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_dns_forwarding_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_update_dns_forwarding(): ) # Make the request - operation = client.update_dns_forwarding(request=request) + operation = await client.update_dns_forwarding(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_access_rule_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_access_rule_async.py index b540ac9781bd..55f068fc04d2 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_access_rule_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_access_rule_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_external_access_rule(): request = vmwareengine_v1.UpdateExternalAccessRuleRequest() # Make the request - operation = client.update_external_access_rule(request=request) + operation = await client.update_external_access_rule(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_address_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_address_async.py index a725184711cc..e0f2d7387fcf 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_address_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_external_address_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_external_address(): request = vmwareengine_v1.UpdateExternalAddressRequest() # Make the request - operation = client.update_external_address(request=request) + operation = await client.update_external_address(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_logging_server_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_logging_server_async.py index 6388a38a62b8..caa3e84939b3 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_logging_server_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_logging_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. @@ -50,11 +50,11 @@ async def sample_update_logging_server(): ) # Make the request - operation = client.update_logging_server(request=request) + operation = await client.update_logging_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_management_dns_zone_binding_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_management_dns_zone_binding_async.py index 6dd2abae3e17..8cf222644031 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_management_dns_zone_binding_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_management_dns_zone_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. @@ -47,11 +47,11 @@ async def sample_update_management_dns_zone_binding(): ) # Make the request - operation = client.update_management_dns_zone_binding(request=request) + operation = await client.update_management_dns_zone_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_peering_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_peering_async.py index 905af888979c..b26ba45f62e9 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_peering_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_peering_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_network_peering(): ) # Make the request - operation = client.update_network_peering(request=request) + operation = await client.update_network_peering(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_policy_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_policy_async.py index 29cff8ab3d27..5b3e2b8749c2 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_policy_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_network_policy_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_network_policy(): ) # Make the request - operation = client.update_network_policy(request=request) + operation = await client.update_network_policy(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_cloud_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_cloud_async.py index f85ed3a19f79..44de9a00bf7d 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_cloud_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_cloud_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_private_cloud(): ) # Make the request - operation = client.update_private_cloud(request=request) + operation = await client.update_private_cloud(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_connection_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_connection_async.py index 5552e792bce2..ce0f7eee4a1d 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_connection_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_private_connection_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_private_connection(): ) # Make the request - operation = client.update_private_connection(request=request) + operation = await client.update_private_connection(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_subnet_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_subnet_async.py index 9ceb7212cbd0..ea4e4caf176e 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_subnet_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_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. @@ -42,11 +42,11 @@ async def sample_update_subnet(): request = vmwareengine_v1.UpdateSubnetRequest() # Make the request - operation = client.update_subnet(request=request) + operation = await client.update_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-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_vmware_engine_network_async.py b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_vmware_engine_network_async.py index 06ec6b5b8b30..9205ebabc68d 100644 --- a/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_vmware_engine_network_async.py +++ b/packages/google-cloud-vmwareengine/samples/generated_samples/vmwareengine_v1_generated_vmware_engine_update_vmware_engine_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. @@ -47,11 +47,11 @@ async def sample_update_vmware_engine_network(): ) # Make the request - operation = client.update_vmware_engine_network(request=request) + operation = await client.update_vmware_engine_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-vmwareengine/setup.py b/packages/google-cloud-vmwareengine/setup.py index 1054e2887516..99e8edf6585e 100644 --- a/packages/google-cloud-vmwareengine/setup.py +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/testing/constraints-3.10.txt b/packages/google-cloud-vmwareengine/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-vmwareengine/testing/constraints-3.10.txt +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/testing/constraints-3.9.txt b/packages/google-cloud-vmwareengine/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-vmwareengine/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-vmwareengine/tests/unit/gapic/vmwareengine_v1/test_vmware_engine.py b/packages/google-cloud-vmwareengine/tests/unit/gapic/vmwareengine_v1/test_vmware_engine.py index 8006795825f8..f1cc05728d62 100644 --- a/packages/google-cloud-vmwareengine/tests/unit/gapic/vmwareengine_v1/test_vmware_engine.py +++ b/packages/google-cloud-vmwareengine/tests/unit/gapic/vmwareengine_v1/test_vmware_engine.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1850,11 +1844,7 @@ async def test_list_private_clouds_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_private_clouds(request={}) - ).pages: + async for page_ in (await client.list_private_clouds(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4152,11 +4142,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 @@ -6021,11 +6007,7 @@ async def test_list_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_nodes(request={}) - ).pages: + async for page_ in (await client.list_nodes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6925,11 +6907,7 @@ async def test_list_external_addresses_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_external_addresses(request={}) - ).pages: + async for page_ in (await client.list_external_addresses(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7478,9 +7456,7 @@ async def test_fetch_network_policy_external_addresses_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.fetch_network_policy_external_addresses(request={}) ).pages: pages.append(page_) @@ -9439,11 +9415,7 @@ async def test_list_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_subnets(request={}) - ).pages: + async for page_ in (await client.list_subnets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10674,11 +10646,7 @@ async def test_list_external_access_rules_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_external_access_rules(request={}) - ).pages: + async for page_ in (await client.list_external_access_rules(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12697,11 +12665,7 @@ async def test_list_logging_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_logging_servers(request={}) - ).pages: + async for page_ in (await client.list_logging_servers(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -14660,11 +14624,7 @@ async def test_list_node_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_node_types(request={}) - ).pages: + async for page_ in (await client.list_node_types(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -18081,11 +18041,7 @@ async def test_list_network_peerings_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_network_peerings(request={}) - ).pages: + async for page_ in (await client.list_network_peerings(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -19707,11 +19663,7 @@ async def test_list_peering_routes_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_peering_routes(request={}) - ).pages: + async for page_ in (await client.list_peering_routes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -20643,11 +20595,7 @@ async def test_list_hcx_activation_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_hcx_activation_keys(request={}) - ).pages: + async for page_ in (await client.list_hcx_activation_keys(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -21922,11 +21870,7 @@ async def test_list_network_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_network_policies(request={}) - ).pages: + async for page_ in (await client.list_network_policies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -23562,9 +23506,7 @@ async def test_list_management_dns_zone_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 + async for page_ in ( await client.list_management_dns_zone_bindings(request={}) ).pages: pages.append(page_) @@ -27383,11 +27325,7 @@ async def test_list_vmware_engine_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_vmware_engine_networks(request={}) - ).pages: + async for page_ in (await client.list_vmware_engine_networks(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -28730,11 +28668,7 @@ async def test_list_private_connections_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_private_connections(request={}) - ).pages: + async for page_ in (await client.list_private_connections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -29995,9 +29929,7 @@ async def test_list_private_connection_peering_routes_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_private_connection_peering_routes(request={}) ).pages: pages.append(page_) @@ -31187,7 +31119,7 @@ def test_list_private_clouds_rest_required_fields( expected_params = [("$alt", "json;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_private_clouds_rest_unset_required_fields(): @@ -31440,7 +31372,7 @@ def test_get_private_cloud_rest_required_fields( expected_params = [("$alt", "json;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_private_cloud_rest_unset_required_fields(): @@ -31647,7 +31579,7 @@ def test_create_private_cloud_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_private_cloud_rest_unset_required_fields(): @@ -31850,7 +31782,7 @@ def test_update_private_cloud_rest_required_fields( expected_params = [("$alt", "json;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_private_cloud_rest_unset_required_fields(): @@ -32058,7 +31990,7 @@ def test_delete_private_cloud_rest_required_fields( expected_params = [("$alt", "json;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_private_cloud_rest_unset_required_fields(): @@ -32252,7 +32184,7 @@ def test_undelete_private_cloud_rest_required_fields( expected_params = [("$alt", "json;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_private_cloud_rest_unset_required_fields(): @@ -32439,7 +32371,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(): @@ -32690,7 +32622,7 @@ def test_get_cluster_rest_required_fields(request_type=vmwareengine.GetClusterRe expected_params = [("$alt", "json;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(): @@ -32893,7 +32825,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(): @@ -33095,7 +33027,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(): @@ -33294,7 +33226,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(): @@ -33477,7 +33409,7 @@ def test_list_nodes_rest_required_fields(request_type=vmwareengine.ListNodesRequ expected_params = [("$alt", "json;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_nodes_rest_unset_required_fields(): @@ -33726,7 +33658,7 @@ def test_get_node_rest_required_fields(request_type=vmwareengine.GetNodeRequest) expected_params = [("$alt", "json;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_node_rest_unset_required_fields(): @@ -33920,7 +33852,7 @@ def test_list_external_addresses_rest_required_fields( expected_params = [("$alt", "json;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_external_addresses_rest_unset_required_fields(): @@ -34195,7 +34127,7 @@ def test_fetch_network_policy_external_addresses_rest_required_fields( expected_params = [("$alt", "json;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_network_policy_external_addresses_rest_unset_required_fields(): @@ -34463,7 +34395,7 @@ def test_get_external_address_rest_required_fields( expected_params = [("$alt", "json;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_external_address_rest_unset_required_fields(): @@ -34670,7 +34602,7 @@ def test_create_external_address_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_external_address_rest_unset_required_fields(): @@ -34875,7 +34807,7 @@ def test_update_external_address_rest_required_fields( expected_params = [("$alt", "json;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_external_address_rest_unset_required_fields(): @@ -35078,7 +35010,7 @@ def test_delete_external_address_rest_required_fields( expected_params = [("$alt", "json;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_external_address_rest_unset_required_fields(): @@ -35263,7 +35195,7 @@ def test_list_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_subnets_rest_unset_required_fields(): @@ -35512,7 +35444,7 @@ def test_get_subnet_rest_required_fields(request_type=vmwareengine.GetSubnetRequ expected_params = [("$alt", "json;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_subnet_rest_unset_required_fields(): @@ -35691,7 +35623,7 @@ def test_update_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_update_subnet_rest_unset_required_fields(): @@ -35895,7 +35827,7 @@ def test_list_external_access_rules_rest_required_fields( expected_params = [("$alt", "json;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_external_access_rules_rest_unset_required_fields(): @@ -36157,7 +36089,7 @@ def test_get_external_access_rule_rest_required_fields( expected_params = [("$alt", "json;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_external_access_rule_rest_unset_required_fields(): @@ -36367,7 +36299,7 @@ def test_create_external_access_rule_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_external_access_rule_rest_unset_required_fields(): @@ -36576,7 +36508,7 @@ def test_update_external_access_rule_rest_required_fields( expected_params = [("$alt", "json;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_external_access_rule_rest_unset_required_fields(): @@ -36783,7 +36715,7 @@ def test_delete_external_access_rule_rest_required_fields( expected_params = [("$alt", "json;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_external_access_rule_rest_unset_required_fields(): @@ -36974,7 +36906,7 @@ def test_list_logging_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_logging_servers_rest_unset_required_fields(): @@ -37233,7 +37165,7 @@ def test_get_logging_server_rest_required_fields( expected_params = [("$alt", "json;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_server_rest_unset_required_fields(): @@ -37440,7 +37372,7 @@ def test_create_logging_server_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_logging_server_rest_unset_required_fields(): @@ -37645,7 +37577,7 @@ def test_update_logging_server_rest_required_fields( expected_params = [("$alt", "json;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_server_rest_unset_required_fields(): @@ -37848,7 +37780,7 @@ def test_delete_logging_server_rest_required_fields( expected_params = [("$alt", "json;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_logging_server_rest_unset_required_fields(): @@ -38034,7 +37966,7 @@ def test_list_node_types_rest_required_fields( expected_params = [("$alt", "json;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_node_types_rest_unset_required_fields(): @@ -38283,7 +38215,7 @@ def test_get_node_type_rest_required_fields( expected_params = [("$alt", "json;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_node_type_rest_unset_required_fields(): @@ -38466,7 +38398,7 @@ def test_show_nsx_credentials_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_show_nsx_credentials_rest_unset_required_fields(): @@ -38653,7 +38585,7 @@ def test_show_vcenter_credentials_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_show_vcenter_credentials_rest_unset_required_fields(): @@ -38840,7 +38772,7 @@ def test_reset_nsx_credentials_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reset_nsx_credentials_rest_unset_required_fields(): @@ -39025,7 +38957,7 @@ def test_reset_vcenter_credentials_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_reset_vcenter_credentials_rest_unset_required_fields(): @@ -39207,7 +39139,7 @@ def test_get_dns_forwarding_rest_required_fields( expected_params = [("$alt", "json;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_dns_forwarding_rest_unset_required_fields(): @@ -39396,7 +39328,7 @@ def test_update_dns_forwarding_rest_required_fields( expected_params = [("$alt", "json;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_dns_forwarding_rest_unset_required_fields(): @@ -39595,7 +39527,7 @@ def test_get_network_peering_rest_required_fields( expected_params = [("$alt", "json;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_network_peering_rest_unset_required_fields(): @@ -39789,7 +39721,7 @@ def test_list_network_peerings_rest_required_fields( expected_params = [("$alt", "json;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_network_peerings_rest_unset_required_fields(): @@ -40069,7 +40001,7 @@ def test_create_network_peering_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_network_peering_rest_unset_required_fields(): @@ -40271,7 +40203,7 @@ def test_delete_network_peering_rest_required_fields( expected_params = [("$alt", "json;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_network_peering_rest_unset_required_fields(): @@ -40458,7 +40390,7 @@ def test_update_network_peering_rest_required_fields( expected_params = [("$alt", "json;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_network_peering_rest_unset_required_fields(): @@ -40665,7 +40597,7 @@ def test_list_peering_routes_rest_required_fields( expected_params = [("$alt", "json;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_peering_routes_rest_unset_required_fields(): @@ -40948,7 +40880,7 @@ def test_create_hcx_activation_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_create_hcx_activation_key_rest_unset_required_fields(): @@ -41160,7 +41092,7 @@ def test_list_hcx_activation_keys_rest_required_fields( expected_params = [("$alt", "json;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_hcx_activation_keys_rest_unset_required_fields(): @@ -41420,7 +41352,7 @@ def test_get_hcx_activation_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_hcx_activation_key_rest_unset_required_fields(): @@ -41604,7 +41536,7 @@ def test_get_network_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_network_policy_rest_unset_required_fields(): @@ -41798,7 +41730,7 @@ def test_list_network_policies_rest_required_fields( expected_params = [("$alt", "json;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_network_policies_rest_unset_required_fields(): @@ -42076,7 +42008,7 @@ def test_create_network_policy_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_network_policy_rest_unset_required_fields(): @@ -42279,7 +42211,7 @@ def test_update_network_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_update_network_policy_rest_unset_required_fields(): @@ -42482,7 +42414,7 @@ def test_delete_network_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_delete_network_policy_rest_unset_required_fields(): @@ -42676,7 +42608,7 @@ def test_list_management_dns_zone_bindings_rest_required_fields( expected_params = [("$alt", "json;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_management_dns_zone_bindings_rest_unset_required_fields(): @@ -42950,7 +42882,7 @@ def test_get_management_dns_zone_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_get_management_dns_zone_binding_rest_unset_required_fields(): @@ -43167,7 +43099,7 @@ def test_create_management_dns_zone_binding_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_management_dns_zone_binding_rest_unset_required_fields(): @@ -43380,7 +43312,7 @@ def test_update_management_dns_zone_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_update_management_dns_zone_binding_rest_unset_required_fields(): @@ -43591,7 +43523,7 @@ def test_delete_management_dns_zone_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_management_dns_zone_binding_rest_unset_required_fields(): @@ -43780,7 +43712,7 @@ def test_repair_management_dns_zone_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_repair_management_dns_zone_binding_rest_unset_required_fields(): @@ -43994,7 +43926,7 @@ def test_create_vmware_engine_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_vmware_engine_network_rest_unset_required_fields(): @@ -44201,7 +44133,7 @@ def test_update_vmware_engine_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_update_vmware_engine_network_rest_unset_required_fields(): @@ -44413,7 +44345,7 @@ def test_delete_vmware_engine_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_vmware_engine_network_rest_unset_required_fields(): @@ -44604,7 +44536,7 @@ def test_get_vmware_engine_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_vmware_engine_network_rest_unset_required_fields(): @@ -44800,7 +44732,7 @@ def test_list_vmware_engine_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_vmware_engine_networks_rest_unset_required_fields(): @@ -45083,7 +45015,7 @@ def test_create_private_connection_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_private_connection_rest_unset_required_fields(): @@ -45286,7 +45218,7 @@ def test_get_private_connection_rest_required_fields( expected_params = [("$alt", "json;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_private_connection_rest_unset_required_fields(): @@ -45480,7 +45412,7 @@ def test_list_private_connections_rest_required_fields( expected_params = [("$alt", "json;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_private_connections_rest_unset_required_fields(): @@ -45742,7 +45674,7 @@ def test_update_private_connection_rest_required_fields( expected_params = [("$alt", "json;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_private_connection_rest_unset_required_fields(): @@ -45949,7 +45881,7 @@ def test_delete_private_connection_rest_required_fields( expected_params = [("$alt", "json;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_private_connection_rest_unset_required_fields(): @@ -46145,7 +46077,7 @@ def test_list_private_connection_peering_routes_rest_required_fields( expected_params = [("$alt", "json;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_private_connection_peering_routes_rest_unset_required_fields(): @@ -46414,7 +46346,7 @@ def test_grant_dns_bind_permission_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_grant_dns_bind_permission_rest_unset_required_fields(): @@ -46607,7 +46539,7 @@ def test_get_dns_bind_permission_rest_required_fields( expected_params = [("$alt", "json;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_dns_bind_permission_rest_unset_required_fields(): @@ -46794,7 +46726,7 @@ def test_revoke_dns_bind_permission_rest_required_fields( expected_params = [("$alt", "json;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_dns_bind_permission_rest_unset_required_fields(): diff --git a/packages/google-cloud-vpc-access/docs/conf.py b/packages/google-cloud-vpc-access/docs/conf.py index db80761dbbbf..b61a80247160 100644 --- a/packages/google-cloud-vpc-access/docs/conf.py +++ b/packages/google-cloud-vpc-access/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-vpc-access" -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-vpc-access/google/cloud/vpcaccess_v1/__init__.py b/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/__init__.py index 8f0480e4c370..e85a2c101470 100644 --- a/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/__init__.py +++ b/packages/google-cloud-vpc-access/google/cloud/vpcaccess_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.vpc_access_service import ( VpcAccessServiceAsyncClient, @@ -52,28 +46,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.vpcaccess_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-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py b/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py index 329c80e55095..b5f6b5a96dd1 100644 --- a/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py +++ b/packages/google-cloud-vpc-access/google/cloud/vpcaccess_v1/services/vpc_access_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. @@ -340,11 +340,11 @@ async def sample_create_connector(): ) # Make the request - operation = client.create_connector(request=request) + operation = await client.create_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -722,11 +722,11 @@ async def sample_delete_connector(): ) # Make the request - operation = client.delete_connector(request=request) + operation = await client.delete_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vpc-access/noxfile.py b/packages/google-cloud-vpc-access/noxfile.py index 057e6f09cded..4e38c04b9eb9 100644 --- a/packages/google-cloud-vpc-access/noxfile.py +++ b/packages/google-cloud-vpc-access/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-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_create_connector_async.py b/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_create_connector_async.py index ff1ac6cc17f1..117aedad7e9b 100644 --- a/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_create_connector_async.py +++ b/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_create_connector_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_connector(): ) # Make the request - operation = client.create_connector(request=request) + operation = await client.create_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_delete_connector_async.py b/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_delete_connector_async.py index ff58c7dfd99f..612495f6876c 100644 --- a/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_delete_connector_async.py +++ b/packages/google-cloud-vpc-access/samples/generated_samples/vpcaccess_v1_generated_vpc_access_service_delete_connector_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_connector(): ) # Make the request - operation = client.delete_connector(request=request) + operation = await client.delete_connector(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-vpc-access/setup.py b/packages/google-cloud-vpc-access/setup.py index a3eaa3fde63e..b5f95d00f4cb 100644 --- a/packages/google-cloud-vpc-access/setup.py +++ b/packages/google-cloud-vpc-access/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-vpc-access/testing/constraints-3.10.txt b/packages/google-cloud-vpc-access/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-vpc-access/testing/constraints-3.10.txt +++ b/packages/google-cloud-vpc-access/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-vpc-access/testing/constraints-3.9.txt b/packages/google-cloud-vpc-access/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-vpc-access/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-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py b/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py index 1d4f35e9edbf..b976b23114cb 100644 --- a/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_service.py +++ b/packages/google-cloud-vpc-access/tests/unit/gapic/vpcaccess_v1/test_vpc_access_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 @@ -2569,11 +2563,7 @@ async def test_list_connectors_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_connectors(request={}) - ).pages: + async for page_ in (await client.list_connectors(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3035,7 +3025,7 @@ def test_create_connector_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_connector_rest_unset_required_fields(): @@ -3223,7 +3213,7 @@ def test_get_connector_rest_required_fields( expected_params = [("$alt", "json;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_connector_rest_unset_required_fields(): @@ -3409,7 +3399,7 @@ def test_list_connectors_rest_required_fields( expected_params = [("$alt", "json;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_connectors_rest_unset_required_fields(): @@ -3658,7 +3648,7 @@ def test_delete_connector_rest_required_fields( expected_params = [("$alt", "json;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_connector_rest_unset_required_fields(): diff --git a/packages/google-cloud-webrisk/docs/conf.py b/packages/google-cloud-webrisk/docs/conf.py index ec7928818db7..3cc1fdf418a0 100644 --- a/packages/google-cloud-webrisk/docs/conf.py +++ b/packages/google-cloud-webrisk/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-webrisk" -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-webrisk/google/cloud/webrisk_v1/__init__.py b/packages/google-cloud-webrisk/google/cloud/webrisk_v1/__init__.py index dd81f2177d45..389b932e51ca 100644 --- a/packages/google-cloud-webrisk/google/cloud/webrisk_v1/__init__.py +++ b/packages/google-cloud-webrisk/google/cloud/webrisk_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.web_risk_service import WebRiskServiceAsyncClient, WebRiskServiceClient from .types.webrisk import ( @@ -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.webrisk_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-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py b/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py index 44aa5ed58727..66316f540f6d 100644 --- a/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_service/async_client.py +++ b/packages/google-cloud-webrisk/google/cloud/webrisk_v1/services/web_risk_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. @@ -863,11 +863,11 @@ async def sample_submit_uri(): ) # Make the request - operation = client.submit_uri(request=request) + operation = await client.submit_uri(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/__init__.py b/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/__init__.py index fc36dea42a88..2f2e2656a942 100644 --- a/packages/google-cloud-webrisk/google/cloud/webrisk_v1beta1/__init__.py +++ b/packages/google-cloud-webrisk/google/cloud/webrisk_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.web_risk_service_v1_beta1 import ( WebRiskServiceV1Beta1AsyncClient, @@ -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.webrisk_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-webrisk/noxfile.py b/packages/google-cloud-webrisk/noxfile.py index 53677aef7333..5621cd1f9298 100644 --- a/packages/google-cloud-webrisk/noxfile.py +++ b/packages/google-cloud-webrisk/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-webrisk/samples/generated_samples/webrisk_v1_generated_web_risk_service_submit_uri_async.py b/packages/google-cloud-webrisk/samples/generated_samples/webrisk_v1_generated_web_risk_service_submit_uri_async.py index 75867fb90309..9a2a1b6e6dc0 100644 --- a/packages/google-cloud-webrisk/samples/generated_samples/webrisk_v1_generated_web_risk_service_submit_uri_async.py +++ b/packages/google-cloud-webrisk/samples/generated_samples/webrisk_v1_generated_web_risk_service_submit_uri_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_submit_uri(): ) # Make the request - operation = client.submit_uri(request=request) + operation = await client.submit_uri(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-webrisk/setup.py b/packages/google-cloud-webrisk/setup.py index 36e753647115..378d5ad9cf1a 100644 --- a/packages/google-cloud-webrisk/setup.py +++ b/packages/google-cloud-webrisk/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-webrisk/testing/constraints-3.10.txt b/packages/google-cloud-webrisk/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-webrisk/testing/constraints-3.10.txt +++ b/packages/google-cloud-webrisk/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-webrisk/testing/constraints-3.9.txt b/packages/google-cloud-webrisk/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-webrisk/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-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py b/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py index bd6bf602ab55..6cb68d712d28 100644 --- a/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_service.py +++ b/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1/test_web_risk_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 @@ -2965,7 +2959,7 @@ def test_compute_threat_list_diff_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_compute_threat_list_diff_rest_unset_required_fields(): @@ -3177,7 +3171,7 @@ def test_search_uris_rest_required_fields(request_type=webrisk.SearchUrisRequest ("$alt", "json;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_uris_rest_unset_required_fields(): @@ -3368,7 +3362,7 @@ def test_search_hashes_rest_required_fields(request_type=webrisk.SearchHashesReq expected_params = [("$alt", "json;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_hashes_rest_unset_required_fields(): @@ -3557,7 +3551,7 @@ def test_create_submission_rest_required_fields( expected_params = [("$alt", "json;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_submission_rest_unset_required_fields(): @@ -3743,7 +3737,7 @@ def test_submit_uri_rest_required_fields(request_type=webrisk.SubmitUriRequest): expected_params = [("$alt", "json;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_uri_rest_unset_required_fields(): diff --git a/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1beta1/test_web_risk_service_v1_beta1.py b/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1beta1/test_web_risk_service_v1_beta1.py index 0230100e9e22..9d7b059f5a9d 100644 --- a/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1beta1/test_web_risk_service_v1_beta1.py +++ b/packages/google-cloud-webrisk/tests/unit/gapic/webrisk_v1beta1/test_web_risk_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 @@ -2336,7 +2330,7 @@ def test_compute_threat_list_diff_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_compute_threat_list_diff_rest_unset_required_fields(): @@ -2548,7 +2542,7 @@ def test_search_uris_rest_required_fields(request_type=webrisk.SearchUrisRequest ("$alt", "json;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_uris_rest_unset_required_fields(): @@ -2739,7 +2733,7 @@ def test_search_hashes_rest_required_fields(request_type=webrisk.SearchHashesReq expected_params = [("$alt", "json;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_hashes_rest_unset_required_fields(): diff --git a/packages/google-cloud-websecurityscanner/docs/conf.py b/packages/google-cloud-websecurityscanner/docs/conf.py index a05ad3ba6a82..637d47d13b0b 100644 --- a/packages/google-cloud-websecurityscanner/docs/conf.py +++ b/packages/google-cloud-websecurityscanner/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-websecurityscanner" -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-websecurityscanner/google/cloud/websecurityscanner_v1/__init__.py b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/__init__.py index 1d075b66548b..3f09af7f9c4b 100644 --- a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/__init__.py +++ b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_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.web_security_scanner import ( WebSecurityScannerAsyncClient, @@ -81,28 +75,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.websecurityscanner_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-websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py index 7ab6fca68d5a..cbbd5ed1895a 100644 --- a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py +++ b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_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.web_security_scanner import ( WebSecurityScannerAsyncClient, @@ -75,28 +69,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.websecurityscanner_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-websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py index b38717d704eb..a205a1727d67 100644 --- a/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py +++ b/packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_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.web_security_scanner import ( WebSecurityScannerAsyncClient, @@ -79,28 +73,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.websecurityscanner_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-websecurityscanner/noxfile.py b/packages/google-cloud-websecurityscanner/noxfile.py index 784e71d26f0c..58e946e758b1 100644 --- a/packages/google-cloud-websecurityscanner/noxfile.py +++ b/packages/google-cloud-websecurityscanner/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-websecurityscanner/setup.py b/packages/google-cloud-websecurityscanner/setup.py index 259e1909f7a6..8e9a5c5290e1 100644 --- a/packages/google-cloud-websecurityscanner/setup.py +++ b/packages/google-cloud-websecurityscanner/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-websecurityscanner/testing/constraints-3.10.txt b/packages/google-cloud-websecurityscanner/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-websecurityscanner/testing/constraints-3.10.txt +++ b/packages/google-cloud-websecurityscanner/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-websecurityscanner/testing/constraints-3.9.txt b/packages/google-cloud-websecurityscanner/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-websecurityscanner/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-websecurityscanner/tests/unit/gapic/websecurityscanner_v1/test_web_security_scanner.py b/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1/test_web_security_scanner.py index a3b9b0af3ffa..dfee31d531f1 100644 --- a/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1/test_web_security_scanner.py +++ b/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1/test_web_security_scanner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2651,11 +2645,7 @@ async def test_list_scan_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_scan_configs(request={}) - ).pages: + async for page_ in (await client.list_scan_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3914,11 +3904,7 @@ async def test_list_scan_runs_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_scan_runs(request={}) - ).pages: + async for page_ in (await client.list_scan_runs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4636,11 +4622,7 @@ async def test_list_crawled_urls_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_crawled_urls(request={}) - ).pages: + async for page_ in (await client.list_crawled_urls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5355,11 +5337,7 @@ async def test_list_findings_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_findings(request={}) - ).pages: + async for page_ in (await client.list_findings(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-websecurityscanner/tests/unit/gapic/websecurityscanner_v1alpha/test_web_security_scanner.py b/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1alpha/test_web_security_scanner.py index 8b0055a33821..5db630a7ef3f 100644 --- a/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1alpha/test_web_security_scanner.py +++ b/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1alpha/test_web_security_scanner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2962,11 +2956,7 @@ async def test_list_scan_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_scan_configs(request={}) - ).pages: + async for page_ in (await client.list_scan_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4545,11 +4535,7 @@ async def test_list_scan_runs_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_scan_runs(request={}) - ).pages: + async for page_ in (await client.list_scan_runs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5433,11 +5419,7 @@ async def test_list_crawled_urls_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_crawled_urls(request={}) - ).pages: + async for page_ in (await client.list_crawled_urls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6320,11 +6302,7 @@ async def test_list_findings_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_findings(request={}) - ).pages: + async for page_ in (await client.list_findings(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6780,7 +6758,7 @@ def test_create_scan_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_create_scan_config_rest_unset_required_fields(): @@ -6968,7 +6946,7 @@ def test_delete_scan_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_scan_config_rest_unset_required_fields(): @@ -7143,7 +7121,7 @@ def test_get_scan_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_scan_config_rest_unset_required_fields(): @@ -7329,7 +7307,7 @@ def test_list_scan_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_scan_configs_rest_unset_required_fields(): @@ -7579,7 +7557,7 @@ def test_update_scan_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_scan_config_rest_unset_required_fields(): @@ -7770,7 +7748,7 @@ def test_start_scan_run_rest_required_fields( expected_params = [("$alt", "json;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_scan_run_rest_unset_required_fields(): @@ -7947,7 +7925,7 @@ def test_get_scan_run_rest_required_fields( expected_params = [("$alt", "json;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_scan_run_rest_unset_required_fields(): @@ -8134,7 +8112,7 @@ def test_list_scan_runs_rest_required_fields( expected_params = [("$alt", "json;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_scan_runs_rest_unset_required_fields(): @@ -8384,7 +8362,7 @@ def test_stop_scan_run_rest_required_fields( expected_params = [("$alt", "json;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_scan_run_rest_unset_required_fields(): @@ -8573,7 +8551,7 @@ def test_list_crawled_urls_rest_required_fields( expected_params = [("$alt", "json;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_crawled_urls_rest_unset_required_fields(): @@ -8826,7 +8804,7 @@ def test_get_finding_rest_required_fields( expected_params = [("$alt", "json;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_finding_rest_unset_required_fields(): @@ -9027,7 +9005,7 @@ def test_list_findings_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_findings_rest_unset_required_fields(): @@ -9295,7 +9273,7 @@ def test_list_finding_type_stats_rest_required_fields( expected_params = [("$alt", "json;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_finding_type_stats_rest_unset_required_fields(): diff --git a/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1beta/test_web_security_scanner.py b/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1beta/test_web_security_scanner.py index bcec86bbf857..fdecb61d068e 100644 --- a/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1beta/test_web_security_scanner.py +++ b/packages/google-cloud-websecurityscanner/tests/unit/gapic/websecurityscanner_v1beta/test_web_security_scanner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2993,11 +2987,7 @@ async def test_list_scan_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_scan_configs(request={}) - ).pages: + async for page_ in (await client.list_scan_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4590,11 +4580,7 @@ async def test_list_scan_runs_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_scan_runs(request={}) - ).pages: + async for page_ in (await client.list_scan_runs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5478,11 +5464,7 @@ async def test_list_crawled_urls_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_crawled_urls(request={}) - ).pages: + async for page_ in (await client.list_crawled_urls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6365,11 +6347,7 @@ async def test_list_findings_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_findings(request={}) - ).pages: + async for page_ in (await client.list_findings(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6825,7 +6803,7 @@ def test_create_scan_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_create_scan_config_rest_unset_required_fields(): @@ -7013,7 +6991,7 @@ def test_delete_scan_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_scan_config_rest_unset_required_fields(): @@ -7188,7 +7166,7 @@ def test_get_scan_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_scan_config_rest_unset_required_fields(): @@ -7374,7 +7352,7 @@ def test_list_scan_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_scan_configs_rest_unset_required_fields(): @@ -7624,7 +7602,7 @@ def test_update_scan_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_scan_config_rest_unset_required_fields(): @@ -7815,7 +7793,7 @@ def test_start_scan_run_rest_required_fields( expected_params = [("$alt", "json;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_scan_run_rest_unset_required_fields(): @@ -7992,7 +7970,7 @@ def test_get_scan_run_rest_required_fields( expected_params = [("$alt", "json;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_scan_run_rest_unset_required_fields(): @@ -8179,7 +8157,7 @@ def test_list_scan_runs_rest_required_fields( expected_params = [("$alt", "json;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_scan_runs_rest_unset_required_fields(): @@ -8429,7 +8407,7 @@ def test_stop_scan_run_rest_required_fields( expected_params = [("$alt", "json;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_scan_run_rest_unset_required_fields(): @@ -8618,7 +8596,7 @@ def test_list_crawled_urls_rest_required_fields( expected_params = [("$alt", "json;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_crawled_urls_rest_unset_required_fields(): @@ -8871,7 +8849,7 @@ def test_get_finding_rest_required_fields( expected_params = [("$alt", "json;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_finding_rest_unset_required_fields(): @@ -9072,7 +9050,7 @@ def test_list_findings_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_findings_rest_unset_required_fields(): @@ -9340,7 +9318,7 @@ def test_list_finding_type_stats_rest_required_fields( expected_params = [("$alt", "json;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_finding_type_stats_rest_unset_required_fields(): diff --git a/packages/google-cloud-workflows/docs/conf.py b/packages/google-cloud-workflows/docs/conf.py index 5839fafad1f6..a236426b353e 100644 --- a/packages/google-cloud-workflows/docs/conf.py +++ b/packages/google-cloud-workflows/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-workflows" -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-workflows/google/cloud/workflows/executions_v1/__init__.py b/packages/google-cloud-workflows/google/cloud/workflows/executions_v1/__init__.py index d5f94eaa90e2..378371c379a0 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows/executions_v1/__init__.py +++ b/packages/google-cloud-workflows/google/cloud/workflows/executions_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.executions import ExecutionsAsyncClient, ExecutionsClient from .types.executions import ( @@ -49,28 +43,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.workflows.executions_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-workflows/google/cloud/workflows/executions_v1beta/__init__.py b/packages/google-cloud-workflows/google/cloud/workflows/executions_v1beta/__init__.py index 5c04a2bba1f7..33352d0d3b15 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows/executions_v1beta/__init__.py +++ b/packages/google-cloud-workflows/google/cloud/workflows/executions_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.executions import ExecutionsAsyncClient, ExecutionsClient from .types.executions import ( @@ -49,28 +43,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.workflows.executions_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-workflows/google/cloud/workflows_v1/__init__.py b/packages/google-cloud-workflows/google/cloud/workflows_v1/__init__.py index a85e1ca468b1..76f0ccfb42b4 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1/__init__.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_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.workflows import WorkflowsAsyncClient, WorkflowsClient from .types.workflows import ( @@ -53,28 +47,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.workflows_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-workflows/google/cloud/workflows_v1/services/workflows/async_client.py b/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/async_client.py index 65f8615b5a8f..e9a61c97d9ef 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/async_client.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_v1/services/workflows/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. @@ -591,11 +591,11 @@ async def sample_create_workflow(): ) # Make the request - operation = client.create_workflow(request=request) + operation = await client.create_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -746,11 +746,11 @@ async def sample_delete_workflow(): ) # Make the request - operation = client.delete_workflow(request=request) + operation = await client.delete_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -890,11 +890,11 @@ async def sample_update_workflow(): ) # Make the request - operation = client.update_workflow(request=request) + operation = await client.update_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/google/cloud/workflows_v1/types/workflows.py b/packages/google-cloud-workflows/google/cloud/workflows_v1/types/workflows.py index f0a1a2f7d32c..88e29d9faff3 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1/types/workflows.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_v1/types/workflows.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -616,8 +616,9 @@ class ListWorkflowRevisionsRequest(proto.Message): The maximum number of revisions to return per page. If a value is not specified, a default value of 20 is used. The maximum permitted value - is 100. Values greater than 100 are coerced down - to 100. + is + 100. Values greater than 100 are coerced down to + 100. page_token (str): The page token, received from a previous ListWorkflowRevisions call. Provide this to diff --git a/packages/google-cloud-workflows/google/cloud/workflows_v1beta/__init__.py b/packages/google-cloud-workflows/google/cloud/workflows_v1beta/__init__.py index a371ef28058a..b9da95f8c9fa 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1beta/__init__.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_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.workflows import WorkflowsAsyncClient, WorkflowsClient from .types.workflows import ( @@ -50,28 +44,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.workflows_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-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py b/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py index 966abbcccdbd..836cfb3caccd 100644 --- a/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/async_client.py +++ b/packages/google-cloud-workflows/google/cloud/workflows_v1beta/services/workflows/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_create_workflow(): ) # Make the request - operation = client.create_workflow(request=request) + operation = await client.create_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -739,11 +739,11 @@ async def sample_delete_workflow(): ) # Make the request - operation = client.delete_workflow(request=request) + operation = await client.delete_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -883,11 +883,11 @@ async def sample_update_workflow(): ) # Make the request - operation = client.update_workflow(request=request) + operation = await client.update_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/noxfile.py b/packages/google-cloud-workflows/noxfile.py index b88d9a4bef6e..b5a8cef96ab1 100644 --- a/packages/google-cloud-workflows/noxfile.py +++ b/packages/google-cloud-workflows/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-workflows/samples/generated_samples/workflows_v1_generated_workflows_create_workflow_async.py b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_create_workflow_async.py index fde0fc5bdce0..e98bc8204b7b 100644 --- a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_create_workflow_async.py +++ b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_create_workflow_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_workflow(): ) # Make the request - operation = client.create_workflow(request=request) + operation = await client.create_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_delete_workflow_async.py b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_delete_workflow_async.py index 6505478c502e..6ff4f5f31227 100644 --- a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_delete_workflow_async.py +++ b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_delete_workflow_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_workflow(): ) # Make the request - operation = client.delete_workflow(request=request) + operation = await client.delete_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_update_workflow_async.py b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_update_workflow_async.py index 97243627cab7..856eef665ff3 100644 --- a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_update_workflow_async.py +++ b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1_generated_workflows_update_workflow_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_workflow(): ) # Make the request - operation = client.update_workflow(request=request) + operation = await client.update_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_create_workflow_async.py b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_create_workflow_async.py index 952f50cca5a2..472f61c56aff 100644 --- a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_create_workflow_async.py +++ b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_create_workflow_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_workflow(): ) # Make the request - operation = client.create_workflow(request=request) + operation = await client.create_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_delete_workflow_async.py b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_delete_workflow_async.py index 418fdb11f141..732d3d24df21 100644 --- a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_delete_workflow_async.py +++ b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_delete_workflow_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_workflow(): ) # Make the request - operation = client.delete_workflow(request=request) + operation = await client.delete_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_update_workflow_async.py b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_update_workflow_async.py index 8a7729147609..b845573c5098 100644 --- a/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_update_workflow_async.py +++ b/packages/google-cloud-workflows/samples/generated_samples/workflows_v1beta_generated_workflows_update_workflow_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_workflow(): ) # Make the request - operation = client.update_workflow(request=request) + operation = await client.update_workflow(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workflows/setup.py b/packages/google-cloud-workflows/setup.py index f893abd6a1b3..506b6ffbf840 100644 --- a/packages/google-cloud-workflows/setup.py +++ b/packages/google-cloud-workflows/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-workflows/testing/constraints-3.10.txt b/packages/google-cloud-workflows/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-workflows/testing/constraints-3.10.txt +++ b/packages/google-cloud-workflows/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-workflows/testing/constraints-3.9.txt b/packages/google-cloud-workflows/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-workflows/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-workflows/tests/unit/gapic/executions_v1/test_executions.py b/packages/google-cloud-workflows/tests/unit/gapic/executions_v1/test_executions.py index c23877abec00..6790b38c47d8 100644 --- a/packages/google-cloud-workflows/tests/unit/gapic/executions_v1/test_executions.py +++ b/packages/google-cloud-workflows/tests/unit/gapic/executions_v1/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 Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1766,11 +1760,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 diff --git a/packages/google-cloud-workflows/tests/unit/gapic/executions_v1beta/test_executions.py b/packages/google-cloud-workflows/tests/unit/gapic/executions_v1beta/test_executions.py index 1f6142e89acc..45d198086b89 100644 --- a/packages/google-cloud-workflows/tests/unit/gapic/executions_v1beta/test_executions.py +++ b/packages/google-cloud-workflows/tests/unit/gapic/executions_v1beta/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 Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1761,11 +1755,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 diff --git a/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py b/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py index 57be7061c124..2552b59527ec 100644 --- a/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py +++ b/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1/test_workflows.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1793,11 +1787,7 @@ async def test_list_workflows_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_workflows(request={}) - ).pages: + async for page_ in (await client.list_workflows(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3630,11 +3620,7 @@ async def test_list_workflow_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_workflow_revisions(request={}) - ).pages: + async for page_ in (await client.list_workflow_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3757,7 +3743,7 @@ def test_list_workflows_rest_required_fields( expected_params = [("$alt", "json;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_workflows_rest_unset_required_fields(): @@ -4005,7 +3991,7 @@ def test_get_workflow_rest_required_fields(request_type=workflows.GetWorkflowReq expected_params = [("$alt", "json;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_workflow_rest_unset_required_fields(): @@ -4201,7 +4187,7 @@ def test_create_workflow_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_workflow_rest_unset_required_fields(): @@ -4390,7 +4376,7 @@ def test_delete_workflow_rest_required_fields( expected_params = [("$alt", "json;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_workflow_rest_unset_required_fields(): @@ -4566,7 +4552,7 @@ def test_update_workflow_rest_required_fields( expected_params = [("$alt", "json;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_workflow_rest_unset_required_fields(): @@ -4758,7 +4744,7 @@ def test_list_workflow_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_workflow_revisions_rest_unset_required_fields(): diff --git a/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1beta/test_workflows.py b/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1beta/test_workflows.py index 0edf4bcde6af..098c1298a6df 100644 --- a/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1beta/test_workflows.py +++ b/packages/google-cloud-workflows/tests/unit/gapic/workflows_v1beta/test_workflows.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -1793,11 +1787,7 @@ async def test_list_workflows_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_workflows(request={}) - ).pages: + async for page_ in (await client.list_workflows(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3265,7 +3255,7 @@ def test_list_workflows_rest_required_fields( expected_params = [("$alt", "json;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_workflows_rest_unset_required_fields(): @@ -3512,7 +3502,7 @@ def test_get_workflow_rest_required_fields(request_type=workflows.GetWorkflowReq expected_params = [("$alt", "json;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_workflow_rest_unset_required_fields(): @@ -3709,7 +3699,7 @@ def test_create_workflow_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_workflow_rest_unset_required_fields(): @@ -3899,7 +3889,7 @@ def test_delete_workflow_rest_required_fields( expected_params = [("$alt", "json;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_workflow_rest_unset_required_fields(): @@ -4076,7 +4066,7 @@ def test_update_workflow_rest_required_fields( expected_params = [("$alt", "json;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_workflow_rest_unset_required_fields(): diff --git a/packages/google-cloud-workloadmanager/docs/conf.py b/packages/google-cloud-workloadmanager/docs/conf.py index f6dd8765fb58..cdabd0f8eb64 100644 --- a/packages/google-cloud-workloadmanager/docs/conf.py +++ b/packages/google-cloud-workloadmanager/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-workloadmanager" -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-workloadmanager/google/cloud/workloadmanager_v1/__init__.py b/packages/google-cloud-workloadmanager/google/cloud/workloadmanager_v1/__init__.py index 2d447468a393..5a8e6ed77d10 100644 --- a/packages/google-cloud-workloadmanager/google/cloud/workloadmanager_v1/__init__.py +++ b/packages/google-cloud-workloadmanager/google/cloud/workloadmanager_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.workload_manager import WorkloadManagerAsyncClient, WorkloadManagerClient from .types.service import ( @@ -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.workloadmanager_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-workloadmanager/google/cloud/workloadmanager_v1/services/workload_manager/async_client.py b/packages/google-cloud-workloadmanager/google/cloud/workloadmanager_v1/services/workload_manager/async_client.py index be73b5846a89..9d2faed25b16 100644 --- a/packages/google-cloud-workloadmanager/google/cloud/workloadmanager_v1/services/workload_manager/async_client.py +++ b/packages/google-cloud-workloadmanager/google/cloud/workloadmanager_v1/services/workload_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. @@ -584,11 +584,11 @@ async def sample_create_evaluation(): ) # Make the request - operation = client.create_evaluation(request=request) + operation = await client.create_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -727,11 +727,11 @@ async def sample_update_evaluation(): ) # Make the request - operation = client.update_evaluation(request=request) + operation = await client.update_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -865,11 +865,11 @@ async def sample_delete_evaluation(): ) # Make the request - operation = client.delete_evaluation(request=request) + operation = await client.delete_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1236,11 +1236,11 @@ async def sample_run_evaluation(): ) # Make the request - operation = client.run_evaluation(request=request) + operation = await client.run_evaluation(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_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-workloadmanager/noxfile.py b/packages/google-cloud-workloadmanager/noxfile.py index af56aceaccef..3748be6a8d51 100644 --- a/packages/google-cloud-workloadmanager/noxfile.py +++ b/packages/google-cloud-workloadmanager/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-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_create_evaluation_async.py b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_create_evaluation_async.py index d8e4b7bb543f..5f0b5a2e4104 100644 --- a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_create_evaluation_async.py +++ b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_create_evaluation_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_evaluation(): ) # Make the request - operation = client.create_evaluation(request=request) + operation = await client.create_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_evaluation_async.py b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_evaluation_async.py index 561535c9ea6e..63019e8b3aa1 100644 --- a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_evaluation_async.py +++ b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_evaluation_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_evaluation(): ) # Make the request - operation = client.delete_evaluation(request=request) + operation = await client.delete_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_execution_async.py b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_execution_async.py index b6a138c9a3c9..45781a95946a 100644 --- a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_delete_execution_async.py +++ b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_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-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_run_evaluation_async.py b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_run_evaluation_async.py index 27a7f9f1b73f..24b28c6fb9be 100644 --- a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_run_evaluation_async.py +++ b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_run_evaluation_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_run_evaluation(): ) # Make the request - operation = client.run_evaluation(request=request) + operation = await client.run_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_update_evaluation_async.py b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_update_evaluation_async.py index db95b08caf53..70e4108b97e4 100644 --- a/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_update_evaluation_async.py +++ b/packages/google-cloud-workloadmanager/samples/generated_samples/workloadmanager_v1_generated_workload_manager_update_evaluation_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_evaluation(): request = workloadmanager_v1.UpdateEvaluationRequest() # Make the request - operation = client.update_evaluation(request=request) + operation = await client.update_evaluation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workloadmanager/setup.py b/packages/google-cloud-workloadmanager/setup.py index a94a8ca203cf..cd9ad30f73ef 100644 --- a/packages/google-cloud-workloadmanager/setup.py +++ b/packages/google-cloud-workloadmanager/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-workloadmanager/testing/constraints-3.10.txt b/packages/google-cloud-workloadmanager/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-workloadmanager/testing/constraints-3.10.txt +++ b/packages/google-cloud-workloadmanager/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-workloadmanager/testing/constraints-3.9.txt b/packages/google-cloud-workloadmanager/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-workloadmanager/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-workloadmanager/tests/unit/gapic/workloadmanager_v1/test_workload_manager.py b/packages/google-cloud-workloadmanager/tests/unit/gapic/workloadmanager_v1/test_workload_manager.py index ce11f39e5702..94966d20c90e 100644 --- a/packages/google-cloud-workloadmanager/tests/unit/gapic/workloadmanager_v1/test_workload_manager.py +++ b/packages/google-cloud-workloadmanager/tests/unit/gapic/workloadmanager_v1/test_workload_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 @@ -1865,11 +1859,7 @@ async def test_list_evaluations_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_evaluations(request={}) - ).pages: + async for page_ in (await client.list_evaluations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3800,11 +3790,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 @@ -5365,11 +5351,7 @@ async def test_list_execution_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_execution_results(request={}) - ).pages: + async for page_ in (await client.list_execution_results(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6238,11 +6220,7 @@ async def test_list_scanned_resources_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_scanned_resources(request={}) - ).pages: + async for page_ in (await client.list_scanned_resources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6367,7 +6345,7 @@ def test_list_evaluations_rest_required_fields( expected_params = [("$alt", "json;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_evaluations_rest_unset_required_fields(): @@ -6614,7 +6592,7 @@ def test_get_evaluation_rest_required_fields(request_type=service.GetEvaluationR expected_params = [("$alt", "json;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_evaluation_rest_unset_required_fields(): @@ -6818,7 +6796,7 @@ def test_create_evaluation_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_evaluation_rest_unset_required_fields(): @@ -7018,7 +6996,7 @@ def test_update_evaluation_rest_required_fields( expected_params = [("$alt", "json;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_evaluation_rest_unset_required_fields(): @@ -7223,7 +7201,7 @@ def test_delete_evaluation_rest_required_fields( expected_params = [("$alt", "json;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_evaluation_rest_unset_required_fields(): @@ -7418,7 +7396,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(): @@ -7669,7 +7647,7 @@ def test_get_execution_rest_required_fields(request_type=service.GetExecutionReq expected_params = [("$alt", "json;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(): @@ -7853,7 +7831,7 @@ def test_run_evaluation_rest_required_fields(request_type=service.RunEvaluationR expected_params = [("$alt", "json;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_evaluation_rest_unset_required_fields(): @@ -8049,7 +8027,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(): @@ -8240,7 +8218,7 @@ def test_list_execution_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_execution_results_rest_unset_required_fields(): @@ -8502,7 +8480,7 @@ def test_list_rules_rest_required_fields(request_type=service.ListRulesRequest): expected_params = [("$alt", "json;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_rules_rest_unset_required_fields(): @@ -8705,7 +8683,7 @@ def test_list_scanned_resources_rest_required_fields( expected_params = [("$alt", "json;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_scanned_resources_rest_unset_required_fields(): diff --git a/packages/google-cloud-workstations/docs/conf.py b/packages/google-cloud-workstations/docs/conf.py index 7cb792119b41..02a4660b1201 100644 --- a/packages/google-cloud-workstations/docs/conf.py +++ b/packages/google-cloud-workstations/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-workstations" -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-workstations/google/cloud/workstations_v1/__init__.py b/packages/google-cloud-workstations/google/cloud/workstations_v1/__init__.py index bfbb5b85fc9a..324dff0b595b 100644 --- a/packages/google-cloud-workstations/google/cloud/workstations_v1/__init__.py +++ b/packages/google-cloud-workstations/google/cloud/workstations_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.workstations import WorkstationsAsyncClient, WorkstationsClient from .types.workstations import ( @@ -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.workstations_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-workstations/google/cloud/workstations_v1/services/workstations/async_client.py b/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/async_client.py index bd4d0a7bc23f..490316be1e22 100644 --- a/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/async_client.py +++ b/packages/google-cloud-workstations/google/cloud/workstations_v1/services/workstations/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. @@ -590,11 +590,11 @@ async def sample_create_workstation_cluster(): ) # Make the request - operation = client.create_workstation_cluster(request=request) + operation = await client.create_workstation_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -738,11 +738,11 @@ async def sample_update_workstation_cluster(): ) # Make the request - operation = client.update_workstation_cluster(request=request) + operation = await client.update_workstation_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -882,11 +882,11 @@ async def sample_delete_workstation_cluster(): ) # Make the request - operation = client.delete_workstation_cluster(request=request) + operation = await client.delete_workstation_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1394,11 +1394,11 @@ async def sample_create_workstation_config(): ) # Make the request - operation = client.create_workstation_config(request=request) + operation = await client.create_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1548,11 +1548,11 @@ async def sample_update_workstation_config(): ) # Make the request - operation = client.update_workstation_config(request=request) + operation = await client.update_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1698,11 +1698,11 @@ async def sample_delete_workstation_config(): ) # Make the request - operation = client.delete_workstation_config(request=request) + operation = await client.delete_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2202,11 +2202,11 @@ async def sample_create_workstation(): ) # Make the request - operation = client.create_workstation(request=request) + operation = await client.create_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2343,11 +2343,11 @@ async def sample_update_workstation(): ) # Make the request - operation = client.update_workstation(request=request) + operation = await client.update_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2480,11 +2480,11 @@ async def sample_delete_workstation(): ) # Make the request - operation = client.delete_workstation(request=request) + operation = await client.delete_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2608,11 +2608,11 @@ async def sample_start_workstation(): ) # Make the request - operation = client.start_workstation(request=request) + operation = await client.start_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2734,11 +2734,11 @@ async def sample_stop_workstation(): ) # Make the request - operation = client.stop_workstation(request=request) + operation = await client.stop_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/google/cloud/workstations_v1beta/__init__.py b/packages/google-cloud-workstations/google/cloud/workstations_v1beta/__init__.py index 6087d9105a29..1afa425e3c15 100644 --- a/packages/google-cloud-workstations/google/cloud/workstations_v1beta/__init__.py +++ b/packages/google-cloud-workstations/google/cloud/workstations_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.workstations import WorkstationsAsyncClient, WorkstationsClient from .types.workstations import ( @@ -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.workstations_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-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py b/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py index 3f0d2f811897..66e4284718ab 100644 --- a/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/async_client.py +++ b/packages/google-cloud-workstations/google/cloud/workstations_v1beta/services/workstations/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. @@ -590,11 +590,11 @@ async def sample_create_workstation_cluster(): ) # Make the request - operation = client.create_workstation_cluster(request=request) + operation = await client.create_workstation_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -738,11 +738,11 @@ async def sample_update_workstation_cluster(): ) # Make the request - operation = client.update_workstation_cluster(request=request) + operation = await client.update_workstation_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -882,11 +882,11 @@ async def sample_delete_workstation_cluster(): ) # Make the request - operation = client.delete_workstation_cluster(request=request) + operation = await client.delete_workstation_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1394,11 +1394,11 @@ async def sample_create_workstation_config(): ) # Make the request - operation = client.create_workstation_config(request=request) + operation = await client.create_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1548,11 +1548,11 @@ async def sample_update_workstation_config(): ) # Make the request - operation = client.update_workstation_config(request=request) + operation = await client.update_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1698,11 +1698,11 @@ async def sample_delete_workstation_config(): ) # Make the request - operation = client.delete_workstation_config(request=request) + operation = await client.delete_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2202,11 +2202,11 @@ async def sample_create_workstation(): ) # Make the request - operation = client.create_workstation(request=request) + operation = await client.create_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2343,11 +2343,11 @@ async def sample_update_workstation(): ) # Make the request - operation = client.update_workstation(request=request) + operation = await client.update_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2480,11 +2480,11 @@ async def sample_delete_workstation(): ) # Make the request - operation = client.delete_workstation(request=request) + operation = await client.delete_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2608,11 +2608,11 @@ async def sample_start_workstation(): ) # Make the request - operation = client.start_workstation(request=request) + operation = await client.start_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2734,11 +2734,11 @@ async def sample_stop_workstation(): ) # Make the request - operation = client.stop_workstation(request=request) + operation = await client.stop_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/noxfile.py b/packages/google-cloud-workstations/noxfile.py index ce8554e17680..09fc488563fb 100644 --- a/packages/google-cloud-workstations/noxfile.py +++ b/packages/google-cloud-workstations/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-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_async.py index 8f4ca6498c3f..88d1f34c7cd4 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_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_workstation(): ) # Make the request - operation = client.create_workstation(request=request) + operation = await client.create_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_cluster_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_cluster_async.py index 0fbd76a835b4..9e2f6e74e3ab 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_cluster_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_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_create_workstation_cluster(): ) # Make the request - operation = client.create_workstation_cluster(request=request) + operation = await client.create_workstation_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-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_config_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_config_async.py index 7ac61a44c8b1..b4fecbb6b64e 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_config_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_create_workstation_config_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_workstation_config(): ) # Make the request - operation = client.create_workstation_config(request=request) + operation = await client.create_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_async.py index 7c81d009a62e..becf064b696e 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_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_workstation(): ) # Make the request - operation = client.delete_workstation(request=request) + operation = await client.delete_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_cluster_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_cluster_async.py index b640356eef23..715b9930b232 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_cluster_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_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_workstation_cluster(): ) # Make the request - operation = client.delete_workstation_cluster(request=request) + operation = await client.delete_workstation_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-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_config_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_config_async.py index ab0042426103..216b0f5cfaf6 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_config_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_delete_workstation_config_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_workstation_config(): ) # Make the request - operation = client.delete_workstation_config(request=request) + operation = await client.delete_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_start_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_start_workstation_async.py index 03d4784a1881..7314118c870c 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_start_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_start_workstation_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_workstation(): ) # Make the request - operation = client.start_workstation(request=request) + operation = await client.start_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_stop_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_stop_workstation_async.py index f94c507103a6..4ccf4bb9bf07 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_stop_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_stop_workstation_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_workstation(): ) # Make the request - operation = client.stop_workstation(request=request) + operation = await client.stop_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_async.py index 58679371ff5f..3a8e275f4498 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_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_workstation(): request = workstations_v1.UpdateWorkstationRequest() # Make the request - operation = client.update_workstation(request=request) + operation = await client.update_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_cluster_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_cluster_async.py index ef025cee0859..9f7d135aa97f 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_cluster_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_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. @@ -42,11 +42,11 @@ async def sample_update_workstation_cluster(): request = workstations_v1.UpdateWorkstationClusterRequest() # Make the request - operation = client.update_workstation_cluster(request=request) + operation = await client.update_workstation_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-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_config_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_config_async.py index 7f1fe6ea1568..cfe47784b183 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_config_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1_generated_workstations_update_workstation_config_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_workstation_config(): request = workstations_v1.UpdateWorkstationConfigRequest() # Make the request - operation = client.update_workstation_config(request=request) + operation = await client.update_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_async.py index dd7b4ab7b547..10b8f51761e7 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_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_workstation(): ) # Make the request - operation = client.create_workstation(request=request) + operation = await client.create_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_cluster_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_cluster_async.py index 381ec1f8e5f9..e50191aaffd1 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_cluster_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_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_create_workstation_cluster(): ) # Make the request - operation = client.create_workstation_cluster(request=request) + operation = await client.create_workstation_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-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_config_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_config_async.py index 9e50e18c71ed..5f505ee0675c 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_config_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_create_workstation_config_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_workstation_config(): ) # Make the request - operation = client.create_workstation_config(request=request) + operation = await client.create_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_async.py index 069fb2f5631c..b35cf364d8fb 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_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_workstation(): ) # Make the request - operation = client.delete_workstation(request=request) + operation = await client.delete_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_cluster_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_cluster_async.py index 4f048ddcddc6..ceed5f70e8b3 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_cluster_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_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_workstation_cluster(): ) # Make the request - operation = client.delete_workstation_cluster(request=request) + operation = await client.delete_workstation_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-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_config_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_config_async.py index d9680f9346e1..51214b06ee81 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_config_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_delete_workstation_config_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_workstation_config(): ) # Make the request - operation = client.delete_workstation_config(request=request) + operation = await client.delete_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_start_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_start_workstation_async.py index bfce57937cb2..b334c2dadf63 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_start_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_start_workstation_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_workstation(): ) # Make the request - operation = client.start_workstation(request=request) + operation = await client.start_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_stop_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_stop_workstation_async.py index b2a69d8e7b57..6a2c43ff219e 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_stop_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_stop_workstation_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_workstation(): ) # Make the request - operation = client.stop_workstation(request=request) + operation = await client.stop_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_async.py index 85aeb369a800..ea51abb3059f 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_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_workstation(): request = workstations_v1beta.UpdateWorkstationRequest() # Make the request - operation = client.update_workstation(request=request) + operation = await client.update_workstation(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_cluster_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_cluster_async.py index b8f3ec947abd..6b4acfef4b78 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_cluster_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_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. @@ -42,11 +42,11 @@ async def sample_update_workstation_cluster(): request = workstations_v1beta.UpdateWorkstationClusterRequest() # Make the request - operation = client.update_workstation_cluster(request=request) + operation = await client.update_workstation_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-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_config_async.py b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_config_async.py index 75a1bf539cab..18e576cb7f88 100644 --- a/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_config_async.py +++ b/packages/google-cloud-workstations/samples/generated_samples/workstations_v1beta_generated_workstations_update_workstation_config_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_workstation_config(): request = workstations_v1beta.UpdateWorkstationConfigRequest() # Make the request - operation = client.update_workstation_config(request=request) + operation = await client.update_workstation_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-workstations/setup.py b/packages/google-cloud-workstations/setup.py index fb784dc05068..0dd67681c51b 100644 --- a/packages/google-cloud-workstations/setup.py +++ b/packages/google-cloud-workstations/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-workstations/testing/constraints-3.10.txt b/packages/google-cloud-workstations/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-workstations/testing/constraints-3.10.txt +++ b/packages/google-cloud-workstations/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-workstations/testing/constraints-3.9.txt b/packages/google-cloud-workstations/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-workstations/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-workstations/tests/unit/gapic/workstations_v1/test_workstations.py b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py index 8f44963ac0a6..4b0be1abc25f 100644 --- a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py +++ b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1/test_workstations.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2224,11 +2218,7 @@ async def test_list_workstation_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_workstation_clusters(request={}) - ).pages: + async for page_ in (await client.list_workstation_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4215,11 +4205,7 @@ async def test_list_workstation_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_workstation_configs(request={}) - ).pages: + async for page_ in (await client.list_workstation_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4768,9 +4754,7 @@ async def test_list_usable_workstation_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 + async for page_ in ( await client.list_usable_workstation_configs(request={}) ).pages: pages.append(page_) @@ -6733,11 +6717,7 @@ async def test_list_workstations_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_workstations(request={}) - ).pages: + async for page_ in (await client.list_workstations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7286,11 +7266,7 @@ async def test_list_usable_workstations_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_usable_workstations(request={}) - ).pages: + async for page_ in (await client.list_usable_workstations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9493,7 +9469,7 @@ def test_get_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -9685,7 +9661,7 @@ def test_list_workstation_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_workstation_clusters_rest_unset_required_fields(): @@ -9964,7 +9940,7 @@ def test_create_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -10168,7 +10144,7 @@ def test_update_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -10378,7 +10354,7 @@ def test_delete_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -10570,7 +10546,7 @@ def test_get_workstation_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_workstation_config_rest_unset_required_fields(): @@ -10762,7 +10738,7 @@ def test_list_workstation_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_workstation_configs_rest_unset_required_fields(): @@ -11029,7 +11005,7 @@ def test_list_usable_workstation_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_usable_workstation_configs_rest_unset_required_fields(): @@ -11319,7 +11295,7 @@ def test_create_workstation_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_workstation_config_rest_unset_required_fields(): @@ -11525,7 +11501,7 @@ def test_update_workstation_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_workstation_config_rest_unset_required_fields(): @@ -11735,7 +11711,7 @@ def test_delete_workstation_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_workstation_config_rest_unset_required_fields(): @@ -11922,7 +11898,7 @@ def test_get_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -12111,7 +12087,7 @@ def test_list_workstations_rest_required_fields( expected_params = [("$alt", "json;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_workstations_rest_unset_required_fields(): @@ -12376,7 +12352,7 @@ def test_list_usable_workstations_rest_required_fields( expected_params = [("$alt", "json;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_usable_workstations_rest_unset_required_fields(): @@ -12655,7 +12631,7 @@ def test_create_workstation_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_workstation_rest_unset_required_fields(): @@ -12860,7 +12836,7 @@ def test_update_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13068,7 +13044,7 @@ def test_delete_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13258,7 +13234,7 @@ def test_start_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13440,7 +13416,7 @@ def test_stop_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13624,7 +13600,7 @@ def test_generate_access_token_rest_required_fields( expected_params = [("$alt", "json;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_access_token_rest_unset_required_fields(): diff --git a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py index f5453a756dd6..01cbc55741b6 100644 --- a/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py +++ b/packages/google-cloud-workstations/tests/unit/gapic/workstations_v1beta/test_workstations.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 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 @@ -2224,11 +2218,7 @@ async def test_list_workstation_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_workstation_clusters(request={}) - ).pages: + async for page_ in (await client.list_workstation_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4219,11 +4209,7 @@ async def test_list_workstation_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_workstation_configs(request={}) - ).pages: + async for page_ in (await client.list_workstation_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4772,9 +4758,7 @@ async def test_list_usable_workstation_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 + async for page_ in ( await client.list_usable_workstation_configs(request={}) ).pages: pages.append(page_) @@ -6737,11 +6721,7 @@ async def test_list_workstations_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_workstations(request={}) - ).pages: + async for page_ in (await client.list_workstations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7290,11 +7270,7 @@ async def test_list_usable_workstations_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_usable_workstations(request={}) - ).pages: + async for page_ in (await client.list_usable_workstations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9497,7 +9473,7 @@ def test_get_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -9689,7 +9665,7 @@ def test_list_workstation_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_workstation_clusters_rest_unset_required_fields(): @@ -9968,7 +9944,7 @@ def test_create_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -10172,7 +10148,7 @@ def test_update_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -10382,7 +10358,7 @@ def test_delete_workstation_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_workstation_cluster_rest_unset_required_fields(): @@ -10574,7 +10550,7 @@ def test_get_workstation_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_workstation_config_rest_unset_required_fields(): @@ -10766,7 +10742,7 @@ def test_list_workstation_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_workstation_configs_rest_unset_required_fields(): @@ -11033,7 +11009,7 @@ def test_list_usable_workstation_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_usable_workstation_configs_rest_unset_required_fields(): @@ -11323,7 +11299,7 @@ def test_create_workstation_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_workstation_config_rest_unset_required_fields(): @@ -11529,7 +11505,7 @@ def test_update_workstation_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_workstation_config_rest_unset_required_fields(): @@ -11739,7 +11715,7 @@ def test_delete_workstation_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_workstation_config_rest_unset_required_fields(): @@ -11926,7 +11902,7 @@ def test_get_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -12115,7 +12091,7 @@ def test_list_workstations_rest_required_fields( expected_params = [("$alt", "json;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_workstations_rest_unset_required_fields(): @@ -12380,7 +12356,7 @@ def test_list_usable_workstations_rest_required_fields( expected_params = [("$alt", "json;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_usable_workstations_rest_unset_required_fields(): @@ -12659,7 +12635,7 @@ def test_create_workstation_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_workstation_rest_unset_required_fields(): @@ -12864,7 +12840,7 @@ def test_update_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13072,7 +13048,7 @@ def test_delete_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13262,7 +13238,7 @@ def test_start_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13444,7 +13420,7 @@ def test_stop_workstation_rest_required_fields( expected_params = [("$alt", "json;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_workstation_rest_unset_required_fields(): @@ -13628,7 +13604,7 @@ def test_generate_access_token_rest_required_fields( expected_params = [("$alt", "json;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_access_token_rest_unset_required_fields():