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

Commit 566af4a

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#230)
* 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 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent f234644 commit 566af4a

26 files changed

+174
-163
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__ = "1.7.4" # {x-release-please-version}

google/cloud/workflows/executions_v1/services/executions/async_client.py

Lines changed: 9 additions & 13 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.workflows.executions_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -219,7 +220,7 @@ async def list_executions(
219220
*,
220221
parent: Optional[str] = None,
221222
retry: OptionalRetry = gapic_v1.method.DEFAULT,
222-
timeout: Optional[float] = None,
223+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
223224
metadata: Sequence[Tuple[str, str]] = (),
224225
) -> pagers.ListExecutionsAsyncPager:
225226
r"""Returns a list of executions which belong to the
@@ -343,7 +344,7 @@ async def create_execution(
343344
parent: Optional[str] = None,
344345
execution: Optional[executions.Execution] = None,
345346
retry: OptionalRetry = gapic_v1.method.DEFAULT,
346-
timeout: Optional[float] = None,
347+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
347348
metadata: Sequence[Tuple[str, str]] = (),
348349
) -> executions.Execution:
349350
r"""Creates a new execution using the latest revision of
@@ -458,7 +459,7 @@ async def get_execution(
458459
*,
459460
name: Optional[str] = None,
460461
retry: OptionalRetry = gapic_v1.method.DEFAULT,
461-
timeout: Optional[float] = None,
462+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
462463
metadata: Sequence[Tuple[str, str]] = (),
463464
) -> executions.Execution:
464465
r"""Returns an execution of the given name.
@@ -562,7 +563,7 @@ async def cancel_execution(
562563
*,
563564
name: Optional[str] = None,
564565
retry: OptionalRetry = gapic_v1.method.DEFAULT,
565-
timeout: Optional[float] = None,
566+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
566567
metadata: Sequence[Tuple[str, str]] = (),
567568
) -> executions.Execution:
568569
r"""Cancels an execution of the given name.
@@ -667,14 +668,9 @@ async def __aexit__(self, exc_type, exc, tb):
667668
await self.transport.close()
668669

669670

670-
try:
671-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
672-
gapic_version=pkg_resources.get_distribution(
673-
"google-cloud-workflows",
674-
).version,
675-
)
676-
except pkg_resources.DistributionNotFound:
677-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
671+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
672+
gapic_version=package_version.__version__
673+
)
678674

679675

680676
__all__ = ("ExecutionsAsyncClient",)

google/cloud/workflows/executions_v1/services/executions/client.py

Lines changed: 9 additions & 13 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.workflows.executions_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -472,7 +473,7 @@ def list_executions(
472473
*,
473474
parent: Optional[str] = None,
474475
retry: OptionalRetry = gapic_v1.method.DEFAULT,
475-
timeout: Optional[float] = None,
476+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
476477
metadata: Sequence[Tuple[str, str]] = (),
477478
) -> pagers.ListExecutionsPager:
478479
r"""Returns a list of executions which belong to the
@@ -596,7 +597,7 @@ def create_execution(
596597
parent: Optional[str] = None,
597598
execution: Optional[executions.Execution] = None,
598599
retry: OptionalRetry = gapic_v1.method.DEFAULT,
599-
timeout: Optional[float] = None,
600+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
600601
metadata: Sequence[Tuple[str, str]] = (),
601602
) -> executions.Execution:
602603
r"""Creates a new execution using the latest revision of
@@ -711,7 +712,7 @@ def get_execution(
711712
*,
712713
name: Optional[str] = None,
713714
retry: OptionalRetry = gapic_v1.method.DEFAULT,
714-
timeout: Optional[float] = None,
715+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
715716
metadata: Sequence[Tuple[str, str]] = (),
716717
) -> executions.Execution:
717718
r"""Returns an execution of the given name.
@@ -815,7 +816,7 @@ def cancel_execution(
815816
*,
816817
name: Optional[str] = None,
817818
retry: OptionalRetry = gapic_v1.method.DEFAULT,
818-
timeout: Optional[float] = None,
819+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
819820
metadata: Sequence[Tuple[str, str]] = (),
820821
) -> executions.Execution:
821822
r"""Cancels an execution of the given name.
@@ -927,14 +928,9 @@ def __exit__(self, type, value, traceback):
927928
self.transport.close()
928929

929930

930-
try:
931-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
932-
gapic_version=pkg_resources.get_distribution(
933-
"google-cloud-workflows",
934-
).version,
935-
)
936-
except pkg_resources.DistributionNotFound:
937-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
931+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
932+
gapic_version=package_version.__version__
933+
)
938934

939935

940936
__all__ = ("ExecutionsClient",)

google/cloud/workflows/executions_v1/services/executions/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,13 @@
2323
import google.auth # type: ignore
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.oauth2 import service_account # type: ignore
26-
import pkg_resources
2726

27+
from google.cloud.workflows.executions_v1 import gapic_version as package_version
2828
from google.cloud.workflows.executions_v1.types import executions
2929

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-workflows",
34-
).version,
35-
)
36-
except pkg_resources.DistributionNotFound:
37-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
30+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
31+
gapic_version=package_version.__version__
32+
)
3833

3934

