Skip to content

Commit ecf5c43

Browse files
yoshi-automationbusunkim96
authored andcommitted
texttospeech: Reformat protos, update nox session docs (via synth). (#7941)
1 parent c4254e0 commit ecf5c43

9 files changed

Lines changed: 89 additions & 25 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../README.rst

packages/google-cloud-texttospeech/docs/conf.py

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# -- General configuration ------------------------------------------------
2626

2727
# If your documentation needs a minimal Sphinx version, state it here.
28-
# needs_sphinx = '1.0'
28+
needs_sphinx = "1.6.3"
2929

3030
# Add any Sphinx extension module names here, as strings. They can be
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -36,6 +36,7 @@
3636
"sphinx.ext.intersphinx",
3737
"sphinx.ext.coverage",
3838
"sphinx.ext.napoleon",
39+
"sphinx.ext.todo",
3940
"sphinx.ext.viewcode",
4041
]
4142

@@ -47,10 +48,14 @@
4748
# Add any paths that contain templates here, relative to this directory.
4849
templates_path = ["_templates"]
4950

51+
# Allow markdown includes (so releases.md can include CHANGLEOG.md)
52+
# http://www.sphinx-doc.org/en/master/markdown.html
53+
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
54+
5055
# The suffix(es) of source filenames.
5156
# You can specify multiple suffix as a list of string:
5257
# source_suffix = ['.rst', '.md']
53-
source_suffix = ".rst"
58+
source_suffix = [".rst", ".md"]
5459

5560
# The encoding of source files.
5661
# source_encoding = 'utf-8-sig'
@@ -120,12 +125,20 @@
120125

121126
# The theme to use for HTML and HTML Help pages. See the documentation for
122127
# a list of builtin themes.
123-
html_theme = "sphinx_rtd_theme"
128+
html_theme = "alabaster"
124129

125130
# Theme options are theme-specific and customize the look and feel of a theme
126131
# further. For a list of options available for each theme, see the
127132
# documentation.
128-
# html_theme_options = {}
133+
html_theme_options = {
134+
"description": "Google Cloud Client Libraries for Python",
135+
"github_user": "googleapis",
136+
"github_repo": "google-cloud-python",
137+
"github_banner": True,
138+
"font_family": "'Roboto', Georgia, sans",
139+
"head_font_family": "'Roboto', Georgia, serif",
140+
"code_font_family": "'Roboto Mono', 'Consolas', monospace",
141+
}
129142

130143
# Add any paths that contain custom themes here, relative to this directory.
131144
# html_theme_path = []
@@ -214,6 +227,17 @@
214227
# Output file base name for HTML help builder.
215228
htmlhelp_basename = "google-cloud-texttospeech-doc"
216229

230+
# -- Options for warnings ------------------------------------------------------
231+
232+
suppress_warnings = [
233+
# Temporarily suppress this to avoid "more than one target found for
234+
# cross-reference" warning, which are intractable for us to avoid while in
235+
# a mono-repo.
236+
# See https://github.com/sphinx-doc/sphinx/blob
237+
# /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843
238+
"ref.python"
239+
]
240+
217241
# -- Options for LaTeX output ---------------------------------------------
218242

219243
latex_elements = {
@@ -289,7 +313,7 @@
289313
u"google-cloud-texttospeech Documentation",
290314
author,
291315
"google-cloud-texttospeech",
292-
"GAPIC library for the {metadata.shortName} v1beta1 service",
316+
"GAPIC library for the {metadata.shortName} v1 service",
293317
"APIs",
294318
)
295319
]
@@ -310,6 +334,16 @@
310334
intersphinx_mapping = {
311335
"python": ("http://python.readthedocs.org/en/latest/", None),
312336
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
337+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
338+
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
339+
"google.api_core": (
340+
"https://googleapis.github.io/google-cloud-python/latest",
341+
None,
342+
),
343+
"grpc": ("https://grpc.io/grpc/python/", None),
344+
"requests": ("http://docs.python-requests.org/en/master/", None),
345+
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
346+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
313347
}
314348

315349
# Napoleon settings

packages/google-cloud-texttospeech/docs/index.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: /../texttospeech/README.rst
1+
.. include:: README.rst
22

33
Api Reference
44
-------------
@@ -10,4 +10,13 @@ Api Reference
1010
gapic/v1/types
1111
gapic/v1beta1/api
1212
gapic/v1beta1/types
13-
changelog
13+
14+
Changelog
15+
---------
16+
17+
For a list of all ``google-cloud-texttospeech`` releases.
18+
19+
.. toctree::
20+
:maxdepth: 2
21+
22+
changelog

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ option java_outer_classname = "TextToSpeechProto";
2727
option java_package = "com.google.cloud.texttospeech.v1";
2828
option php_namespace = "Google\\Cloud\\TextToSpeech\\V1";
2929

30-
3130
// Service that implements Google Cloud Text-to-Speech API.
3231
service TextToSpeech {
3332
// Returns a list of Voice supported for synthesis.
@@ -39,7 +38,8 @@ service TextToSpeech {
3938

4039
// Synthesizes speech synchronously: receive results after all text input
4140
// has been processed.
42-
rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) {
41+
rpc SynthesizeSpeech(SynthesizeSpeechRequest)
42+
returns (SynthesizeSpeechResponse) {
4343
option (google.api.http) = {
4444
post: "/v1/text:synthesize"
4545
body: "*"

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@
1919

2020
from google.api_core.protobuf_helpers import get_messages
2121

22-
from google.api import http_pb2
2322
from google.cloud.texttospeech_v1.proto import cloud_tts_pb2
24-
from google.protobuf import descriptor_pb2
2523

26-
_shared_modules = [http_pb2, descriptor_pb2]
24+
_shared_modules = [] # pragma: NO COVER
2725

2826
_local_modules = [cloud_tts_pb2]
2927

3028
names = []
3129

32-
for module in _shared_modules:
30+
for module in _shared_modules: # pragma: NO COVER
3331
for name, message in get_messages(module).items():
3432
setattr(sys.modules[__name__], name, message)
3533
names.append(name)

packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ option java_multiple_files = true;
2424
option java_outer_classname = "TextToSpeechProto";
2525
option java_package = "com.google.cloud.texttospeech.v1beta1";
2626

27-
2827
// Service that implements Google Cloud Text-to-Speech API.
2928
service TextToSpeech {
3029
// Returns a list of [Voice][google.cloud.texttospeech.v1beta1.Voice]
@@ -37,7 +36,8 @@ service TextToSpeech {
3736

3837
// Synthesizes speech synchronously: receive results after all text input
3938
// has been processed.
40-
rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) {
39+
rpc SynthesizeSpeech(SynthesizeSpeechRequest)
40+
returns (SynthesizeSpeechResponse) {
4141
option (google.api.http) = {
4242
post: "/v1beta1/text:synthesize"
4343
body: "*"

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@
1919

2020
from google.api_core.protobuf_helpers import get_messages
2121

22-
from google.api import http_pb2
2322
from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2
24-
from google.protobuf import descriptor_pb2
2523

26-
_shared_modules = [http_pb2, descriptor_pb2]
24+
_shared_modules = [] # pragma: NO COVER
2725

2826
_local_modules = [cloud_tts_pb2]
2927

3028
names = []
3129

32-
for module in _shared_modules:
30+
for module in _shared_modules: # pragma: NO COVER
3331
for name, message in get_messages(module).items():
3432
setattr(sys.modules[__name__], name, message)
3533
names.append(name)

packages/google-cloud-texttospeech/noxfile.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from __future__ import absolute_import
1818
import os
19+
import shutil
1920

2021
import nox
2122

@@ -45,6 +46,10 @@ def blacken(session):
4546
"""Run black.
4647
4748
Format code to uniform standard.
49+
50+
This currently uses Python 3.6 due to the automated Kokoro run of synthtool.
51+
That run uses an image that doesn't have 3.6 installed. Before updating this
52+
check the state of the `gcp_ubuntu_config` we use for that Kokoro run.
4853
"""
4954
session.install("black")
5055
session.run(
@@ -134,3 +139,22 @@ def cover(session):
134139
session.run("coverage", "report", "--show-missing", "--fail-under=100")
135140

136141
session.run("coverage", "erase")
142+
143+
@nox.session(python="3.7")
144+
def docs(session):
145+
"""Build the docs for this library."""
146+
147+
session.install('-e', '.')
148+
session.install('sphinx', 'alabaster', 'recommonmark')
149+
150+
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
151+
session.run(
152+
'sphinx-build',
153+
'-W', # warnings as errors
154+
'-T', # show full traceback on exception
155+
'-N', # no colors
156+
'-b', 'html',
157+
'-d', os.path.join('docs', '_build', 'doctrees', ''),
158+
os.path.join('docs', ''),
159+
os.path.join('docs', '_build', 'html', ''),
160+
)

packages/google-cloud-texttospeech/synth.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"updateTime": "2019-02-01T19:05:35.269409Z",
2+
"updateTime": "2019-05-10T12:40:35.475280Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.7",
8-
"dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80"
7+
"version": "0.19.0",
8+
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a",
16-
"internalRef": "231974277"
15+
"sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a",
16+
"internalRef": "247530843"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "python_library",
2222
"origin": "synthtool.gcp",
23-
"version": "2019.1.16"
23+
"version": "2019.5.2"
2424
}
2525
}
2626
],

0 commit comments

Comments
 (0)