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

Commit f3dc6f9

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#140)
* 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 * fix(deps): require google-api-core>=1.34.0,>=2.11.0 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 78ffd89 commit f3dc6f9

File tree

11 files changed

+63
-77
lines changed

11 files changed

+63
-77
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.4.3" # {x-release-please-version}

google/cloud/debugger_v2/services/controller2/async_client.py

Lines changed: 8 additions & 12 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.debugger_v2 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -234,7 +235,7 @@ async def register_debuggee(
234235
*,
235236
debuggee: Optional[data.Debuggee] = None,
236237
retry: OptionalRetry = gapic_v1.method.DEFAULT,
237-
timeout: Optional[float] = None,
238+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
238239
metadata: Sequence[Tuple[str, str]] = (),
239240
) -> controller.RegisterDebuggeeResponse:
240241
r"""Registers the debuggee with the controller service.
@@ -338,7 +339,7 @@ async def list_active_breakpoints(
338339
*,
339340
debuggee_id: Optional[str] = None,
340341
retry: OptionalRetry = gapic_v1.method.DEFAULT,
341-
timeout: Optional[float] = None,
342+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
342343
metadata: Sequence[Tuple[str, str]] = (),
343344
) -> controller.ListActiveBreakpointsResponse:
344345
r"""Returns the list of all active breakpoints for the debuggee.
@@ -463,7 +464,7 @@ async def update_active_breakpoint(
463464
debuggee_id: Optional[str] = None,
464465
breakpoint_: Optional[data.Breakpoint] = None,
465466
retry: OptionalRetry = gapic_v1.method.DEFAULT,
466-
timeout: Optional[float] = None,
467+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
467468
metadata: Sequence[Tuple[str, str]] = (),
468469
) -> controller.UpdateActiveBreakpointResponse:
469470
r"""Updates the breakpoint state or mutable fields. The entire
@@ -600,14 +601,9 @@ async def __aexit__(self, exc_type, exc, tb):
600601
await self.transport.close()
601602

602603

603-
try:
604-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
605-
gapic_version=pkg_resources.get_distribution(
606-
"google-cloud-debugger-client",
607-
).version,
608-
)
609-
except pkg_resources.DistributionNotFound:
610-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
604+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
605+
gapic_version=package_version.__version__
606+
)
611607

612608

613609
__all__ = ("Controller2AsyncClient",)

google/cloud/debugger_v2/services/controller2/client.py

Lines changed: 8 additions & 12 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.debugger_v2 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -443,7 +444,7 @@ def register_debuggee(
443444
*,
444445
debuggee: Optional[data.Debuggee] = None,
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
) -> controller.RegisterDebuggeeResponse:
449450
r"""Registers the debuggee with the controller service.
@@ -547,7 +548,7 @@ def list_active_breakpoints(
547548
*,
548549
debuggee_id: Optional[str] = None,
549550
retry: OptionalRetry = gapic_v1.method.DEFAULT,
550-
timeout: Optional[float] = None,
551+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
551552
metadata: Sequence[Tuple[str, str]] = (),
552553
) -> controller.ListActiveBreakpointsResponse:
553554
r"""Returns the list of all active breakpoints for the debuggee.
@@ -662,7 +663,7 @@ def update_active_breakpoint(
662663
debuggee_id: Optional[str] = None,
663664
breakpoint_: Optional[data.Breakpoint] = None,
664665
retry: OptionalRetry = gapic_v1.method.DEFAULT,
665-
timeout: Optional[float] = None,
666+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
666667
metadata: Sequence[Tuple[str, str]] = (),
667668
) -> controller.UpdateActiveBreakpointResponse:
668669
r"""Updates the breakpoint state or mutable fields. The entire
@@ -796,14 +797,9 @@ def __exit__(self, type, value, traceback):
796797
self.transport.close()
797798

798799

799-
try:
800-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
801-
gapic_version=pkg_resources.get_distribution(
802-
"google-cloud-debugger-client",
803-
).version,
804-
)
805-
except pkg_resources.DistributionNotFound:
806-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
800+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
801+
gapic_version=package_version.__version__
802+
)
807803

808804

809805
__all__ = ("Controller2Client",)

