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

Commit b3128a5

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#192)
* 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 <[email protected]>
1 parent ec6204b commit b3128a5

File tree

20 files changed

+139
-175
lines changed

20 files changed

+139
-175
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.3.3" # {x-release-please-version}

google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/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.binaryauthorization_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -243,7 +244,7 @@ async def get_policy(
243244
*,
244245
name: Optional[str] = None,
245246
retry: OptionalRetry = gapic_v1.method.DEFAULT,
246-
timeout: Optional[float] = None,
247+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
247248
metadata: Sequence[Tuple[str, str]] = (),
248249
) -> resources.Policy:
249250
r"""A [policy][google.cloud.binaryauthorization.v1.Policy] specifies
@@ -366,7 +367,7 @@ async def update_policy(
366367
*,
367368
policy: Optional[resources.Policy] = None,
368369
retry: OptionalRetry = gapic_v1.method.DEFAULT,
369-
timeout: Optional[float] = None,
370+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
370371
metadata: Sequence[Tuple[str, str]] = (),
371372
) -> resources.Policy:
372373
r"""Creates or updates a project's
@@ -497,7 +498,7 @@ async def create_attestor(
497498
attestor_id: Optional[str] = None,
498499
attestor: Optional[resources.Attestor] = None,
499500
retry: OptionalRetry = gapic_v1.method.DEFAULT,
500-
timeout: Optional[float] = None,
501+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
501502
metadata: Sequence[Tuple[str, str]] = (),
502503
) -> resources.Attestor:
503504
r"""Creates an
@@ -636,7 +637,7 @@ async def get_attestor(
636637
*,
637638
name: Optional[str] = None,
638639
retry: OptionalRetry = gapic_v1.method.DEFAULT,
639-
timeout: Optional[float] = None,
640+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
640641
metadata: Sequence[Tuple[str, str]] = (),
641642
) -> resources.Attestor:
642643
r"""Gets an
@@ -754,7 +755,7 @@ async def update_attestor(
754755
*,
755756
attestor: Optional[resources.Attestor] = None,
756757
retry: OptionalRetry = gapic_v1.method.DEFAULT,
757-
timeout: Optional[float] = None,
758+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
758759
metadata: Sequence[Tuple[str, str]] = (),
759760
) -> resources.Attestor:
760761
r"""Updates an
@@ -881,7 +882,7 @@ async def list_attestors(
881882
*,
882883
parent: Optional[str] = None,
883884
retry: OptionalRetry = gapic_v1.method.DEFAULT,
884-
timeout: Optional[float] = None,
885+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
885886
metadata: Sequence[Tuple[str, str]] = (),
886887
) -> pagers.ListAttestorsAsyncPager:
887888
r"""Lists [attestors][google.cloud.binaryauthorization.v1.Attestor].
@@ -1009,7 +1010,7 @@ async def delete_attestor(
10091010
*,
10101011
name: Optional[str] = None,
10111012
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1012-
timeout: Optional[float] = None,
1013+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10131014
metadata: Sequence[Tuple[str, str]] = (),
10141015
) -> None:
10151016
r"""Deletes an
@@ -1115,14 +1116,9 @@ async def __aexit__(self, exc_type, exc, tb):
11151116
await self.transport.close()
11161117

11171118

1118-
try:
1119-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1120-
gapic_version=pkg_resources.get_distribution(
1121-
"google-cloud-binary-authorization",
1122-
).version,
1123-
)
1124-
except pkg_resources.DistributionNotFound:
1125-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1119+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1120+
gapic_version=package_version.__version__
1121+
)
11261122

11271123

11281124
__all__ = ("BinauthzManagementServiceV1AsyncClient",)

google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/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.binaryauthorization_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -471,7 +472,7 @@ def get_policy(
471472
*,
472473
name: Optional[str] = None,
473474
retry: OptionalRetry = gapic_v1.method.DEFAULT,
474-
timeout: Optional[float] = None,
475+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
475476
metadata: Sequence[Tuple[str, str]] = (),
476477
) -> resources.Policy:
477478
r"""A [policy][google.cloud.binaryauthorization.v1.Policy] specifies
@@ -584,7 +585,7 @@ def update_policy(
584585
*,
585586
policy: Optional[resources.Policy] = None,
586587
retry: OptionalRetry = gapic_v1.method.DEFAULT,
587-
timeout: Optional[float] = None,
588+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
588589
metadata: Sequence[Tuple[str, str]] = (),
589590
) -> resources.Policy:
590591
r"""Creates or updates a project's
@@ -705,7 +706,7 @@ def create_attestor(
705706
attestor_id: Optional[str] = None,
706707
attestor: Optional[resources.Attestor] = None,
707708
retry: OptionalRetry = gapic_v1.method.DEFAULT,
708-
timeout: Optional[float] = None,
709+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
709710
metadata: Sequence[Tuple[str, str]] = (),
710711
) -> resources.Attestor:
711712
r"""Creates an
@@ -844,7 +845,7 @@ def get_attestor(
844845
*,
845846
name: Optional[str] = None,
846847
retry: OptionalRetry = gapic_v1.method.DEFAULT,
847-
timeout: Optional[float] = None,
848+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
848849
metadata: Sequence[Tuple[str, str]] = (),
849850
) -> resources.Attestor:
850851
r"""Gets an
@@ -952,7 +953,7 @@ def update_attestor(
952953
*,
953954
attestor: Optional[resources.Attestor] = None,
954955
retry: OptionalRetry = gapic_v1.method.DEFAULT,
955-
timeout: Optional[float] = None,
956+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
956957
metadata: Sequence[Tuple[str, str]] = (),
957958
) -> resources.Attestor:
958959
r"""Updates an
@@ -1069,7 +1070,7 @@ def list_attestors(
10691070
*,
10701071
parent: Optional[str] = None,
10711072
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1072-
timeout: Optional[float] = None,
1073+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10731074
metadata: Sequence[Tuple[str, str]] = (),
10741075
) -> pagers.ListAttestorsPager:
10751076
r"""Lists [attestors][google.cloud.binaryauthorization.v1.Attestor].
@@ -1187,7 +1188,7 @@ def delete_attestor(
11871188
*,
11881189
name: Optional[str] = None,
11891190
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1190-
timeout: Optional[float] = None,
1191+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11911192
metadata: Sequence[Tuple[str, str]] = (),
11921193
) -> None:
11931194
r"""Deletes an
@@ -1290,14 +1291,9 @@ def __exit__(self, type, value, traceback):
12901291
self.transport.close()
12911292

