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

Commit 8a0a4b6

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#349)
* 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 17a5190 commit 8a0a4b6

File tree

6 files changed

+39
-40
lines changed

6 files changed

+39
-40
lines changed

.coveragerc

-5
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
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__ = "2.9.3" # {x-release-please-version}

google/cloud/devtools/containeranalysis_v1/services/container_analysis/async_client.py

+9-13
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.devtools.containeranalysis_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -250,7 +251,7 @@ async def set_iam_policy(
250251
*,
251252
resource: Optional[str] = None,
252253
retry: OptionalRetry = gapic_v1.method.DEFAULT,
253-
timeout: Optional[float] = None,
254+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
254255
metadata: Sequence[Tuple[str, str]] = (),
255256
) -> policy_pb2.Policy:
256257
r"""Sets the access control policy on the specified note or
@@ -424,7 +425,7 @@ async def get_iam_policy(
424425
*,
425426
resource: Optional[str] = None,
426427
retry: OptionalRetry = gapic_v1.method.DEFAULT,
427-
timeout: Optional[float] = None,
428+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
428429
metadata: Sequence[Tuple[str, str]] = (),
429430
) -> policy_pb2.Policy:
430431
r"""Gets the access control policy for a note or an occurrence
@@ -599,7 +600,7 @@ async def test_iam_permissions(
599600
resource: Optional[str] = None,
600601
permissions: Optional[MutableSequence[str]] = None,
601602
retry: OptionalRetry = gapic_v1.method.DEFAULT,
602-
timeout: Optional[float] = None,
603+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
603604
metadata: Sequence[Tuple[str, str]] = (),
604605
) -> iam_policy_pb2.TestIamPermissionsResponse:
605606
r"""Returns the permissions that a caller has on the specified note
@@ -725,7 +726,7 @@ async def get_vulnerability_occurrences_summary(
725726
parent: Optional[str] = None,
726727
filter: Optional[str] = None,
727728
retry: OptionalRetry = gapic_v1.method.DEFAULT,
728-
timeout: Optional[float] = None,
729+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
729730
metadata: Sequence[Tuple[str, str]] = (),
730731
) -> containeranalysis.VulnerabilityOccurrencesSummary:
731732
r"""Gets a summary of the number and severity of
@@ -837,14 +838,9 @@ async def __aexit__(self, exc_type, exc, tb):
837838
await self.transport.close()
838839

839840

840-
try:
841-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
842-
gapic_version=pkg_resources.get_distribution(
843-
"google-cloud-containeranalysis",
844-
).version,
845-
)
846-
except pkg_resources.DistributionNotFound:
847-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
841+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
842+
gapic_version=package_version.__version__
843+
)
848844

849845

850846
__all__ = ("ContainerAnalysisAsyncClient",)

google/cloud/devtools/containeranalysis_v1/services/container_analysis/client.py

+9-13
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.devtools.containeranalysis_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -457,7 +458,7 @@ def set_iam_policy(
457458
*,
458459
resource: Optional[str] = None,
459460
retry: OptionalRetry = gapic_v1.method.DEFAULT,
460-
timeout: Optional[float] = None,
461+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
461462
metadata: Sequence[Tuple[str, str]] = (),
462463
) -> policy_pb2.Policy:
463464
r"""Sets the access control policy on the specified note or
@@ -628,7 +629,7 @@ def get_iam_policy(
628629
*,
629630
resource: Optional[str] = None,
630631
retry: OptionalRetry = gapic_v1.method.DEFAULT,
631-
timeout: Optional[float] = None,
632+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
632633
metadata: Sequence[Tuple[str, str]] = (),
633634
) -> policy_pb2.Policy:
634635
r"""Gets the access control policy for a note or an occurrence
@@ -800,7 +801,7 @@ def test_iam_permissions(
800801
resource: Optional[str] = None,
801802
permissions: Optional[MutableSequence[str]] = None,
802803
retry: OptionalRetry = gapic_v1.method.DEFAULT,
803-
timeout: Optional[float] = None,
804+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
804805
metadata: Sequence[Tuple[str, str]] = (),
805806
) -> iam_policy_pb2.TestIamPermissionsResponse:
806807
r"""Returns the permissions that a caller has on the specified note
@@ -924,7 +925,7 @@ def get_vulnerability_occurrences_summary(
924925
parent: Optional[str] = None,
925926
filter: Optional[str] = None,
926927
retry: OptionalRetry = gapic_v1.method.DEFAULT,
927-
timeout: Optional[float] = None,
928+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
928929
metadata: Sequence[Tuple[str, str]] = (),
929930
) -> containeranalysis.VulnerabilityOccurrencesSummary:
930931
r"""Gets a summary of the number and severity of
@@ -1049,14 +1050,9 @@ def __exit__(self, type, value, traceback):
10491050
self.transport.close()
10501051

10511052

1052-
try:
1053-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1054-
gapic_version=pkg_resources.get_distribution(
1055-
"google-cloud-containeranalysis",
1056-
).version,
1057-
)
1058-
except pkg_resources.DistributionNotFound:
1059-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1053+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1054+
gapic_version=package_version.__version__
1055+
)
10601056

10611057

10621058
__all__ = ("ContainerAnalysisClient",)

google/cloud/devtools/containeranalysis_v1/services/container_analysis/transports/base.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@
2525
from google.iam.v1 import iam_policy_pb2 # type: ignore
2626
from google.iam.v1 import policy_pb2 # type: ignore
2727
from google.oauth2 import service_account # type: ignore
28-
import pkg_resources
2928

29+
from google.cloud.devtools.containeranalysis_v1 import gapic_version as package_version
3030
from google.cloud.devtools.containeranalysis_v1.types import containeranalysis
3131

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

4136

4237
class ContainerAnalysisTransport(abc.ABC):

release-please-config.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"release-type": "python",
66
"extra-files": [
77
"google/cloud/devtools/containeranalysis/gapic_version.py",
8+
"google/cloud/devtools/containeranalysis_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.devtools.containeranalysis.v1.json",

0 commit comments

Comments
 (0)