Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texttospeech: Reformat protos, update nox session docs (via synth). #7941

Merged
merged 3 commits into from May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions texttospeech/docs/README.rst
44 changes: 39 additions & 5 deletions texttospeech/docs/conf.py
Expand Up @@ -25,7 +25,7 @@
# -- General configuration ------------------------------------------------

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

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand All @@ -36,6 +36,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
]

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

# Allow markdown includes (so releases.md can include CHANGLEOG.md)
# http://www.sphinx-doc.org/en/master/markdown.html
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"
source_suffix = [".rst", ".md"]

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand Down Expand Up @@ -120,12 +125,20 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
html_theme_options = {
"description": "Google Cloud Client Libraries for Python",
"github_user": "googleapis",
"github_repo": "google-cloud-python",
"github_banner": True,
"font_family": "'Roboto', Georgia, sans",
"head_font_family": "'Roboto', Georgia, serif",
"code_font_family": "'Roboto Mono', 'Consolas', monospace",
}

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

# -- Options for warnings ------------------------------------------------------

suppress_warnings = [
# Temporarily suppress this to avoid "more than one target found for
# cross-reference" warning, which are intractable for us to avoid while in
# a mono-repo.
# See https://github.com/sphinx-doc/sphinx/blob
# /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843
"ref.python"
]

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand Down Expand Up @@ -289,7 +313,7 @@
u"google-cloud-texttospeech Documentation",
author,
"google-cloud-texttospeech",
"GAPIC library for the {metadata.shortName} v1beta1 service",
"GAPIC library for the {metadata.shortName} v1 service",
"APIs",
)
]
Expand All @@ -310,6 +334,16 @@
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
"google.api_core": (
"https://googleapis.github.io/google-cloud-python/latest",
None,
),
"grpc": ("https://grpc.io/grpc/python/", None),
"requests": ("http://docs.python-requests.org/en/master/", None),
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
}

# Napoleon settings
Expand Down
13 changes: 11 additions & 2 deletions texttospeech/docs/index.rst
@@ -1,4 +1,4 @@
.. include:: /../texttospeech/README.rst
.. include:: README.rst

Api Reference
-------------
Expand All @@ -10,4 +10,13 @@ Api Reference
gapic/v1/types
gapic/v1beta1/api
gapic/v1beta1/types
changelog

Changelog
---------

For a list of all ``google-cloud-texttospeech`` releases.

.. toctree::
:maxdepth: 2

changelog
Expand Up @@ -27,7 +27,6 @@ option java_outer_classname = "TextToSpeechProto";
option java_package = "com.google.cloud.texttospeech.v1";
option php_namespace = "Google\\Cloud\\TextToSpeech\\V1";


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

// Synthesizes speech synchronously: receive results after all text input
// has been processed.
rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) {
rpc SynthesizeSpeech(SynthesizeSpeechRequest)
returns (SynthesizeSpeechResponse) {
option (google.api.http) = {
post: "/v1/text:synthesize"
body: "*"
Expand Down
6 changes: 2 additions & 4 deletions texttospeech/google/cloud/texttospeech_v1/types.py
Expand Up @@ -19,17 +19,15 @@

from google.api_core.protobuf_helpers import get_messages

from google.api import http_pb2
from google.cloud.texttospeech_v1.proto import cloud_tts_pb2
from google.protobuf import descriptor_pb2

_shared_modules = [http_pb2, descriptor_pb2]
_shared_modules = [] # pragma: NO COVER

_local_modules = [cloud_tts_pb2]

names = []

for module in _shared_modules:
for module in _shared_modules: # pragma: NO COVER
for name, message in get_messages(module).items():
setattr(sys.modules[__name__], name, message)
names.append(name)
Expand Down
Expand Up @@ -24,7 +24,6 @@ option java_multiple_files = true;
option java_outer_classname = "TextToSpeechProto";
option java_package = "com.google.cloud.texttospeech.v1beta1";


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

// Synthesizes speech synchronously: receive results after all text input
// has been processed.
rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) {
rpc SynthesizeSpeech(SynthesizeSpeechRequest)
returns (SynthesizeSpeechResponse) {
option (google.api.http) = {
post: "/v1beta1/text:synthesize"
body: "*"
Expand Down
6 changes: 2 additions & 4 deletions texttospeech/google/cloud/texttospeech_v1beta1/types.py
Expand Up @@ -19,17 +19,15 @@

from google.api_core.protobuf_helpers import get_messages

from google.api import http_pb2
from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2
from google.protobuf import descriptor_pb2

_shared_modules = [http_pb2, descriptor_pb2]
_shared_modules = [] # pragma: NO COVER

_local_modules = [cloud_tts_pb2]

names = []

for module in _shared_modules:
for module in _shared_modules: # pragma: NO COVER
for name, message in get_messages(module).items():
setattr(sys.modules[__name__], name, message)
names.append(name)
Expand Down
24 changes: 24 additions & 0 deletions texttospeech/noxfile.py
Expand Up @@ -16,6 +16,7 @@

from __future__ import absolute_import
import os
import shutil

import nox

Expand Down Expand Up @@ -45,6 +46,10 @@ def blacken(session):
"""Run black.

Format code to uniform standard.

This currently uses Python 3.6 due to the automated Kokoro run of synthtool.
That run uses an image that doesn't have 3.6 installed. Before updating this
check the state of the `gcp_ubuntu_config` we use for that Kokoro run.
"""
session.install("black")
session.run(
Expand Down Expand Up @@ -134,3 +139,22 @@ def cover(session):
session.run("coverage", "report", "--show-missing", "--fail-under=100")

session.run("coverage", "erase")

@nox.session(python="3.7")
def docs(session):
"""Build the docs for this library."""

session.install('-e', '.')
session.install('sphinx', 'alabaster', 'recommonmark')

shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
session.run(
'sphinx-build',
'-W', # warnings as errors
'-T', # show full traceback on exception
'-N', # no colors
'-b', 'html',
'-d', os.path.join('docs', '_build', 'doctrees', ''),
os.path.join('docs', ''),
os.path.join('docs', '_build', 'html', ''),
)
12 changes: 6 additions & 6 deletions texttospeech/synth.metadata
@@ -1,26 +1,26 @@
{
"updateTime": "2019-02-01T19:05:35.269409Z",
"updateTime": "2019-05-10T12:40:35.475280Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.7",
"dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80"
"version": "0.19.0",
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a",
"internalRef": "231974277"
"sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a",
"internalRef": "247530843"
}
},
{
"template": {
"name": "python_library",
"origin": "synthtool.gcp",
"version": "2019.1.16"
"version": "2019.5.2"
}
}
],
Expand Down