Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Commit 61bc618

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#152)
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: googleapis/googleapis@fea4387 Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * add gapic_version.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent d642bba commit 61bc618

File tree

12 files changed

+92
-89
lines changed

12 files changed

+92
-89
lines changed

.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "0.7.2" # {x-release-please-version}

google/cloud/bigquery_migration_v2/services/migration_service/async_client.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
37-
import pkg_resources
37+
38+
from google.cloud.bigquery_migration_v2 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -238,7 +239,7 @@ async def create_migration_workflow(
238239
parent: Optional[str] = None,
239240
migration_workflow: Optional[migration_entities.MigrationWorkflow] = None,
240241
retry: OptionalRetry = gapic_v1.method.DEFAULT,
241-
timeout: Optional[float] = None,
242+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
242243
metadata: Sequence[Tuple[str, str]] = (),
243244
) -> migration_entities.MigrationWorkflow:
244245
r"""Creates a migration workflow.
@@ -353,7 +354,7 @@ async def get_migration_workflow(
353354
*,
354355
name: Optional[str] = None,
355356
retry: OptionalRetry = gapic_v1.method.DEFAULT,
356-
timeout: Optional[float] = None,
357+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
357358
metadata: Sequence[Tuple[str, str]] = (),
358359
) -> migration_entities.MigrationWorkflow:
359360
r"""Gets a previously created migration workflow.
@@ -468,7 +469,7 @@ async def list_migration_workflows(
468469
*,
469470
parent: Optional[str] = None,
470471
retry: OptionalRetry = gapic_v1.method.DEFAULT,
471-
timeout: Optional[float] = None,
472+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
472473
metadata: Sequence[Tuple[str, str]] = (),
473474
) -> pagers.ListMigrationWorkflowsAsyncPager:
474475
r"""Lists previously created migration workflow.
@@ -594,7 +595,7 @@ async def delete_migration_workflow(
594595
*,
595596
name: Optional[str] = None,
596597
retry: OptionalRetry = gapic_v1.method.DEFAULT,
597-
timeout: Optional[float] = None,
598+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
598599
metadata: Sequence[Tuple[str, str]] = (),
599600
) -> None:
600601
r"""Deletes a migration workflow by name.
@@ -687,7 +688,7 @@ async def start_migration_workflow(
687688
*,
688689
name: Optional[str] = None,
689690
retry: OptionalRetry = gapic_v1.method.DEFAULT,
690-
timeout: Optional[float] = None,
691+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
691692
metadata: Sequence[Tuple[str, str]] = (),
692693
) -> None:
693694
r"""Starts a previously created migration workflow. I.e.,
@@ -793,7 +794,7 @@ async def get_migration_subtask(
793794
*,
794795
name: Optional[str] = None,
795796
retry: OptionalRetry = gapic_v1.method.DEFAULT,
796-
timeout: Optional[float] = None,
797+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
797798
metadata: Sequence[Tuple[str, str]] = (),
798799
) -> migration_entities.MigrationSubtask:
799800
r"""Gets a previously created migration subtask.
@@ -902,7 +903,7 @@ async def list_migration_subtasks(
902903
*,
903904
parent: Optional[str] = None,
904905
retry: OptionalRetry = gapic_v1.method.DEFAULT,
905-
timeout: Optional[float] = None,
906+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
906907
metadata: Sequence[Tuple[str, str]] = (),
907908
) -> pagers.ListMigrationSubtasksAsyncPager:
908909
r"""Lists previously created migration subtasks.
@@ -1017,14 +1018,9 @@ async def __aexit__(self, exc_type, exc, tb):
10171018
await self.transport.close()
10181019

10191020

1020-
try:
1021-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1022-
gapic_version=pkg_resources.get_distribution(
1023-
"google-cloud-bigquery-migration",
1024-
).version,
1025-
)
1026-
except pkg_resources.DistributionNotFound:
1027-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1021+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1022+
gapic_version=package_version.__version__
1023+
)
10281024

10291025

10301026
__all__ = ("MigrationServiceAsyncClient",)

google/cloud/bigquery_migration_v2/services/migration_service/client.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
from google.auth.transport import mtls # type: ignore
3939
from google.auth.transport.grpc import SslCredentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
41-
import pkg_resources
41+
42+
from google.cloud.bigquery_migration_v2 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -481,7 +482,7 @@ def create_migration_workflow(
481482
parent: Optional[str] = None,
482483
migration_workflow: Optional[migration_entities.MigrationWorkflow] = None,
483484
retry: OptionalRetry = gapic_v1.method.DEFAULT,
484-
timeout: Optional[float] = None,
485+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
485486
metadata: Sequence[Tuple[str, str]] = (),
486487
) -> migration_entities.MigrationWorkflow:
487488
r"""Creates a migration workflow.
@@ -598,7 +599,7 @@ def get_migration_workflow(
598599
*,
599600
name: Optional[str] = None,
600601
retry: OptionalRetry = gapic_v1.method.DEFAULT,
601-
timeout: Optional[float] = None,
602+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
602603
metadata: Sequence[Tuple[str, str]] = (),
603604
) -> migration_entities.MigrationWorkflow:
604605
r"""Gets a previously created migration workflow.
@@ -704,7 +705,7 @@ def list_migration_workflows(
704705
*,
705706
parent: Optional[str] = None,
706707
retry: OptionalRetry = gapic_v1.method.DEFAULT,
707-
timeout: Optional[float] = None,
708+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
708709
metadata: Sequence[Tuple[str, str]] = (),
709710
) -> pagers.ListMigrationWorkflowsPager:
710711
r"""Lists previously created migration workflow.
@@ -821,7 +822,7 @@ def delete_migration_workflow(
821822
*,
822823
name: Optional[str] = None,
823824
retry: OptionalRetry = gapic_v1.method.DEFAULT,
824-
timeout: Optional[float] = None,
825+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
825826
metadata: Sequence[Tuple[str, str]] = (),
826827
) -> None:
827828
r"""Deletes a migration workflow by name.
@@ -916,7 +917,7 @@ def start_migration_workflow(
916917
*,
917918
name: Optional[str] = None,
918919
retry: OptionalRetry = gapic_v1.method.DEFAULT,
919-
timeout: Optional[float] = None,
920+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
920921
metadata: Sequence[Tuple[str, str]] = (),
921922
) -> None:
922923
r"""Starts a previously created migration workflow. I.e.,
@@ -1013,7 +1014,7 @@ def get_migration_subtask(
10131014
*,
10141015
name: Optional[str] = None,
10151016
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1016-
timeout: Optional[float] = None,
1017+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10171018
metadata: Sequence[Tuple[str, str]] = (),
10181019
) -> migration_entities.MigrationSubtask:
10191020
r"""Gets a previously created migration subtask.
@@ -1122,7 +1123,7 @@ def list_migration_subtasks(
11221123
*,
11231124
parent: Optional[str] = None,
11241125
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1125-
timeout: Optional[float] = None,
1126+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11261127
metadata: Sequence[Tuple[str, str]] = (),
11271128
) -> pagers.ListMigrationSubtasksPager:
11281129
r"""Lists previously created migration subtasks.
@@ -1244,14 +1245,9 @@ def __exit__(self, type, value, traceback):
12441245
self.transport.close()
12451246