12921293

1293-
try:
1294-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1295-
gapic_version=pkg_resources.get_distribution(
1296-
"google-cloud-binary-authorization",
1297-
).version,
1298-
)
1299-
except pkg_resources.DistributionNotFound:
1300-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1294+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1295+
gapic_version=package_version.__version__
1296+
)
13011297

13021298

13031299
__all__ = ("BinauthzManagementServiceV1Client",)

google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@
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.binaryauthorization_v1 import gapic_version as package_version
2929
from google.cloud.binaryauthorization_v1.types import resources, service
3030

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

4035

4136
class BinauthzManagementServiceV1Transport(abc.ABC):

google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py

Lines changed: 6 additions & 10 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.binaryauthorization_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -220,7 +221,7 @@ async def get_system_policy(
220221
*,
221222
name: 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
) -> resources.Policy:
226227
r"""Gets the current system policy in the specified
@@ -325,14 +326,9 @@ async def __aexit__(self, exc_type, exc, tb):
325326
await self.transport.close()
326327

327328

328-
try:
329-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
330-
gapic_version=pkg_resources.get_distribution(
331-
"google-cloud-binary-authorization",
332-
).version,
333-
)
334-
except pkg_resources.DistributionNotFound:
335-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
329+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
330+
gapic_version=package_version.__version__
331+
)
336332

337333

338334
__all__ = ("SystemPolicyV1AsyncClient",)

google/cloud/binaryauthorization_v1/services/system_policy_v1/client.py

Lines changed: 6 additions & 10 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.binaryauthorization_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -440,7 +441,7 @@ def get_system_policy(
440441
*,
441442
name: Optional[str] = None,
442443
retry: OptionalRetry = gapic_v1.method.DEFAULT,
443-
timeout: Optional[float] = None,
444+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
444445
metadata: Sequence[Tuple[str, str]] = (),
445446
) -> resources.Policy:
446447
r"""Gets the current system policy in the specified
@@ -552,14 +553,9 @@ def __exit__(self, type, value, traceback):
552553
self.transport.close()
553554

554555

555-
try:
556-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
557-
gapic_version=pkg_resources.get_distribution(
558-
"google-cloud-binary-authorization",
559-
).version,
560-
)
561-
except pkg_resources.DistributionNotFound:
562-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
556+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
557+
gapic_version=package_version.__version__
558+
)
563559

564560

565561
__all__ = ("SystemPolicyV1Client",)

google/cloud/binaryauthorization_v1/services/system_policy_v1/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.binaryauthorization_v1 import gapic_version as package_version
2828
from google.cloud.binaryauthorization_v1.types import resources, service
2929

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-binary-authorization",
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 SystemPolicyV1Transport(abc.ABC):

google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py

Lines changed: 6 additions & 10 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.binaryauthorization_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -218,7 +219,7 @@ async def validate_attestation_occurrence(
218219
] = None,
219220
*,
220221
retry: OptionalRetry = gapic_v1.method.DEFAULT,
221-
timeout: Optional[float] = None,
222+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
222223
metadata: Sequence[Tuple[str, str]] = (),
223224
) -> service.ValidateAttestationOccurrenceResponse:
224225
r"""Returns whether the given Attestation for the given
@@ -303,14 +304,9 @@ async def __aexit__(self, exc_type, exc, tb):
303304
await self.transport.close()
304305

305306

306-
try:
307-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
308-
gapic_version=pkg_resources.get_distribution(
309-
"google-cloud-binary-authorization",
310-
).version,
311-
)
312-
except pkg_resources.DistributionNotFound:
313-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
307+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
308+
gapic_version=package_version.__version__
309+
)
314310

315311

316312
__all__ = ("ValidationHelperV1AsyncClient",)

0 commit comments

Comments
 (0)