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

Commit f4997b1

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#252)
* 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 058966c commit f4997b1

File tree

12 files changed

+84
-81
lines changed

12 files changed

+84
-81
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.3" # {x-release-please-version}

google/cloud/billing/budgets_v1/services/budget_service/async_client.py

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -225,7 +226,7 @@ async def create_budget(
225226
parent: Optional[str] = None,
226227
budget: Optional[budget_model.Budget] = None,
227228
retry: OptionalRetry = gapic_v1.method.DEFAULT,
228-
timeout: Optional[float] = None,
229+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
229230
metadata: Sequence[Tuple[str, str]] = (),
230231
) -> budget_model.Budget:
231232
r"""Creates a new budget. See `Quotas and
@@ -345,7 +346,7 @@ async def update_budget(
345346
budget: Optional[budget_model.Budget] = None,
346347
update_mask: Optional[field_mask_pb2.FieldMask] = None,
347348
retry: OptionalRetry = gapic_v1.method.DEFAULT,
348-
timeout: Optional[float] = None,
349+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
349350
metadata: Sequence[Tuple[str, str]] = (),
350351
) -> budget_model.Budget:
351352
r"""Updates a budget and returns the updated budget.
@@ -482,7 +483,7 @@ async def get_budget(
482483
*,
483484
name: Optional[str] = None,
484485
retry: OptionalRetry = gapic_v1.method.DEFAULT,
485-
timeout: Optional[float] = None,
486+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
486487
metadata: Sequence[Tuple[str, str]] = (),
487488
) -> budget_model.Budget:
488489
r"""Returns a budget.
@@ -605,7 +606,7 @@ async def list_budgets(
605606
*,
606607
parent: Optional[str] = None,
607608
retry: OptionalRetry = gapic_v1.method.DEFAULT,
608-
timeout: Optional[float] = None,
609+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
609610
metadata: Sequence[Tuple[str, str]] = (),
610611
) -> pagers.ListBudgetsAsyncPager:
611612
r"""Returns a list of budgets for a billing account.
@@ -734,7 +735,7 @@ async def delete_budget(
734735
*,
735736
name: Optional[str] = None,
736737
retry: OptionalRetry = gapic_v1.method.DEFAULT,
737-
timeout: Optional[float] = None,
738+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
738739
metadata: Sequence[Tuple[str, str]] = (),
739740
) -> None:
740741
r"""Deletes a budget. Returns successfully if already
@@ -836,14 +837,9 @@ async def __aexit__(self, exc_type, exc, tb):
836837
await self.transport.close()
837838

838839

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

848844

849845
__all__ = ("BudgetServiceAsyncClient",)

google/cloud/billing/budgets_v1/services/budget_service/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -447,7 +448,7 @@ def create_budget(
447448
parent: Optional[str] = None,
448449
budget: Optional[budget_model.Budget] = None,
449450
retry: OptionalRetry = gapic_v1.method.DEFAULT,
450-
timeout: Optional[float] = None,
451+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
451452
metadata: Sequence[Tuple[str, str]] = (),
452453
) -> budget_model.Budget:
453454
r"""Creates a new budget. See `Quotas and
@@ -567,7 +568,7 @@ def update_budget(
567568
budget: Optional[budget_model.Budget] = None,
568569
update_mask: Optional[field_mask_pb2.FieldMask] = None,
569570
retry: OptionalRetry = gapic_v1.method.DEFAULT,
570-
timeout: Optional[float] = None,
571+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
571572
metadata: Sequence[Tuple[str, str]] = (),
572573
) -> budget_model.Budget:
573574
r"""Updates a budget and returns the updated budget.
@@ -694,7 +695,7 @@ def get_budget(
694695
*,
695696
name: Optional[str] = None,
696697
retry: OptionalRetry = gapic_v1.method.DEFAULT,
697-
timeout: Optional[float] = None,
698+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
698699
metadata: Sequence[Tuple[str, str]] = (),
699700
) -> budget_model.Budget:
700701
r"""Returns a budget.
@@ -807,7 +808,7 @@ def list_budgets(
807808
*,
808809
parent: Optional[str] = None,
809810
retry: OptionalRetry = gapic_v1.method.DEFAULT,
810-
timeout: Optional[float] = None,
811+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
811812
metadata: Sequence[Tuple[str, str]] = (),
812813
) -> pagers.ListBudgetsPager:
813814
r"""Returns a list of budgets for a billing account.
@@ -926,7 +927,7 @@ def delete_budget(
926927
*,
927928
name: Optional[str] = None,
928929
retry: OptionalRetry = gapic_v1.method.DEFAULT,
929-
timeout: Optional[float] = None,
930+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
930931
metadata: Sequence[Tuple[str, str]] = (),
931932
) -> None:
932933
r"""Deletes a budget. Returns successfully if already
@@ -1025,14 +1026,9 @@ def __exit__(self, type, value, traceback):
10251026
self.transport.close()
10261027

10271028

1028-
try:
1029-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1030-
gapic_version=pkg_resources.get_distribution(
1031-
"google-cloud-billing-budgets",
1032-
).version,
1033-
)
1034-
except pkg_resources.DistributionNotFound:
1035-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1029+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1030+
gapic_version=package_version.__version__
1031+
)
10361032

10371033

10381034
__all__ = ("BudgetServiceClient",)

google/cloud/billing/budgets_v1/services/budget_service/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.billing.budgets_v1 import gapic_version as package_version
2929
from google.cloud.billing.budgets_v1.types import budget_model, budget_service
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-billing-budgets",
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 BudgetServiceTransport(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.3" # {x-release-please-version}

google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -221,7 +222,7 @@ async def create_budget(
221222
request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None,
222223
*,
223224
retry: OptionalRetry = gapic_v1.method.DEFAULT,
224-
timeout: Optional[float] = None,
225+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
225226
metadata: Sequence[Tuple[str, str]] = (),
226227
) -> budget_model.Budget:
227228
r"""Creates a new budget. See `Quotas and
@@ -310,7 +311,7 @@ async def update_budget(
310311
request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None,
311312
*,
312313
retry: OptionalRetry = gapic_v1.method.DEFAULT,
313-
timeout: Optional[float] = None,
314+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
314315
metadata: Sequence[Tuple[str, str]] = (),
315316
) -> budget_model.Budget:
316317
r"""Updates a budget and returns the updated budget.
@@ -411,7 +412,7 @@ async def get_budget(
411412
request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None,
412413
*,
413414
retry: OptionalRetry = gapic_v1.method.DEFAULT,
414-
timeout: Optional[float] = None,
415+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
415416
metadata: Sequence[Tuple[str, str]] = (),
416417
) -> budget_model.Budget:
417418
r"""Returns a budget.
@@ -512,7 +513,7 @@ async def list_budgets(
512513
request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None,
513514
*,
514515
retry: OptionalRetry = gapic_v1.method.DEFAULT,
515-
timeout: Optional[float] = None,
516+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
516517
metadata: Sequence[Tuple[str, str]] = (),
517518
) -> pagers.ListBudgetsAsyncPager:
518519
r"""Returns a list of budgets for a billing account.
@@ -618,7 +619,7 @@ async def delete_budget(
618619
request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None,
619620
*,
620621
retry: OptionalRetry = gapic_v1.method.DEFAULT,
621-
timeout: Optional[float] = None,
622+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
622623
metadata: Sequence[Tuple[str, str]] = (),
623624
) -> None:
624625
r"""Deletes a budget. Returns successfully if already
@@ -698,14 +699,9 @@ async def __aexit__(self, exc_type, exc, tb):
698699
await self.transport.close()
699700

