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

Commit 4398da3

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#166)
* 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 448ec75 commit 4398da3

File tree

8 files changed

+35
-36
lines changed

8 files changed

+35
-36
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.5.4" # {x-release-please-version}

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -212,7 +213,7 @@ async def troubleshoot_iam_policy(
212213
request: Optional[Union[checker.TroubleshootIamPolicyRequest, dict]] = None,
213214
*,
214215
retry: OptionalRetry = gapic_v1.method.DEFAULT,
215-
timeout: Optional[float] = None,
216+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
216217
metadata: Sequence[Tuple[str, str]] = (),
217218
) -> checker.TroubleshootIamPolicyResponse:
218219
r"""Checks whether a member has a specific permission for
@@ -289,14 +290,9 @@ async def __aexit__(self, exc_type, exc, tb):
289290
await self.transport.close()
290291

291292

292-
try:
293-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
294-
gapic_version=pkg_resources.get_distribution(
295-
"google-cloud-policy-troubleshooter",
296-
).version,
297-
)
298-
except pkg_resources.DistributionNotFound:
299-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
293+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
294+
gapic_version=package_version.__version__
295+
)
300296

301297

302298
__all__ = ("IamCheckerAsyncClient",)

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -423,7 +424,7 @@ def troubleshoot_iam_policy(
423424
request: Optional[Union[checker.TroubleshootIamPolicyRequest, dict]] = None,
424425
*,
425426
retry: OptionalRetry = gapic_v1.method.DEFAULT,
426-
timeout: Optional[float] = None,
427+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
427428
metadata: Sequence[Tuple[str, str]] = (),
428429
) -> checker.TroubleshootIamPolicyResponse:
429430
r"""Checks whether a member has a specific permission for
@@ -508,14 +509,9 @@ def __exit__(self, type, value, traceback):
508509
self.transport.close()
509510

510511

511-
try:
512-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
513-
gapic_version=pkg_resources.get_distribution(
514-
"google-cloud-policy-troubleshooter",
515-
).version,
516-
)
517-
except pkg_resources.DistributionNotFound:
518-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
512+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
513+
gapic_version=package_version.__version__
514+
)
519515

520516

521517
__all__ = ("IamCheckerClient",)

google/cloud/policytroubleshooter_v1/services/iam_checker/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.policytroubleshooter_v1 import gapic_version as package_version
2828
from google.cloud.policytroubleshooter_v1.types import checker
2929

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

release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
".": {
55
"release-type": "python",
66
"extra-files": [
7+
"google/cloud/policytroubleshooter_v1/gapic_version.py",
78
"google/cloud/policytroubleshooter/gapic_version.py",
89
{
910
"type": "json",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
release_status = "Development Status :: 5 - Production/Stable"
3939

4040
dependencies = [
41-
"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.*",
41+
"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.*",
4242
"proto-plus >= 1.22.0, <2.0.0dev",
4343
"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",
4444
"grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev",

testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Pin the version to the lower bound.
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
7-
google-api-core==1.33.2
7+
google-api-core==1.34.0
88
proto-plus==1.22.0
99
protobuf==3.19.5
1010
grpc-google-iam-v1==0.12.4

0 commit comments

Comments
 (0)