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

Translate: Add docs for v3beta1. #7681

Merged
merged 3 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 3 additions & 40 deletions language/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,48 +1,11 @@
{
"updateTime": "2019-04-04T12:17:35.761105Z",
busunkim96 marked this conversation as resolved.
Show resolved Hide resolved
"updateTime": "2019-04-08T22:39:27.307980Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.23",
"dockerImage": "googleapis/artman@sha256:f3a3f88000dc1cd1b4826104c5574aa5c534f6793fbf66e888d11c0d7ef5762e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "04193ea2f8121388c998ab49c382f2c03417dcce",
"internalRef": "241828309"
}
},
{
"template": {
"name": "python_library",
"origin": "synthtool.gcp",
"version": "2019.2.26"
}
}
],
"destinations": [
{
"client": {
"source": "googleapis",
"apiName": "language",
"apiVersion": "v1beta2",
"language": "python",
"generator": "gapic",
"config": "google/cloud/language/artman_language_v1beta2.yaml"
}
},
{
"client": {
"source": "googleapis",
"apiName": "language",
"apiVersion": "v1",
"language": "python",
"generator": "gapic",
"config": "google/cloud/language/artman_language_v1.yaml"
"version": "0.16.25",
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion synth.metadata
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"updateTime": "2019-03-18T13:56:09.030990Z"
"updateTime": "2019-04-08T22:36:42.802907Z"
}
1 change: 1 addition & 0 deletions translate/docs/README.rst
6 changes: 6 additions & 0 deletions translate/docs/gapic/v3beta1/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Client for Cloud Translation API
================================

.. automodule:: google.cloud.translate_v3beta1
:members:
:inherited-members:
5 changes: 5 additions & 0 deletions translate/docs/gapic/v3beta1/types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Types for Cloud Translation API Client
======================================

.. automodule:: google.cloud.translate_v3beta1.types
:members:
16 changes: 15 additions & 1 deletion translate/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: /../translate/README.rst
.. include:: README.rst

Detailed Usage Guide
--------------------
Expand All @@ -9,11 +9,25 @@ Detailed Usage Guide

API Reference
-------------

A new beta release, spelled ``v3beta1``, is provided to provide for preview
of upcoming features. In order to use this, you will want to import from
``google.cloud.translate_v3beta1`` in lieu of ``google.cloud.translate``.

.. toctree::
:maxdepth: 2

gapic/v3beta1/api
gapic/v3beta1/types

An API and type reference is provided for v2:

.. toctree::
:maxdepth: 2

client


Changelog
---------

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions translate/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from __future__ import absolute_import
import os
import shutil

import nox

Expand Down Expand Up @@ -138,3 +139,22 @@ def cover(session):
session.run("coverage", "report", "--show-missing", "--fail-under=100")

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

@nox.session(python='3.6')
def docs(session):
"""Build the docs."""

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

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', ''),
)
16 changes: 8 additions & 8 deletions translate/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-04-04T12:25:29.184680Z",
"updateTime": "2019-04-08T22:42:12.391231Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.23",
"dockerImage": "googleapis/artman@sha256:f3a3f88000dc1cd1b4826104c5574aa5c534f6793fbf66e888d11c0d7ef5762e"
"version": "0.16.25",
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
}
},
{
"git": {
"name": "googleapis-private",
"remote": "https://github.com/googleapis/googleapis-private.git",
"sha": "6c972ee69c6f4e4ae19df06c4c2a082cee64cab0",
"internalRef": "241798897"
"name": "googleapis",
"remote": "git@github.com:googleapis/googleapis.git",
"sha": "9a02c5acecb43f38fae4fa52c6420f21c335b888",
"internalRef": "242170119"
}
},
{
Expand All @@ -27,7 +27,7 @@
"destinations": [
{
"client": {
"source": "googleapis-private",
"source": "googleapis",
"apiName": "translate",
"apiVersion": "v3beta1",
"language": "python",
Expand Down
8 changes: 7 additions & 1 deletion translate/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
"translate",
version,
include_protos=True,
private=True,
)

#s.move(library / f'google/cloud/translation_{version}', f'google/cloud/translate_{version}', excludes=excludes)
s.move(library / f'google/cloud/translate_{version}', excludes=excludes)
s.move(library / 'tests')
s.move(library / f"docs/gapic/{version}")

# translation -> translate
s.replace(
Expand All @@ -46,6 +46,12 @@
"google.cloud.translate_v3beta1.proto",
)

s.replace(
"google/cloud/**/translation_service_pb2.py",
r"""record delimiters are ':raw-latex:`\\n`' instead of
':raw-latex:`\\r`:raw-latex:`\\n`'.""",
r"""record delimiters are ``\\\\\\\\n`` instead of
``\\\\\\\\r\\\\\\\\n``.""",)
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
Expand Down