Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit526b250

Browse files
fix(translate): add py2 deprecation warning; bump copyright year to 2020; add 3.8 unit tests (via synth) (#9943)
1 parentc74041f commit526b250

File tree

16 files changed

+49
-47
lines changed

16 files changed

+49
-47
lines changed

‎packages/google-cloud-translate/google/cloud/translate.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎packages/google-cloud-translate/google/cloud/translate_v3/__init__.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,11 +16,22 @@
1616

1717

1818
from __future__importabsolute_import
19+
importsys
20+
importwarnings
1921

2022
fromgoogle.cloud.translate_v3importtypes
2123
fromgoogle.cloud.translate_v3.gapicimporttranslation_service_client
2224

2325

26+
ifsys.version_info[:2]== (2,7):
27+
message= (
28+
"A future version of this library will drop support for Python 2.7."
29+
"More details about Python 2 support for Google Cloud Client Libraries"
30+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
31+
)
32+
warnings.warn(message,DeprecationWarning)
33+
34+
2435
classTranslationServiceClient(translation_service_client.TranslationServiceClient):
2536
__doc__=translation_service_client.TranslationServiceClient.__doc__
2637

‎packages/google-cloud-translate/google/cloud/translate_v3/gapic/translation_service_client.py‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -80,12 +80,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8080

8181
@classmethod
8282
defglossary_path(cls,project,location,glossary):
83-
"""DEPRECATED. Return a fully-qualified glossary string."""
84-
warnings.warn(
85-
"Resource name helper functions are deprecated.",
86-
PendingDeprecationWarning,
87-
stacklevel=1,
88-
)
83+
"""Return a fully-qualified glossary string."""
8984
returngoogle.api_core.path_template.expand(
9085
"projects/{project}/locations/{location}/glossaries/{glossary}",
9186
project=project,
@@ -95,12 +90,7 @@ def glossary_path(cls, project, location, glossary):
9590

9691
@classmethod
9792
deflocation_path(cls,project,location):
98-
"""DEPRECATED. Return a fully-qualified location string."""
99-
warnings.warn(
100-
"Resource name helper functions are deprecated.",
101-
PendingDeprecationWarning,
102-
stacklevel=1,
103-
)
93+
"""Return a fully-qualified location string."""
10494
returngoogle.api_core.path_template.expand(
10595
"projects/{project}/locations/{location}",
10696
project=project,

‎packages/google-cloud-translate/google/cloud/translate_v3/gapic/transports/translation_service_grpc_transport.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎packages/google-cloud-translate/google/cloud/translate_v3/proto/translation_service_pb2.py‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎packages/google-cloud-translate/google/cloud/translate_v3/types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎packages/google-cloud-translate/google/cloud/translate_v3beta1/__init__.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,11 +16,22 @@
1616

1717

1818
from __future__importabsolute_import
19+
importsys
20+
importwarnings
1921

2022
fromgoogle.cloud.translate_v3beta1importtypes
2123
fromgoogle.cloud.translate_v3beta1.gapicimporttranslation_service_client
2224

2325

26+
ifsys.version_info[:2]== (2,7):
27+
message= (
28+
"A future version of this library will drop support for Python 2.7."
29+
"More details about Python 2 support for Google Cloud Client Libraries"
30+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
31+
)
32+
warnings.warn(message,DeprecationWarning)
33+
34+
2435
classTranslationServiceClient(translation_service_client.TranslationServiceClient):
2536
__doc__=translation_service_client.TranslationServiceClient.__doc__
2637

‎packages/google-cloud-translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -80,12 +80,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8080

8181
@classmethod
8282
defglossary_path(cls,project,location,glossary):
83-
"""DEPRECATED. Return a fully-qualified glossary string."""
84-
warnings.warn(
85-
"Resource name helper functions are deprecated.",
86-
PendingDeprecationWarning,
87-
stacklevel=1,
88-
)
83+
"""Return a fully-qualified glossary string."""
8984
returngoogle.api_core.path_template.expand(
9085
"projects/{project}/locations/{location}/glossaries/{glossary}",
9186
project=project,
@@ -95,12 +90,7 @@ def glossary_path(cls, project, location, glossary):
9590

9691
@classmethod
9792
deflocation_path(cls,project,location):
98-
"""DEPRECATED. Return a fully-qualified location string."""
99-
warnings.warn(
100-
"Resource name helper functions are deprecated.",
101-
PendingDeprecationWarning,
102-
stacklevel=1,
103-
)
93+
"""Return a fully-qualified location string."""
10494
returngoogle.api_core.path_template.expand(
10595
"projects/{project}/locations/{location}",
10696
project=project,

‎packages/google-cloud-translate/google/cloud/translate_v3beta1/gapic/transports/translation_service_grpc_transport.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎packages/google-cloud-translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp