Skip to content

Commit

Permalink
Add nox session 'docs' to remaining manual clients. (#8478)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Jun 27, 2019
1 parent 2f35bec commit 531e9f2
Show file tree
Hide file tree
Showing 28 changed files with 1,353 additions and 30 deletions.
1 change: 1 addition & 0 deletions bigtable/docs/README.rst
2 changes: 1 addition & 1 deletion bigtable/docs/client-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Configuration
-------------

- For an overview of authentication in ``google-cloud-python``,
see :doc:`/core/auth`.
see `Authentication <https://googleapis.dev/python/google-api-core/latest/auth.html#authentication>`_.

- In addition to any authentication configuration, you can also set the
:envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the Google Cloud Console
Expand Down
47 changes: 42 additions & 5 deletions bigtable/docs/conf.py
Original file line number Diff line number Diff line change
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 @@ -44,13 +45,18 @@
autodoc_default_flags = ["members"]
autosummary_generate = True


# 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 @@ -116,6 +122,7 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand All @@ -125,7 +132,15 @@
# 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 +229,18 @@
# Output file base name for HTML help builder.
htmlhelp_basename = "google-cloud-bigtable-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 @@ -260,6 +287,7 @@
# If false, no module index is generated.
# latex_domain_indices = True


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
Expand All @@ -277,6 +305,7 @@
# If true, show URL addresses after external links.
# man_show_urls = False


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -289,7 +318,7 @@
u"google-cloud-bigtable Documentation",
author,
"google-cloud-bigtable",
"GAPIC library for the {metadata.shortName} v2 service",
"GAPIC library for Bigtable",
"APIs",
)
]
Expand All @@ -306,12 +335,20 @@
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False


# Example configuration for intersphinx: refer to the Python standard library.
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.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),
}


# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
Expand Down
2 changes: 1 addition & 1 deletion bigtable/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: /../bigtable/README.rst
.. include:: README.rst


Using the API
Expand Down
2 changes: 1 addition & 1 deletion bigtable/google/cloud/bigtable/row_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def _read_next_response(self):
return self.retry(self._read_next, on_error=self._on_error)()

def __iter__(self):
"""Consume the ``ReadRowsResponse``s from the stream.
"""Consume the ``ReadRowsResponse`` s from the stream.
Read the rows and yield each to the reader
Parse the response and its chunks into a new/existing row in
Expand Down
21 changes: 21 additions & 0 deletions bigtable/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 @@ -135,6 +136,26 @@ def cover(session):

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", ""),
)

@nox.session(python=['2.7', '3.7'])
def snippets(session):
Expand Down
2 changes: 1 addition & 1 deletion core/docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Authentication
==============

The authentication credentials can be implicitly determined from the
environment or directly. See `Authentication <https://googleapis.dev/python/google-api-core/latest/config.html#authentication>`_.
environment or directly. See `Authentication <https://googleapis.dev/python/google-api-core/latest/auth.html#authentication>`_.

Logging in via ``gcloud beta auth application-default login`` will
automatically configure a JSON key file with your default project ID and
Expand Down
1 change: 1 addition & 0 deletions dns/docs/README.rst
Loading

0 comments on commit 531e9f2

Please sign in to comment.