Skip to content

Commit d712658

Browse files
yoshi-automationbusunkim96
authored andcommitted
docs(texttospeech): add 2.7 deprecation warning (via synth) (#10051)
1 parent 64939ac commit d712658

File tree

3 files changed

+3485
-5
lines changed

3 files changed

+3485
-5
lines changed

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,23 @@
1616

1717

1818
from __future__ import absolute_import
19+
import sys
20+
import warnings
1921

2022
from google.cloud.texttospeech_v1 import types
2123
from google.cloud.texttospeech_v1.gapic import enums
2224
from google.cloud.texttospeech_v1.gapic import text_to_speech_client
2325

2426

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

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,23 @@
1616

1717

1818
from __future__ import absolute_import
19+
import sys
20+
import warnings
1921

2022
from google.cloud.texttospeech_v1beta1 import types
2123
from google.cloud.texttospeech_v1beta1.gapic import enums
2224
from google.cloud.texttospeech_v1beta1.gapic import text_to_speech_client
2325

2426

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

0 commit comments

Comments
 (0)