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

Commit 0d53a7b

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#259)
* 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 * 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 d297129 commit 0d53a7b

File tree

8 files changed

+49
-50
lines changed

8 files changed

+49
-50
lines changed

.coveragerc

-5
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
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/video/transcoder_v1/services/transcoder_service/async_client.py

+13-17
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.video.transcoder_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -234,7 +235,7 @@ async def create_job(
234235
parent: Optional[str] = None,
235236
job: Optional[resources.Job] = 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
) -> resources.Job:
240241
r"""Creates a job in the specified region.
@@ -347,7 +348,7 @@ async def list_jobs(
347348
*,
348349
parent: Optional[str] = None,
349350
retry: OptionalRetry = gapic_v1.method.DEFAULT,
350-
timeout: Optional[float] = None,
351+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
351352
metadata: Sequence[Tuple[str, str]] = (),
352353
) -> pagers.ListJobsAsyncPager:
353354
r"""Lists jobs in the specified region.
@@ -462,7 +463,7 @@ async def get_job(
462463
*,
463464
name: Optional[str] = None,
464465
retry: OptionalRetry = gapic_v1.method.DEFAULT,
465-
timeout: Optional[float] = None,
466+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
466467
metadata: Sequence[Tuple[str, str]] = (),
467468
) -> resources.Job:
468469
r"""Returns the job data.
@@ -562,7 +563,7 @@ async def delete_job(
562563
*,
563564
name: Optional[str] = None,
564565
retry: OptionalRetry = gapic_v1.method.DEFAULT,
565-
timeout: Optional[float] = None,
566+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
566567
metadata: Sequence[Tuple[str, str]] = (),
567568
) -> None:
568569
r"""Deletes a job.
@@ -654,7 +655,7 @@ async def create_job_template(
654655
job_template: Optional[resources.JobTemplate] = None,
655656
job_template_id: Optional[str] = None,
656657
retry: OptionalRetry = gapic_v1.method.DEFAULT,
657-
timeout: Optional[float] = None,
658+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
658659
metadata: Sequence[Tuple[str, str]] = (),
659660
) -> resources.JobTemplate:
660661
r"""Creates a job template in the specified region.
@@ -779,7 +780,7 @@ async def list_job_templates(
779780
*,
780781
parent: Optional[str] = None,
781782
retry: OptionalRetry = gapic_v1.method.DEFAULT,
782-
timeout: Optional[float] = None,
783+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
783784
metadata: Sequence[Tuple[str, str]] = (),
784785
) -> pagers.ListJobTemplatesAsyncPager:
785786
r"""Lists job templates in the specified region.
@@ -894,7 +895,7 @@ async def get_job_template(
894895
*,
895896
name: Optional[str] = None,
896897
retry: OptionalRetry = gapic_v1.method.DEFAULT,
897-
timeout: Optional[float] = None,
898+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
898899
metadata: Sequence[Tuple[str, str]] = (),
899900
) -> resources.JobTemplate:
900901
r"""Returns the job template data.
@@ -995,7 +996,7 @@ async def delete_job_template(
995996
*,
996997
name: Optional[str] = None,
997998
retry: OptionalRetry = gapic_v1.method.DEFAULT,
998-
timeout: Optional[float] = None,
999+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
9991000
metadata: Sequence[Tuple[str, str]] = (),
10001001
) -> None:
10011002
r"""Deletes a job template.
@@ -1086,14 +1087,9 @@ async def __aexit__(self, exc_type, exc, tb):
10861087
await self.transport.close()
10871088

10881089

1089-
try:
1090-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1091-
gapic_version=pkg_resources.get_distribution(
1092-
"google-cloud-video-transcoder",
1093-
).version,
1094-
)
1095-
except pkg_resources.DistributionNotFound:
1096-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1090+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1091+
gapic_version=package_version.__version__
1092+
)
10971093

10981094

10991095
__all__ = ("TranscoderServiceAsyncClient",)

google/cloud/video/transcoder_v1/services/transcoder_service/client.py