12461247

1247-
try:
1248-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1249-
gapic_version=pkg_resources.get_distribution(
1250-
"google-cloud-bigquery-migration",
1251-
).version,
1252-
)
1253-
except pkg_resources.DistributionNotFound:
1254-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1248+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1249+
gapic_version=package_version.__version__
1250+
)
12551251

12561252

12571253
__all__ = ("MigrationServiceClient",)

google/cloud/bigquery_migration_v2/services/migration_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,16 @@
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.oauth2 import service_account # type: ignore
2626
from google.protobuf import empty_pb2 # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.bigquery_migration_v2 import gapic_version as package_version
2929
from google.cloud.bigquery_migration_v2.types import (
3030
migration_entities,
3131
migration_service,
3232
)
3333

34-
try:
35-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
36-
gapic_version=pkg_resources.get_distribution(
37-
"google-cloud-bigquery-migration",
38-
).version,
39-
)
40-
except pkg_resources.DistributionNotFound:
41-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
34+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
35+
gapic_version=package_version.__version__
36+
)
4237

4338

4439
class MigrationServiceTransport(abc.ABC):
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "0.7.2" # {x-release-please-version}

google/cloud/bigquery_migration_v2alpha/services/migration_service/async_client.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
37-
import pkg_resources
37+
38+
from google.cloud.bigquery_migration_v2alpha import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -238,7 +239,7 @@ async def create_migration_workflow(
238239
parent: Optional[str] = None,
239240
migration_workflow: Optional[migration_entities.MigrationWorkflow] = None,
240241
retry: OptionalRetry = gapic_v1.method.DEFAULT,
241-
timeout: Optional[float] = None,
242+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
242243
metadata: Sequence[Tuple[str, str]] = (),
243244
) -> migration_entities.MigrationWorkflow:
244245
r"""Creates a migration workflow.
@@ -353,7 +354,7 @@ async def get_migration_workflow(
353354
*,
354355
name: Optional[str] = None,
355356
retry: OptionalRetry = gapic_v1.method.DEFAULT,
356-
timeout: Optional[float] = None,
357+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
357358
metadata: Sequence[Tuple[str, str]] = (),
358359
) -> migration_entities.MigrationWorkflow:
359360
r"""Gets a previously created migration workflow.
@@ -468,7 +469,7 @@ async def list_migration_workflows(
468469
*,
469470
parent: Optional[str] = None,
470471
retry: OptionalRetry = gapic_v1.method.DEFAULT,
471-
timeout: Optional[float] = None,
472+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
472473
metadata: Sequence[Tuple[str, str]] = (),
473474
) -> pagers.ListMigrationWorkflowsAsyncPager:
474475
r"""Lists previously created migration workflow.
@@ -594,7 +595,7 @@ async def delete_migration_workflow(
594595
*,
595596
name: Optional[str] = None,
596597
retry: OptionalRetry = gapic_v1.method.DEFAULT,
597-
timeout: Optional[float] = None,
598+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
598599
metadata: Sequence[Tuple[str, str]] = (),
599600
) -> None:
600601
r"""Deletes a migration workflow by name.
@@ -687,7 +688,7 @@ async def start_migration_workflow(
687688
*,
688689
name: Optional[str] = None,
689690
retry: OptionalRetry = gapic_v1.method.DEFAULT,
690-
timeout: Optional[float] = None,
691+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
691692
metadata: Sequence[Tuple[str, str]] = (),
692693
) -> None:
693694
r"""Starts a previously created migration workflow. I.e.,
@@ -793,7 +794,7 @@ async def get_migration_subtask(
793794
*,
794795
name: Optional[str] = None,
795796
retry: OptionalRetry = gapic_v1.method.DEFAULT,
796-
timeout: Optional[float] = None,
797+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
797798
metadata: Sequence[Tuple[str, str]] = (),
798799
) -> migration_entities.MigrationSubtask:
799800
r"""Gets a previously created migration subtask.
@@ -911,7 +912,7 @@ async def list_migration_subtasks(
911912
*,
912913
parent: Optional[str] = None,
913914
retry: OptionalRetry = gapic_v1.method.DEFAULT,
914-
timeout: Optional[float] = None,
915+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
915916
metadata: Sequence[Tuple[str, str]] = (),
916917
) -> pagers.ListMigrationSubtasksAsyncPager:
917918
r"""Lists previously created migration subtasks.
@@ -1035,14 +1036,9 @@ async def __aexit__(self, exc_type, exc, tb):
10351036
await self.transport.close()
10361037

10371038

1038-
try:
1039-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1040-
gapic_version=pkg_resources.get_distribution(
1041-
"google-cloud-bigquery-migration",
1042-
).version,
1043-
)
1044-
except pkg_resources.DistributionNotFound:
1045-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1039+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1040+
gapic_version=package_version.__version__
1041+
)
10461042

10471043

10481044
__all__ = ("MigrationServiceAsyncClient",)

0 commit comments

Comments
 (0)