700701

701-
try:
702-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
703-
gapic_version=pkg_resources.get_distribution(
704-
"google-cloud-billing-budgets",
705-
).version,
706-
)
707-
except pkg_resources.DistributionNotFound:
708-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
702+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
703+
gapic_version=package_version.__version__
704+
)
709705

710706

711707
__all__ = ("BudgetServiceAsyncClient",)

google/cloud/billing/budgets_v1beta1/services/budget_service/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -443,7 +444,7 @@ def create_budget(
443444
request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None,
444445
*,
445446
retry: OptionalRetry = gapic_v1.method.DEFAULT,
446-
timeout: Optional[float] = None,
447+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
447448
metadata: Sequence[Tuple[str, str]] = (),
448449
) -> budget_model.Budget:
449450
r"""Creates a new budget. See `Quotas and
@@ -533,7 +534,7 @@ def update_budget(
533534
request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None,
534535
*,
535536
retry: OptionalRetry = gapic_v1.method.DEFAULT,
536-
timeout: Optional[float] = None,
537+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
537538
metadata: Sequence[Tuple[str, str]] = (),
538539
) -> budget_model.Budget:
539540
r"""Updates a budget and returns the updated budget.
@@ -625,7 +626,7 @@ def get_budget(
625626
request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None,
626627
*,
627628
retry: OptionalRetry = gapic_v1.method.DEFAULT,
628-
timeout: Optional[float] = None,
629+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
629630
metadata: Sequence[Tuple[str, str]] = (),
630631
) -> budget_model.Budget:
631632
r"""Returns a budget.
@@ -717,7 +718,7 @@ def list_budgets(
717718
request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None,
718719
*,
719720
retry: OptionalRetry = gapic_v1.method.DEFAULT,
720-
timeout: Optional[float] = None,
721+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
721722
metadata: Sequence[Tuple[str, str]] = (),
722723
) -> pagers.ListBudgetsPager:
723724
r"""Returns a list of budgets for a billing account.
@@ -814,7 +815,7 @@ def delete_budget(
814815
request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None,
815816
*,
816817
retry: OptionalRetry = gapic_v1.method.DEFAULT,
817-
timeout: Optional[float] = None,
818+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
818819
metadata: Sequence[Tuple[str, str]] = (),
819820
) -> None:
820821
r"""Deletes a budget. Returns successfully if already
@@ -892,14 +893,9 @@ def __exit__(self, type, value, traceback):
892893
self.transport.close()
893894

894895

895-
try:
896-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
897-
gapic_version=pkg_resources.get_distribution(
898-
"google-cloud-billing-budgets",
899-
).version,
900-
)
901-
except pkg_resources.DistributionNotFound:
902-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
896+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
897+
gapic_version=package_version.__version__
898+
)
903899

904900

905901
__all__ = ("BudgetServiceClient",)

google/cloud/billing/budgets_v1beta1/services/budget_service/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.billing.budgets_v1beta1 import gapic_version as package_version
2929
from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-billing-budgets",
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 BudgetServiceTransport(abc.ABC):

release-please-config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
".": {
55
"release-type": "python",
66
"extra-files": [
7+
"google/cloud/billing/budgets_v1/gapic_version.py",
78
"google/cloud/billing/budgets/gapic_version.py",
9+
"google/cloud/billing/budgets_v1beta1/gapic_version.py",
810
{
911
"type": "json",
1012
"path": "samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json",

0 commit comments

Comments
 (0)