diff --git a/.coveragerc b/.coveragerc index d63da53..0230b9e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/google/cloud/debugger_v2/gapic_version.py b/google/cloud/debugger_v2/gapic_version.py new file mode 100644 index 0000000..178df4b --- /dev/null +++ b/google/cloud/debugger_v2/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.4.3" # {x-release-please-version} diff --git a/google/cloud/debugger_v2/services/controller2/async_client.py b/google/cloud/debugger_v2/services/controller2/async_client.py index b9dcea1..2c0d0e9 100644 --- a/google/cloud/debugger_v2/services/controller2/async_client.py +++ b/google/cloud/debugger_v2/services/controller2/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.debugger_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -234,7 +235,7 @@ async def register_debuggee( *, debuggee: Optional[data.Debuggee] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> controller.RegisterDebuggeeResponse: r"""Registers the debuggee with the controller service. @@ -338,7 +339,7 @@ async def list_active_breakpoints( *, debuggee_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> controller.ListActiveBreakpointsResponse: r"""Returns the list of all active breakpoints for the debuggee. @@ -463,7 +464,7 @@ async def update_active_breakpoint( debuggee_id: Optional[str] = None, breakpoint_: Optional[data.Breakpoint] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> controller.UpdateActiveBreakpointResponse: r"""Updates the breakpoint state or mutable fields. The entire @@ -600,14 +601,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-debugger-client", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("Controller2AsyncClient",) diff --git a/google/cloud/debugger_v2/services/controller2/client.py b/google/cloud/debugger_v2/services/controller2/client.py index c6ad89e..8bc794e 100644 --- a/google/cloud/debugger_v2/services/controller2/client.py +++ b/google/cloud/debugger_v2/services/controller2/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.debugger_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -443,7 +444,7 @@ def register_debuggee( *, debuggee: Optional[data.Debuggee] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> controller.RegisterDebuggeeResponse: r"""Registers the debuggee with the controller service. @@ -547,7 +548,7 @@ def list_active_breakpoints( *, debuggee_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> controller.ListActiveBreakpointsResponse: r"""Returns the list of all active breakpoints for the debuggee. @@ -662,7 +663,7 @@ def update_active_breakpoint( debuggee_id: Optional[str] = None, breakpoint_: Optional[data.Breakpoint] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> controller.UpdateActiveBreakpointResponse: r"""Updates the breakpoint state or mutable fields. The entire @@ -796,14 +797,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-debugger-client", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("Controller2Client",) diff --git a/google/cloud/debugger_v2/services/controller2/transports/base.py b/google/cloud/debugger_v2/services/controller2/transports/base.py index 8cbd102..bb41c73 100644 --- a/google/cloud/debugger_v2/services/controller2/transports/base.py +++ b/google/cloud/debugger_v2/services/controller2/transports/base.py @@ -23,18 +23,13 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.debugger_v2 import gapic_version as package_version from google.cloud.debugger_v2.types import controller -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-debugger-client", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class Controller2Transport(abc.ABC): diff --git a/google/cloud/debugger_v2/services/debugger2/async_client.py b/google/cloud/debugger_v2/services/debugger2/async_client.py index 2e751f9..b1a8a45 100644 --- a/google/cloud/debugger_v2/services/debugger2/async_client.py +++ b/google/cloud/debugger_v2/services/debugger2/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.debugger_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -225,7 +226,7 @@ async def set_breakpoint( breakpoint_: Optional[data.Breakpoint] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.SetBreakpointResponse: r"""Sets the breakpoint to the debuggee. @@ -348,7 +349,7 @@ async def get_breakpoint( breakpoint_id: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.GetBreakpointResponse: r"""Gets breakpoint information. @@ -488,7 +489,7 @@ async def delete_breakpoint( breakpoint_id: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the breakpoint from the debuggee. @@ -614,7 +615,7 @@ async def list_breakpoints( debuggee_id: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.ListBreakpointsResponse: r"""Lists all breakpoints for the debuggee. @@ -737,7 +738,7 @@ async def list_debuggees( project: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.ListDebuggeesResponse: r"""Lists all the debuggees that the user has access to. @@ -852,14 +853,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-debugger-client", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("Debugger2AsyncClient",) diff --git a/google/cloud/debugger_v2/services/debugger2/client.py b/google/cloud/debugger_v2/services/debugger2/client.py index 0966ac7..c472222 100644 --- a/google/cloud/debugger_v2/services/debugger2/client.py +++ b/google/cloud/debugger_v2/services/debugger2/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.debugger_v2 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -436,7 +437,7 @@ def set_breakpoint( breakpoint_: Optional[data.Breakpoint] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.SetBreakpointResponse: r"""Sets the breakpoint to the debuggee. @@ -559,7 +560,7 @@ def get_breakpoint( breakpoint_id: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.GetBreakpointResponse: r"""Gets breakpoint information. @@ -689,7 +690,7 @@ def delete_breakpoint( breakpoint_id: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the breakpoint from the debuggee. @@ -805,7 +806,7 @@ def list_breakpoints( debuggee_id: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.ListBreakpointsResponse: r"""Lists all breakpoints for the debuggee. @@ -918,7 +919,7 @@ def list_debuggees( project: Optional[str] = None, client_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> debugger.ListDebuggeesResponse: r"""Lists all the debuggees that the user has access to. @@ -1030,14 +1031,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-debugger-client", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("Debugger2Client",) diff --git a/google/cloud/debugger_v2/services/debugger2/transports/base.py b/google/cloud/debugger_v2/services/debugger2/transports/base.py index 438fefb..b43518f 100644 --- a/google/cloud/debugger_v2/services/debugger2/transports/base.py +++ b/google/cloud/debugger_v2/services/debugger2/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.debugger_v2 import gapic_version as package_version from google.cloud.debugger_v2.types import debugger -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-debugger-client", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class Debugger2Transport(abc.ABC): diff --git a/release-please-config.json b/release-please-config.json index 4676e84..7952309 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -5,6 +5,7 @@ "release-type": "python", "extra-files": [ "google/cloud/debugger/gapic_version.py", + "google/cloud/debugger_v2/gapic_version.py", { "type": "json", "path": "samples/generated_samples/snippet_metadata_google.devtools.clouddebugger.v2.json", diff --git a/setup.py b/setup.py index 6b2b762..e40a112 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "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.*", + "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.*", "proto-plus >= 1.22.0, <2.0.0dev", "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", "google-cloud-source-context >= 1.0.0, <2.0.0dev", diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index d13e28c..6f476bb 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -4,7 +4,7 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5 google-cloud-source-context==1.0.0