+13-17
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.video.transcoder_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -479,7 +480,7 @@ def create_job(
479480
parent: Optional[str] = None,
480481
job: Optional[resources.Job] = None,
481482
retry: OptionalRetry = gapic_v1.method.DEFAULT,
482-
timeout: Optional[float] = None,
483+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
483484
metadata: Sequence[Tuple[str, str]] = (),
484485
) -> resources.Job:
485486
r"""Creates a job in the specified region.
@@ -592,7 +593,7 @@ def list_jobs(
592593
*,
593594
parent: Optional[str] = None,
594595
retry: OptionalRetry = gapic_v1.method.DEFAULT,
595-
timeout: Optional[float] = None,
596+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
596597
metadata: Sequence[Tuple[str, str]] = (),
597598
) -> pagers.ListJobsPager:
598599
r"""Lists jobs in the specified region.
@@ -707,7 +708,7 @@ def get_job(
707708
*,
708709
name: Optional[str] = None,
709710
retry: OptionalRetry = gapic_v1.method.DEFAULT,
710-
timeout: Optional[float] = None,
711+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
711712
metadata: Sequence[Tuple[str, str]] = (),
712713
) -> resources.Job:
713714
r"""Returns the job data.
@@ -807,7 +808,7 @@ def delete_job(
807808
*,
808809
name: 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
) -> None:
813814
r"""Deletes a job.
@@ -899,7 +900,7 @@ def create_job_template(
899900
job_template: Optional[resources.JobTemplate] = None,
900901
job_template_id: Optional[str] = None,
901902
retry: OptionalRetry = gapic_v1.method.DEFAULT,
902-
timeout: Optional[float] = None,
903+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
903904
metadata: Sequence[Tuple[str, str]] = (),
904905
) -> resources.JobTemplate:
905906
r"""Creates a job template in the specified region.
@@ -1024,7 +1025,7 @@ def list_job_templates(
10241025
*,
10251026
parent: Optional[str] = None,
10261027
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1027-
timeout: Optional[float] = None,
1028+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10281029
metadata: Sequence[Tuple[str, str]] = (),
10291030
) -> pagers.ListJobTemplatesPager:
10301031
r"""Lists job templates in the specified region.
@@ -1139,7 +1140,7 @@ def get_job_template(
11391140
*,
11401141
name: Optional[str] = None,
11411142
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1142-
timeout: Optional[float] = None,
1143+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11431144
metadata: Sequence[Tuple[str, str]] = (),
11441145
) -> resources.JobTemplate:
11451146
r"""Returns the job template data.
@@ -1240,7 +1241,7 @@ def delete_job_template(
12401241
*,
12411242
name: Optional[str] = None,
12421243
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1243-
timeout: Optional[float] = None,
1244+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12441245
metadata: Sequence[Tuple[str, str]] = (),
12451246
) -> None:
12461247
r"""Deletes a job template.
@@ -1338,14 +1339,9 @@ def __exit__(self, type, value, traceback):
13381339
self.transport.close()
13391340

13401341

1341-
try:
1342-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1343-
gapic_version=pkg_resources.get_distribution(
1344-
"google-cloud-video-transcoder",
1345-
).version,
1346-
)
1347-
except pkg_resources.DistributionNotFound:
1348-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1342+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1343+
gapic_version=package_version.__version__
1344+
)
13491345

13501346

13511347
__all__ = ("TranscoderServiceClient",)

google/cloud/video/transcoder_v1/services/transcoder_service/transports/base.py

+4-9
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.video.transcoder_v1 import gapic_version as package_version
2929
from google.cloud.video.transcoder_v1.types import resources, services
3030

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

release-please-config.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"release-type": "python",
66
"extra-files": [
77
"google/cloud/video/transcoder/gapic_version.py",
8+
"google/cloud/video/transcoder_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.video.transcoder.v1.json",

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
release_status = "Development Status :: 5 - Production/Stable"
3939

4040
dependencies = [
41-
"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.*",
41+
"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.*",
4242
"proto-plus >= 1.22.0, <2.0.0dev",
4343
"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",
4444
]

testing/constraints-3.7.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Pin the version to the lower bound.
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
7-
google-api-core==1.33.2
7+
google-api-core==1.34.0
88
proto-plus==1.22.0
99
protobuf==3.19.5

0 commit comments

Comments
 (0)