Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 5856985

Browse filesBrowse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#251)
* 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 e0fa41b commit 5856985
Copy full SHA for 5856985

File tree

Expand file treeCollapse file tree

12 files changed

+112
-109
lines changed
Filter options
Expand file treeCollapse file tree

12 files changed

+112
-109
lines changed

‎.coveragerc

Copy file name to clipboardExpand all lines: .coveragerc
-5Lines 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
+16Lines 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__ = "2.8.3" # {x-release-please-version}

‎google/cloud/recommender_v1/services/recommender/async_client.py

Copy file name to clipboardExpand all lines: google/cloud/recommender_v1/services/recommender/async_client.py
+17-21Lines changed: 17 additions & 21 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.recommender_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -251,7 +252,7 @@ async def list_insights(
251252
*,
252253
parent: Optional[str] = None,
253254
retry: OptionalRetry = gapic_v1.method.DEFAULT,
254-
timeout: Optional[float] = None,
255+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
255256
metadata: Sequence[Tuple[str, str]] = (),
256257
) -> pagers.ListInsightsAsyncPager:
257258
r"""Lists insights for the specified Cloud Resource. Requires the
@@ -392,7 +393,7 @@ async def get_insight(
392393
*,
393394
name: Optional[str] = None,
394395
retry: OptionalRetry = gapic_v1.method.DEFAULT,
395-
timeout: Optional[float] = None,
396+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
396397
metadata: Sequence[Tuple[str, str]] = (),
397398
) -> insight.Insight:
398399
r"""Gets the requested insight. Requires the recommender.*.get IAM
@@ -508,7 +509,7 @@ async def mark_insight_accepted(
508509
state_metadata: Optional[MutableMapping[str, str]] = None,
509510
etag: Optional[str] = None,
510511
retry: OptionalRetry = gapic_v1.method.DEFAULT,
511-
timeout: Optional[float] = None,
512+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
512513
metadata: Sequence[Tuple[str, str]] = (),
513514
) -> insight.Insight:
514515
r"""Marks the Insight State as Accepted. Users can use this method
@@ -640,7 +641,7 @@ async def list_recommendations(
640641
parent: Optional[str] = None,
641642
filter: Optional[str] = None,
642643
retry: OptionalRetry = gapic_v1.method.DEFAULT,
643-
timeout: Optional[float] = None,
644+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
644645
metadata: Sequence[Tuple[str, str]] = (),
645646
) -> pagers.ListRecommendationsAsyncPager:
646647
r"""Lists recommendations for the specified Cloud Resource. Requires
@@ -811,7 +812,7 @@ async def get_recommendation(
811812
*,
812813
name: Optional[str] = None,
813814
retry: OptionalRetry = gapic_v1.method.DEFAULT,
814-
timeout: Optional[float] = None,
815+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
815816
metadata: Sequence[Tuple[str, str]] = (),
816817
) -> recommendation.Recommendation:
817818
r"""Gets the requested recommendation. Requires the
@@ -928,7 +929,7 @@ async def mark_recommendation_claimed(
928929
state_metadata: Optional[MutableMapping[str, str]] = None,
929930
etag: Optional[str] = None,
930931
retry: OptionalRetry = gapic_v1.method.DEFAULT,
931-
timeout: Optional[float] = None,
932+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
932933
metadata: Sequence[Tuple[str, str]] = (),
933934
) -> recommendation.Recommendation:
934935
r"""Marks the Recommendation State as Claimed. Users can use this
@@ -1067,7 +1068,7 @@ async def mark_recommendation_succeeded(
10671068
state_metadata: Optional[MutableMapping[str, str]] = None,
10681069
etag: Optional[str] = None,
10691070
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1070-
timeout: Optional[float] = None,
1071+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10711072
metadata: Sequence[Tuple[str, str]] = (),
10721073
) -> recommendation.Recommendation:
10731074
r"""Marks the Recommendation State as Succeeded. Users can use this
@@ -1206,7 +1207,7 @@ async def mark_recommendation_failed(
12061207
state_metadata: Optional[MutableMapping[str, str]] = None,
12071208
etag: Optional[str] = None,
12081209
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1209-
timeout: Optional[float] = None,
1210+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12101211
metadata: Sequence[Tuple[str, str]] = (),
12111212
) -> recommendation.Recommendation:
12121213
r"""Marks the Recommendation State as Failed. Users can use this
@@ -1343,7 +1344,7 @@ async def get_recommender_config(
13431344
*,
13441345
name: Optional[str] = None,
13451346
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1346-
timeout: Optional[float] = None,
1347+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13471348
metadata: Sequence[Tuple[str, str]] = (),
13481349
) -> recommender_config.RecommenderConfig:
13491350
r"""Gets the requested Recommender Config. There is only
@@ -1454,7 +1455,7 @@ async def update_recommender_config(
14541455
recommender_config: Optional[gcr_recommender_config.RecommenderConfig] = None,
14551456
update_mask: Optional[field_mask_pb2.FieldMask] = None,
14561457
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1457-
timeout: Optional[float] = None,
1458+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14581459
metadata: Sequence[Tuple[str, str]] = (),
14591460
) -> gcr_recommender_config.RecommenderConfig:
14601461
r"""Updates a Recommender Config. This will create a new
@@ -1565,7 +1566,7 @@ async def get_insight_type_config(
15651566
*,
15661567
name: Optional[str] = None,
15671568
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1568-
timeout: Optional[float] = None,
1569+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15691570
metadata: Sequence[Tuple[str, str]] = (),
15701571
) -> insight_type_config.InsightTypeConfig:
15711572
r"""Gets the requested InsightTypeConfig. There is only
@@ -1676,7 +1677,7 @@ async def update_insight_type_config(
16761677
insight_type_config: Optional[gcr_insight_type_config.InsightTypeConfig] = None,
16771678
update_mask: Optional[field_mask_pb2.FieldMask] = None,
16781679
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1679-
timeout: Optional[float] = None,
1680+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16801681
metadata: Sequence[Tuple[str, str]] = (),
16811682
) -> gcr_insight_type_config.InsightTypeConfig:
16821683
r"""Updates an InsightTypeConfig change. This will create
@@ -1786,14 +1787,9 @@ async def __aexit__(self, exc_type, exc, tb):
17861787
await self.transport.close()
17871788

