Skip to content

Commit 054c860

Browse files
busunkim96tseaver
authored andcommitted
Add nox session docs (#7429)
1 parent 8676da4 commit 054c860

File tree

4 files changed

+59
-10
lines changed

4 files changed

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

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

Lines changed: 37 additions & 8 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,13 @@
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:
52-
# source_suffix = ['.rst', '.md']
53-
source_suffix = ".rst"
57+
source_suffix = [".rst", ".md"]
5458

5559
# The encoding of source files.
5660
# source_encoding = 'utf-8-sig'
@@ -120,12 +124,20 @@
120124

121125
# The theme to use for HTML and HTML Help pages. See the documentation for
122126
# a list of builtin themes.
123-
html_theme = "sphinx_rtd_theme"
127+
html_theme = "alabaster"
124128

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

130142
# Add any paths that contain custom themes here, relative to this directory.
131143
# html_theme_path = []
@@ -214,6 +226,18 @@
214226
# Output file base name for HTML help builder.
215227
htmlhelp_basename = "google-cloud-dataproc-doc"
216228

229+
230+
# -- Options for warnings ------------------------------------------------------
231+
232+
233+
suppress_warnings = [
234+
# Temporarily suppress ths 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+
]
217241
# -- Options for LaTeX output ---------------------------------------------
218242

219243
latex_elements = {
@@ -306,10 +330,15 @@
306330
# If true, do not generate a @detailmenu in the "Top" node's menu.
307331
# texinfo_no_detailmenu = False
308332

309-
# Example configuration for intersphinx: refer to the Python standard library.
333+
# Configuration for intersphinx:
310334
intersphinx_mapping = {
311-
"python": ("http://python.readthedocs.org/en/latest/", None),
312-
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
335+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
336+
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
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),
341+
"python": ("https://docs.python.org/3", None),
313342
}
314343

315344
# Napoleon settings

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.. include:: /../dataproc/README.rst
2-
1+
.. include:: README.rst
32

43
API Reference
54
-------------

packages/google-cloud-dataproc/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.6')
144+
def docs(session):
145+
"""Build the docs."""
146+
147+
session.install('sphinx', 'alabaster', 'recommonmark')
148+
session.install('-e', '.')
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+
)

0 commit comments

Comments
 (0)