4035
class ExecutionsTransport(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__ = "1.7.4" # {x-release-please-version}

google/cloud/workflows/executions_v1beta/services/executions/async_client.py

Lines changed: 9 additions & 13 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.workflows.executions_v1beta import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -220,7 +221,7 @@ async def list_executions(
220221
*,
221222
parent: Optional[str] = None,
222223
retry: OptionalRetry = gapic_v1.method.DEFAULT,
223-
timeout: Optional[float] = None,
224+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
224225
metadata: Sequence[Tuple[str, str]] = (),
225226
) -> pagers.ListExecutionsAsyncPager:
226227
r"""Returns a list of executions which belong to the
@@ -344,7 +345,7 @@ async def create_execution(
344345
parent: Optional[str] = None,
345346
execution: Optional[executions.Execution] = None,
346347
retry: OptionalRetry = gapic_v1.method.DEFAULT,
347-
timeout: Optional[float] = None,
348+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
348349
metadata: Sequence[Tuple[str, str]] = (),
349350
) -> executions.Execution:
350351
r"""Creates a new execution using the latest revision of
@@ -459,7 +460,7 @@ async def get_execution(
459460
*,
460461
name: Optional[str] = None,
461462
retry: OptionalRetry = gapic_v1.method.DEFAULT,
462-
timeout: Optional[float] = None,
463+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
463464
metadata: Sequence[Tuple[str, str]] = (),
464465
) -> executions.Execution:
465466
r"""Returns an execution of the given name.
@@ -563,7 +564,7 @@ async def cancel_execution(
563564
*,
564565
name: Optional[str] = None,
565566
retry: OptionalRetry = gapic_v1.method.DEFAULT,
566-
timeout: Optional[float] = None,
567+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
567568
metadata: Sequence[Tuple[str, str]] = (),
568569
) -> executions.Execution:
569570
r"""Cancels an execution of the given name.
@@ -668,14 +669,9 @@ async def __aexit__(self, exc_type, exc, tb):
668669
await self.transport.close()
669670

670671

671-
try:
672-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
673-
gapic_version=pkg_resources.get_distribution(
674-
"google-cloud-workflows",
675-
).version,
676-
)
677-
except pkg_resources.DistributionNotFound:
678-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
672+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
673+
gapic_version=package_version.__version__
674+
)
679675

680676

681677
__all__ = ("ExecutionsAsyncClient",)

google/cloud/workflows/executions_v1beta/services/executions/client.py

Lines changed: 9 additions & 13 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.workflows.executions_v1beta import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -473,7 +474,7 @@ def list_executions(
473474
*,
474475
parent: Optional[str] = None,
475476
retry: OptionalRetry = gapic_v1.method.DEFAULT,
476-
timeout: Optional[float] = None,
477+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
477478
metadata: Sequence[Tuple[str, str]] = (),
478479
) -> pagers.ListExecutionsPager:
479480
r"""Returns a list of executions which belong to the
@@ -597,7 +598,7 @@ def create_execution(
597598
parent: Optional[str] = None,
598599
execution: Optional[executions.Execution] = None,
599600
retry: OptionalRetry = gapic_v1.method.DEFAULT,
600-
timeout: Optional[float] = None,
601+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
601602
metadata: Sequence[Tuple[str, str]] = (),
602603
) -> executions.Execution:
603604
r"""Creates a new execution using the latest revision of
@@ -712,7 +713,7 @@ def get_execution(
712713
*,
713714
name: Optional[str] = None,
714715
retry: OptionalRetry = gapic_v1.method.DEFAULT,
715-
timeout: Optional[float] = None,
716+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
716717
metadata: Sequence[Tuple[str, str]] = (),
717718
) -> executions.Execution:
718719
r"""Returns an execution of the given name.
@@ -816,7 +817,7 @@ def cancel_execution(
816817
*,
817818
name: Optional[str] = None,
818819
retry: OptionalRetry = gapic_v1.method.DEFAULT,
819-
timeout: Optional[float] = None,
820+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
820821
metadata: Sequence[Tuple[str, str]] = (),
821822
) -> executions.Execution:
822823
r"""Cancels an execution of the given name.
@@ -928,14 +929,9 @@ def __exit__(self, type, value, traceback):
928929
self.transport.close()
929930

930931

931-
try:
932-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
933-
gapic_version=pkg_resources.get_distribution(
934-
"google-cloud-workflows",
935-
).version,
936-
)
937-
except pkg_resources.DistributionNotFound:
938-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
932+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
933+
gapic_version=package_version.__version__
934+
)
939935

940936

941937
__all__ = ("ExecutionsClient",)

google/cloud/workflows/executions_v1beta/services/executions/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,13 @@
2323
import google.auth # type: ignore
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.oauth2 import service_account # type: ignore
26-
import pkg_resources
2726

27+
from google.cloud.workflows.executions_v1beta import gapic_version as package_version
2828
from google.cloud.workflows.executions_v1beta.types import executions
2929

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-workflows",
34-
).version,
35-
)
36-
except pkg_resources.DistributionNotFound:
37-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
30+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
31+
gapic_version=package_version.__version__
32+
)
3833

3934

4035
class ExecutionsTransport(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__ = "1.7.4" # {x-release-please-version}

0 commit comments

Comments
 (0)