17881789

1789-
try:
1790-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1791-
gapic_version=pkg_resources.get_distribution(
1792-
"google-cloud-recommender",
1793-
).version,
1794-
)
1795-
except pkg_resources.DistributionNotFound:
1796-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1790+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1791+
gapic_version=package_version.__version__
1792+
)
17971793

17981794

17991795
__all__ = ("RecommenderAsyncClient",)

‎google/cloud/recommender_v1/services/recommender/client.py

Copy file name to clipboardExpand all lines: google/cloud/recommender_v1/services/recommender/client.py
+17-21Lines changed: 17 additions & 21 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.recommender_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -580,7 +581,7 @@ def list_insights(
580581
*,
581582
parent: Optional[str] = None,
582583
retry: OptionalRetry = gapic_v1.method.DEFAULT,
583-
timeout: Optional[float] = None,
584+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
584585
metadata: Sequence[Tuple[str, str]] = (),
585586
) -> pagers.ListInsightsPager:
586587
r"""Lists insights for the specified Cloud Resource. Requires the
@@ -711,7 +712,7 @@ def get_insight(
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
) -> insight.Insight:
717718
r"""Gets the requested insight. Requires the recommender.*.get IAM
@@ -817,7 +818,7 @@ def mark_insight_accepted(
817818
state_metadata: Optional[MutableMapping[str, str]] = None,
818819
etag: Optional[str] = None,
819820
retry: OptionalRetry = gapic_v1.method.DEFAULT,
820-
timeout: Optional[float] = None,
821+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
821822
metadata: Sequence[Tuple[str, str]] = (),
822823
) -> insight.Insight:
823824
r"""Marks the Insight State as Accepted. Users can use this method
@@ -948,7 +949,7 @@ def list_recommendations(
948949
parent: Optional[str] = None,
949950
filter: Optional[str] = None,
950951
retry: OptionalRetry = gapic_v1.method.DEFAULT,
951-
timeout: Optional[float] = None,
952+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
952953
metadata: Sequence[Tuple[str, str]] = (),
953954
) -> pagers.ListRecommendationsPager:
954955
r"""Lists recommendations for the specified Cloud Resource. Requires
@@ -1109,7 +1110,7 @@ def get_recommendation(
11091110
*,
11101111
name: Optional[str] = None,
11111112
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1112-
timeout: Optional[float] = None,
1113+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11131114
metadata: Sequence[Tuple[str, str]] = (),
11141115
) -> recommendation.Recommendation:
11151116
r"""Gets the requested recommendation. Requires the
@@ -1216,7 +1217,7 @@ def mark_recommendation_claimed(
12161217
state_metadata: Optional[MutableMapping[str, str]] = None,
12171218
etag: Optional[str] = None,
12181219
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1219-
timeout: Optional[float] = None,
1220+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12201221
metadata: Sequence[Tuple[str, str]] = (),
12211222
) -> recommendation.Recommendation:
12221223
r"""Marks the Recommendation State as Claimed. Users can use this
@@ -1358,7 +1359,7 @@ def mark_recommendation_succeeded(
13581359
state_metadata: Optional[MutableMapping[str, str]] = None,
13591360
etag: Optional[str] = None,
13601361
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1361-
timeout: Optional[float] = None,
1362+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13621363
metadata: Sequence[Tuple[str, str]] = (),
13631364
) -> recommendation.Recommendation:
13641365
r"""Marks the Recommendation State as Succeeded. Users can use this
@@ -1500,7 +1501,7 @@ def mark_recommendation_failed(
15001501
state_metadata: Optional[MutableMapping[str, str]] = None,
15011502
etag: Optional[str] = None,
15021503
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1503-
timeout: Optional[float] = None,
1504+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15041505
metadata: Sequence[Tuple[str, str]] = (),
15051506
) -> recommendation.Recommendation:
15061507
r"""Marks the Recommendation State as Failed. Users can use this
@@ -1638,7 +1639,7 @@ def get_recommender_config(
16381639
*,
16391640
name: Optional[str] = None,
16401641
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1641-
timeout: Optional[float] = None,
1642+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16421643
metadata: Sequence[Tuple[str, str]] = (),
16431644
) -> recommender_config.RecommenderConfig:
16441645
r"""Gets the requested Recommender Config. There is only
@@ -1749,7 +1750,7 @@ def update_recommender_config(
17491750
recommender_config: Optional[gcr_recommender_config.RecommenderConfig] = None,
17501751
update_mask: Optional[field_mask_pb2.FieldMask] = None,
17511752
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1752-
timeout: Optional[float] = None,
1753+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17531754
metadata: Sequence[Tuple[str, str]] = (),
17541755
) -> gcr_recommender_config.RecommenderConfig:
17551756
r"""Updates a Recommender Config. This will create a new
@@ -1862,7 +1863,7 @@ def get_insight_type_config(
18621863
*,
18631864
name: Optional[str] = None,
18641865
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1865-
timeout: Optional[float] = None,
1866+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18661867
metadata: Sequence[Tuple[str, str]] = (),
18671868
) -> insight_type_config.InsightTypeConfig:
18681869
r"""Gets the requested InsightTypeConfig. There is only
@@ -1973,7 +1974,7 @@ def update_insight_type_config(
19731974
insight_type_config: Optional[gcr_insight_type_config.InsightTypeConfig] = None,
19741975
update_mask: Optional[field_mask_pb2.FieldMask] = None,
19751976
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1976-
timeout: Optional[float] = None,
1977+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
19771978
metadata: Sequence[Tuple[str, str]] = (),
19781979
) -> gcr_insight_type_config.InsightTypeConfig:
19791980
r"""Updates an InsightTypeConfig change. This will create
@@ -2092,14 +2093,9 @@ def __exit__(self, type, value, traceback):
20922093
self.transport.close()
20932094