google/cloud/debugger_v2/services/controller2/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.debugger_v2 import gapic_version as package_version
2828
from google.cloud.debugger_v2.types import controller
2929

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

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -225,7 +226,7 @@ async def set_breakpoint(
225226
breakpoint_: Optional[data.Breakpoint] = None,
226227
client_version: Optional[str] = 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
) -> debugger.SetBreakpointResponse:
231232
r"""Sets the breakpoint to the debuggee.
@@ -348,7 +349,7 @@ async def get_breakpoint(
348349
breakpoint_id: Optional[str] = None,
349350
client_version: Optional[str] = None,
350351
retry: OptionalRetry = gapic_v1.method.DEFAULT,
351-
timeout: Optional[float] = None,
352+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
352353
metadata: Sequence[Tuple[str, str]] = (),
353354
) -> debugger.GetBreakpointResponse:
354355
r"""Gets breakpoint information.
@@ -488,7 +489,7 @@ async def delete_breakpoint(
488489
breakpoint_id: Optional[str] = None,
489490
client_version: Optional[str] = None,
490491
retry: OptionalRetry = gapic_v1.method.DEFAULT,
491-
timeout: Optional[float] = None,
492+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
492493
metadata: Sequence[Tuple[str, str]] = (),
493494
) -> None:
494495
r"""Deletes the breakpoint from the debuggee.
@@ -614,7 +615,7 @@ async def list_breakpoints(
614615
debuggee_id: Optional[str] = None,
615616
client_version: Optional[str] = None,
616617
retry: OptionalRetry = gapic_v1.method.DEFAULT,
617-
timeout: Optional[float] = None,
618+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
618619
metadata: Sequence[Tuple[str, str]] = (),
619620
) -> debugger.ListBreakpointsResponse:
620621
r"""Lists all breakpoints for the debuggee.
@@ -737,7 +738,7 @@ async def list_debuggees(
737738
project: Optional[str] = None,
738739
client_version: Optional[str] = None,
739740
retry: OptionalRetry = gapic_v1.method.DEFAULT,
740-
timeout: Optional[float] = None,
741+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
741742
metadata: Sequence[Tuple[str, str]] = (),
742743
) -> debugger.ListDebuggeesResponse:
743744
r"""Lists all the debuggees that the user has access to.
@@ -852,14 +853,9 @@ async def __aexit__(self, exc_type, exc, tb):
852853
await self.transport.close()
853854

854855

855-
try:
856-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
857-
gapic_version=pkg_resources.get_distribution(
858-
"google-cloud-debugger-client",
859-
).version,
860-
)
861-
except pkg_resources.DistributionNotFound:
862-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
856+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
857+
gapic_version=package_version.__version__
858+
)
863859

864860

865861
__all__ = ("Debugger2AsyncClient",)

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -436,7 +437,7 @@ def set_breakpoint(
436437
breakpoint_: Optional[data.Breakpoint] = None,
437438
client_version: Optional[str] = None,
438439
retry: OptionalRetry = gapic_v1.method.DEFAULT,
439-
timeout: Optional[float] = None,
440+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
440441
metadata: Sequence[Tuple[str, str]] = (),
441442
) -> debugger.SetBreakpointResponse:
442443
r"""Sets the breakpoint to the debuggee.
@@ -559,7 +560,7 @@ def get_breakpoint(
559560
breakpoint_id: Optional[str] = None,
560561
client_version: Optional[str] = None,
561562
retry: OptionalRetry = gapic_v1.method.DEFAULT,
562-
timeout: Optional[float] = None,
563+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
563564
metadata: Sequence[Tuple[str, str]] = (),
564565
) -> debugger.GetBreakpointResponse:
565566
r"""Gets breakpoint information.
@@ -689,7 +690,7 @@ def delete_breakpoint(
689690
breakpoint_id: Optional[str] = None,
690691
client_version: Optional[str] = None,
691692
retry: OptionalRetry = gapic_v1.method.DEFAULT,
692-
timeout: Optional[float] = None,
693+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
693694
metadata: Sequence[Tuple[str, str]] = (),
694695
) -> None:
695696
r"""Deletes the breakpoint from the debuggee.
@@ -805,7 +806,7 @@ def list_breakpoints(
805806
debuggee_id: Optional[str] = None,
806807
client_version: Optional[str] = None,
807808
retry: OptionalRetry = gapic_v1.method.DEFAULT,
808-
timeout: Optional[float] = None,
809+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
809810
metadata: Sequence[Tuple[str, str]] = (),
810811
) -> debugger.ListBreakpointsResponse:
811812
r"""Lists all breakpoints for the debuggee.
@@ -918,7 +919,7 @@ def list_debuggees(
918919
project: Optional[str] = None,
919920
client_version: Optional[str] = None,
920921
retry: OptionalRetry = gapic_v1.method.DEFAULT,
921-
timeout: Optional[float] = None,
922+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
922923
metadata: Sequence[Tuple[str, str]] = (),
923924
) -> debugger.ListDebuggeesResponse:
924925
r"""Lists all the debuggees that the user has access to.
@@ -1030,14 +1031,9 @@ def __exit__(self, type, value, traceback):
10301031
self.transport.close()
10311032

10321033

1033-
try:
1034-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1035-
gapic_version=pkg_resources.get_distribution(
1036-
"google-cloud-debugger-client",
1037-
).version,
1038-
)
1039-
except pkg_resources.DistributionNotFound:
1040-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1034+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1035+
gapic_version=package_version.__version__
1036+
)
10411037

10421038

10431039
__all__ = ("Debugger2Client",)

google/cloud/debugger_v2/services/debugger2/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.debugger_v2 import gapic_version as package_version
2929
from google.cloud.debugger_v2.types import debugger
3030

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

release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"release-type": "python",
66
"extra-files": [
77
"google/cloud/debugger/gapic_version.py",
8+
"google/cloud/debugger_v2/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.devtools.clouddebugger.v2.json",

setup.py

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

3838
dependencies = [
39-
"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.*",
39+
"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.*",
4040
"proto-plus >= 1.22.0, <2.0.0dev",
4141
"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",
4242
"google-cloud-source-context >= 1.0.0, <2.0.0dev",

0 commit comments

Comments
 (0)