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

Commit 15ed1e8

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#163)
* 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 a30bc28 commit 15ed1e8

File tree

12 files changed

+52
-66
lines changed

12 files changed

+52
-66
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.6.0" # {x-release-please-version}

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -221,7 +222,7 @@ async def list_connections(
221222
*,
222223
parent: Optional[str] = None,
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
) -> pagers.ListConnectionsAsyncPager:
227228
r"""Lists connections that are currently active for the
@@ -348,14 +349,9 @@ async def __aexit__(self, exc_type, exc, tb):
348349
await self.transport.close()
349350

350351

351-
try:
352-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
353-
gapic_version=pkg_resources.get_distribution(
354-
"google-cloud-apigee-connect",
355-
).version,
356-
)
357-
except pkg_resources.DistributionNotFound:
358-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
352+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
353+
gapic_version=package_version.__version__
354+
)
359355

360356

361357
__all__ = ("ConnectionServiceAsyncClient",)

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -443,7 +444,7 @@ def list_connections(
443444
*,
444445
parent: Optional[str] = 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
) -> pagers.ListConnectionsPager:
449450
r"""Lists connections that are currently active for the
@@ -567,14 +568,9 @@ def __exit__(self, type, value, traceback):
567568
self.transport.close()
568569

569570

570-
try:
571-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
572-
gapic_version=pkg_resources.get_distribution(
573-
"google-cloud-apigee-connect",
574-
).version,
575-
)
576-
except pkg_resources.DistributionNotFound:
577-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
571+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
572+
gapic_version=package_version.__version__
573+
)
578574

579575

580576
__all__ = ("ConnectionServiceClient",)

google/cloud/apigeeconnect_v1/services/connection_service/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.apigeeconnect_v1 import gapic_version as package_version
2828
from google.cloud.apigeeconnect_v1.types import connection
2929

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

google/cloud/apigeeconnect_v1/services/tether/async_client.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
from google.api_core.client_options import ClientOptions
3838
from google.auth import credentials as ga_credentials # type: ignore
3939
from google.oauth2 import service_account # type: ignore
40-
import pkg_resources
40+
41+
from google.cloud.apigeeconnect_v1 import gapic_version as package_version
4142

4243
try:
4344
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -214,7 +215,7 @@ def egress(
214215
requests: Optional[AsyncIterator[tether.EgressResponse]] = None,
215216
*,
216217
retry: OptionalRetry = gapic_v1.method.DEFAULT,
217-
timeout: Optional[float] = None,
218+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
218219
metadata: Sequence[Tuple[str, str]] = (),
219220
) -> Awaitable[AsyncIterable[tether.EgressRequest]]:
220221
r"""Egress streams egress requests and responses.
@@ -303,14 +304,9 @@ async def __aexit__(self, exc_type, exc, tb):
303304
await self.transport.close()
304305

305306

306-
try:
307-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
308-
gapic_version=pkg_resources.get_distribution(
309-
"google-cloud-apigee-connect",
310-
).version,
311-
)
312-
except pkg_resources.DistributionNotFound:
313-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
307+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
308+
gapic_version=package_version.__version__
309+
)
314310

315311

316312
__all__ = ("TetherAsyncClient",)

google/cloud/apigeeconnect_v1/services/tether/client.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
from google.auth.transport import mtls # type: ignore
4141
from google.auth.transport.grpc import SslCredentials # type: ignore
4242
from google.oauth2 import service_account # type: ignore
43-
import pkg_resources
43+
44+
from google.cloud.apigeeconnect_v1 import gapic_version as package_version
4445

4546
try:
4647
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -428,7 +429,7 @@ def egress(
428429
requests: Optional[Iterator[tether.EgressResponse]] = None,
429430
*,
430431
retry: OptionalRetry = gapic_v1.method.DEFAULT,
431-
timeout: Optional[float] = None,
432+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
432433
metadata: Sequence[Tuple[str, str]] = (),
433434
) -> Iterable[tether.EgressRequest]:
434435
r"""Egress streams egress requests and responses.
@@ -520,14 +521,9 @@ def __exit__(self, type, value, traceback):
520521
self.transport.close()
521522

522523

523-
try:
524-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
525-
gapic_version=pkg_resources.get_distribution(
526-
"google-cloud-apigee-connect",
527-
).version,
528-
)
529-
except pkg_resources.DistributionNotFound:
530-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
524+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
525+
gapic_version=package_version.__version__
526+
)
531527

532528

533529
__all__ = ("TetherClient",)

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

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-apigee-connect",
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 TetherTransport(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/apigeeconnect_v1/gapic_version.py",
78
"google/cloud/apigeeconnect/gapic_version.py",
89
{
910
"type": "json",

samples/generated_samples/snippet_metadata_google.cloud.apigeeconnect.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-apigee-connect",
11-
"version": "1.6.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)