Skip to content

Commit f48afef

Browse files
yoshi-automationbusunkim96
authored andcommitted
Add nox session docs (via synth). (#7776)
1 parent 4c4668e commit f48afef

File tree

5 files changed

+62
-11
lines changed

5 files changed

+62
-11
lines changed

docs/README.rst

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

docs/conf.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
# documentation root, use os.path.abspath to make it absolute, like shown here.
2121
sys.path.insert(0, os.path.abspath(".."))
2222

23-
__version__ = "0.90.4"
23+
__version__ = "0.1.0"
2424

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
@@ -37,6 +37,7 @@
3737
"sphinx.ext.intersphinx",
3838
"sphinx.ext.coverage",
3939
"sphinx.ext.napoleon",
40+
"sphinx.ext.todo",
4041
"sphinx.ext.viewcode",
4142
]
4243

@@ -55,7 +56,7 @@
5556
# The suffix(es) of source filenames.
5657
# You can specify multiple suffix as a list of string:
5758
# source_suffix = ['.rst', '.md']
58-
source_suffix = ".rst"
59+
source_suffix = [".rst", ".md"]
5960

6061
# The encoding of source files.
6162
# source_encoding = 'utf-8-sig'
@@ -130,7 +131,15 @@
130131
# Theme options are theme-specific and customize the look and feel of a theme
131132
# further. For a list of options available for each theme, see the
132133
# documentation.
133-
# html_theme_options = {}
134+
html_theme_options = {
135+
"description": "Google Cloud Client Libraries for Python",
136+
"github_user": "googleapis",
137+
"github_repo": "google-cloud-python",
138+
"github_banner": True,
139+
"font_family": "'Roboto', Georgia, sans",
140+
"head_font_family": "'Roboto', Georgia, serif",
141+
"code_font_family": "'Roboto Mono', 'Consolas', monospace",
142+
}
134143

135144
# Add any paths that contain custom themes here, relative to this directory.
136145
# html_theme_path = []
@@ -219,6 +228,17 @@
219228
# Output file base name for HTML help builder.
220229
htmlhelp_basename = "google-cloud-language-doc"
221230

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

224244
latex_elements = {
@@ -315,6 +335,16 @@
315335
intersphinx_mapping = {
316336
"python": ("http://python.readthedocs.org/en/latest/", None),
317337
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
338+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
339+
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
340+
"google.api_core": (
341+
"https://googleapis.github.io/google-cloud-python/latest",
342+
None,
343+
),
344+
"grpc": ("https://grpc.io/grpc/python/", None),
345+
"requests": ("http://docs.python-requests.org/en/master/", None),
346+
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
347+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
318348
}
319349

320350
# Napoleon settings

docs/index.rst

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

33

44
.. toctree::

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=100")
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+
)

synth.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"updateTime": "2019-04-04T12:17:35.761105Z",
2+
"updateTime": "2019-04-23T12:21:40.976812Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.23",
8-
"dockerImage": "googleapis/artman@sha256:f3a3f88000dc1cd1b4826104c5574aa5c534f6793fbf66e888d11c0d7ef5762e"
7+
"version": "0.17.0",
8+
"dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "04193ea2f8121388c998ab49c382f2c03417dcce",
16-
"internalRef": "241828309"
15+
"sha": "547e19e7df398e9290e8e3674d7351efc500f9b0",
16+
"internalRef": "244712781"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "python_library",
2222
"origin": "synthtool.gcp",
23-
"version": "2019.2.26"
23+
"version": "2019.4.10"
2424
}
2525
}
2626
],

0 commit comments

Comments
 (0)