20942095

2095-
try:
2096-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2097-
gapic_version=pkg_resources.get_distribution(
2098-
"google-cloud-recommender",
2099-
).version,
2100-
)
2101-
except pkg_resources.DistributionNotFound:
2102-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
2096+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2097+
gapic_version=package_version.__version__
2098+
)
21032099

21042100

21052101
__all__ = ("RecommenderClient",)

‎google/cloud/recommender_v1/services/recommender/transports/base.py

Copy file name to clipboardExpand all lines: google/cloud/recommender_v1/services/recommender/transports/base.py
+4-9Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
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.recommender_v1 import gapic_version as package_version
2828
from google.cloud.recommender_v1.types import (
2929
insight_type_config as gcr_insight_type_config,
3030
)
@@ -37,14 +37,9 @@
3737
from google.cloud.recommender_v1.types import recommender_config
3838
from google.cloud.recommender_v1.types import recommender_service
3939

40-
try:
41-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
42-
gapic_version=pkg_resources.get_distribution(
43-
"google-cloud-recommender",
44-
).version,
45-
)
46-
except pkg_resources.DistributionNotFound:
47-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
40+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
41+
gapic_version=package_version.__version__
42+
)
4843

4944

5045
class RecommenderTransport(abc.ABC):
+16Lines 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__ = "2.8.3" # {x-release-please-version}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.