diff --git a/packages/google-cloud-data-fusion/.coveragerc b/packages/google-cloud-data-fusion/.coveragerc index 4e33b7941d74..471a31ce7a70 100644 --- a/packages/google-cloud-data-fusion/.coveragerc +++ b/packages/google-cloud-data-fusion/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/gapic_version.py b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/gapic_version.py new file mode 100644 index 000000000000..943734048cd8 --- /dev/null +++ b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.5.3" # {x-release-please-version} diff --git a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/async_client.py b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/async_client.py index 5f7d8c6bdd7f..f64c0bd2ecbf 100644 --- a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/async_client.py +++ b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.data_fusion_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -224,7 +225,7 @@ async def list_available_versions( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAvailableVersionsAsyncPager: r"""Lists possible versions for Data Fusion instances in @@ -341,7 +342,7 @@ async def list_instances( request: Optional[Union[datafusion.ListInstancesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListInstancesAsyncPager: r"""Lists Data Fusion instances in the specified project @@ -435,7 +436,7 @@ async def get_instance( request: Optional[Union[datafusion.GetInstanceRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datafusion.Instance: r"""Gets details of a single Data Fusion instance. @@ -516,7 +517,7 @@ async def create_instance( instance: Optional[datafusion.Instance] = None, instance_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new Data Fusion instance in the specified @@ -548,7 +549,7 @@ async def sample_create_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -652,7 +653,7 @@ async def delete_instance( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single Date Fusion instance. @@ -682,7 +683,7 @@ async def sample_delete_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -778,7 +779,7 @@ async def update_instance( instance: Optional[datafusion.Instance] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a single Data Fusion instance. @@ -811,7 +812,7 @@ async def sample_update_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -919,7 +920,7 @@ async def restart_instance( request: Optional[Union[datafusion.RestartInstanceRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Restart a single Data Fusion instance. @@ -950,7 +951,7 @@ async def sample_restart_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1017,14 +1018,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-data-fusion", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataFusionAsyncClient",) diff --git a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/client.py b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/client.py index 307a346417c4..4f672764bf01 100644 --- a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/client.py +++ b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.data_fusion_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -477,7 +478,7 @@ def list_available_versions( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAvailableVersionsPager: r"""Lists possible versions for Data Fusion instances in @@ -594,7 +595,7 @@ def list_instances( request: Optional[Union[datafusion.ListInstancesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListInstancesPager: r"""Lists Data Fusion instances in the specified project @@ -689,7 +690,7 @@ def get_instance( request: Optional[Union[datafusion.GetInstanceRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datafusion.Instance: r"""Gets details of a single Data Fusion instance. @@ -771,7 +772,7 @@ def create_instance( instance: Optional[datafusion.Instance] = None, instance_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new Data Fusion instance in the specified @@ -907,7 +908,7 @@ def delete_instance( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single Date Fusion instance. @@ -1033,7 +1034,7 @@ def update_instance( instance: Optional[datafusion.Instance] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a single Data Fusion instance. @@ -1174,7 +1175,7 @@ def restart_instance( request: Optional[Union[datafusion.RestartInstanceRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Restart a single Data Fusion instance. @@ -1280,14 +1281,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-data-fusion", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataFusionClient",) diff --git a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py index 3c6d7a204cdb..9c226d9e07aa 100644 --- a/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py +++ b/packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.data_fusion_v1 import gapic_version as package_version from google.cloud.data_fusion_v1.types import datafusion -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-data-fusion", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataFusionTransport(abc.ABC): diff --git a/packages/google-cloud-data-fusion/release-please-config.json b/packages/google-cloud-data-fusion/release-please-config.json index 88cd06aea21a..192c084681c4 100644 --- a/packages/google-cloud-data-fusion/release-please-config.json +++ b/packages/google-cloud-data-fusion/release-please-config.json @@ -4,6 +4,7 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/data_fusion_v1/gapic_version.py", "google/cloud/data_fusion/gapic_version.py", { "type": "json", diff --git a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_create_instance_async.py b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_create_instance_async.py index 0e6fb4c133ad..ffc8ca0dadbc 100644 --- a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_create_instance_async.py +++ b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_create_instance_async.py @@ -49,7 +49,7 @@ async def sample_create_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_delete_instance_async.py b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_delete_instance_async.py index f18ab78aae9b..f37077ff1dba 100644 --- a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_delete_instance_async.py +++ b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_delete_instance_async.py @@ -48,7 +48,7 @@ async def sample_delete_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_restart_instance_async.py b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_restart_instance_async.py index aa55921c1a54..d2a793882d0a 100644 --- a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_restart_instance_async.py +++ b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_restart_instance_async.py @@ -48,7 +48,7 @@ async def sample_restart_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_update_instance_async.py b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_update_instance_async.py index 6b07dfb46a38..95d3e5dddbc5 100644 --- a/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_update_instance_async.py +++ b/packages/google-cloud-data-fusion/samples/generated_samples/datafusion_v1_generated_data_fusion_update_instance_async.py @@ -51,7 +51,7 @@ async def sample_update_instance(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-data-fusion/setup.py b/packages/google-cloud-data-fusion/setup.py index bf221a340b91..303127430d5c 100644 --- a/packages/google-cloud-data-fusion/setup.py +++ b/packages/google-cloud-data-fusion/setup.py @@ -38,7 +38,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] diff --git a/packages/google-cloud-data-fusion/testing/constraints-3.7.txt b/packages/google-cloud-data-fusion/testing/constraints-3.7.txt index 6f3158cc2034..6c44adfea7ee 100644 --- a/packages/google-cloud-data-fusion/testing/constraints-3.7.txt +++ b/packages/google-cloud-data-fusion/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5