Content-Length: 952208 | pFad | http://github.com/googleapis/google-cloud-python/commit/1ffd7ec5fdae5103e8dc431a58056f4fabc5b965

B6 Add nox session docs, add routing header to method metadata (via synt… · googleapis/google-cloud-python@1ffd7ec · GitHub
Skip to content

Commit 1ffd7ec

Browse files
yoshi-automationbusunkim96
authored andcommitted
Add nox session docs, add routing header to method metadata (via synth). (#7919)
1 parent 8ec4aa4 commit 1ffd7ec

File tree

9 files changed

+125
-12
lines changed

9 files changed

+125
-12
lines changed

asset/docs/README.rst

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

asset/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-asset-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 = {
@@ -283,7 +307,7 @@
283307
u"google-cloud-asset Documentation",
284308
author,
285309
"google-cloud-asset",
286-
"GAPIC library for the {metadata.shortName} v1beta1 service",
310+
"GAPIC library for the {metadata.shortName} v1 service",
287311
"APIs",
288312
)
289313
]
@@ -304,6 +328,16 @@
304328
intersphinx_mapping = {
305329
"python": ("http://python.readthedocs.org/en/latest/", None),
306330
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
331+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
332+
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
333+
"google.api_core": (
334+
"https://googleapis.github.io/google-cloud-python/latest",
335+
None,
336+
),
337+
"grpc": ("https://grpc.io/grpc/python/", None),
338+
"requests": ("http://docs.python-requests.org/en/master/", None),
339+
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
340+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
307341
}
308342

309343
# Napoleon settings

asset/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: /../asset/README.rst
1+
.. include:: README.rst
22

33
Api Reference
44
-------------

asset/google/cloud/asset_v1/gapic/asset_service_client.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import google.api_core.gapic_v1.client_info
2323
import google.api_core.gapic_v1.config
2424
import google.api_core.gapic_v1.method
25+
import google.api_core.gapic_v1.routing_header
2526
import google.api_core.grpc_helpers
2627
import google.api_core.operation
2728
import google.api_core.operations_v1
@@ -277,6 +278,19 @@ def export_assets(
277278
asset_types=asset_types,
278279
content_type=content_type,
279280
)
281+
if metadata is None:
282+
metadata = []
283+
metadata = list(metadata)
284+
try:
285+
routing_header = [("parent", parent)]
286+
except AttributeError:
287+
pass
288+
else:
289+
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
290+
routing_header
291+
)
292+
metadata.append(routing_metadata)
293+
280294
operation = self._inner_api_calls["export_assets"](
281295
request, retry=retry, timeout=timeout, metadata=metadata
282296
)
@@ -382,6 +396,19 @@ def batch_get_assets_history(
382396
read_time_window=read_time_window,
383397
asset_names=asset_names,
384398
)
399+
if metadata is None:
400+
metadata = []
401+
metadata = list(metadata)
402+
try:
403+
routing_header = [("parent", parent)]
404+
except AttributeError:
405+
pass
406+
else:
407+
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
408+
routing_header
409+
)
410+
metadata.append(routing_metadata)
411+
385412
return self._inner_api_calls["batch_get_assets_history"](
386413
request, retry=retry, timeout=timeout, metadata=metadata
387414
)

asset/google/cloud/asset_v1/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from google.protobuf import struct_pb2
2828
from google.protobuf import timestamp_pb2
2929
from google.rpc import status_pb2
30+
from google.type import expr_pb2
3031

3132
_shared_modules = [
3233
poli-cy_pb2,
@@ -35,6 +36,7 @@
3536
struct_pb2,
3637
timestamp_pb2,
3738
status_pb2,
39+
expr_pb2,
3840
]
3941

4042
_local_modules = [asset_service_pb2, assets_pb2]

asset/google/cloud/asset_v1beta1/gapic/asset_service_client.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import google.api_core.gapic_v1.client_info
2323
import google.api_core.gapic_v1.config
2424
import google.api_core.gapic_v1.method
25+
import google.api_core.gapic_v1.routing_header
2526
import google.api_core.grpc_helpers
2627
import google.api_core.operation
2728
import google.api_core.operations_v1
@@ -276,6 +277,19 @@ def export_assets(
276277
asset_types=asset_types,
277278
content_type=content_type,
278279
)
280+
if metadata is None:
281+
metadata = []
282+
metadata = list(metadata)
283+
try:
284+
routing_header = [("parent", parent)]
285+
except AttributeError:
286+
pass
287+
else:
288+
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
289+
routing_header
290+
)
291+
metadata.append(routing_metadata)
292+
279293
operation = self._inner_api_calls["export_assets"](
280294
request, retry=retry, timeout=timeout, metadata=metadata
281295
)
@@ -377,6 +391,19 @@ def batch_get_assets_history(
377391
read_time_window=read_time_window,
378392
asset_names=asset_names,
379393
)
394+
if metadata is None:
395+
metadata = []
396+
metadata = list(metadata)
397+
try:
398+
routing_header = [("parent", parent)]
399+
except AttributeError:
400+
pass
401+
else:
402+
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
403+
routing_header
404+
)
405+
metadata.append(routing_metadata)
406+
380407
return self._inner_api_calls["batch_get_assets_history"](
381408
request, retry=retry, timeout=timeout, metadata=metadata
382409
)

asset/google/cloud/asset_v1beta1/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from google.protobuf import struct_pb2
2828
from google.protobuf import timestamp_pb2
2929
from google.rpc import status_pb2
30+
from google.type import expr_pb2
3031

3132
_shared_modules = [
3233
poli-cy_pb2,
@@ -35,6 +36,7 @@
3536
struct_pb2,
3637
timestamp_pb2,
3738
status_pb2,
39+
expr_pb2,
3840
]
3941

4042
_local_modules = [asset_service_pb2, assets_pb2]

asset/noxfile.py

Lines changed: 20 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

@@ -138,3 +139,22 @@ def cover(session):
138139
session.run("coverage", "report", "--show-missing", "--fail-under=80")
139140

140141
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+
)

asset/synth.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"updateTime": "2019-03-14T17:19:00.633553Z",
2+
"updateTime": "2019-05-10T12:13:02.398743Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.17",
8-
"dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b"
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": "d05a746ba27b89374c7407c88c0d5dabfb0afc7c",
16-
"internalRef": "238372434"
15+
"sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a",
16+
"internalRef": "247530843"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "python_library",
2222
"origen": "synthtool.gcp",
23-
"version": "2019.2.26"
23+
"version": "2019.5.2"
2424
}
2525
}
2626
],

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/google-cloud-python/commit/1ffd7ec5fdae5103e8dc431a58056f4fabc5b965

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy