Skip to content

Commit 247e71e

Browse files
yoshi-automationbusunkim96
authored andcommitted
Add nox session docs, reorder methods (via synth). (googleapis#7783)
1 parent a65ed77 commit 247e71e

11 files changed

Lines changed: 101 additions & 34 deletions

File tree

‎tasks/docs/README.rst‎

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

‎tasks/docs/changelog.md‎

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

‎tasks/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-tasks-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-tasks Documentation",
284308
author,
285309
"google-cloud-tasks",
286-
"GAPIC library for the {metadata.shortName} service",
310+
"GAPIC library for the {metadata.shortName} v2 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

‎tasks/docs/index.rst‎

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

33
API Reference
44
-------------
@@ -33,3 +33,13 @@ v2beta2:
3333

3434
gapic/v2beta2/api
3535
gapic/v2beta2/types
36+
37+
Changelog
38+
---------
39+
40+
For a list of all `google-cloud-tasks` releases.
41+
42+
.. toctree::
43+
:maxdepth: 2
44+
45+
changelog

‎tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7777

7878
from_service_account_json = from_service_account_file
7979

80-
@classmethod
81-
def project_path(cls, project):
82-
"""Return a fully-qualified project string."""
83-
return google.api_core.path_template.expand(
84-
"projects/{project}", project=project
85-
)
86-
8780
@classmethod
8881
def location_path(cls, project, location):
8982
"""Return a fully-qualified location string."""
@@ -93,6 +86,13 @@ def location_path(cls, project, location):
9386
location=location,
9487
)
9588

89+
@classmethod
90+
def project_path(cls, project):
91+
"""Return a fully-qualified project string."""
92+
return google.api_core.path_template.expand(
93+
"projects/{project}", project=project
94+
)
95+
9696
@classmethod
9797
def queue_path(cls, project, location, queue):
9898
"""Return a fully-qualified queue string."""

‎tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7979

8080
from_service_account_json = from_service_account_file
8181

82-
@classmethod
83-
def project_path(cls, project):
84-
"""Return a fully-qualified project string."""
85-
return google.api_core.path_template.expand(
86-
"projects/{project}", project=project
87-
)
88-
8982
@classmethod
9083
def location_path(cls, project, location):
9184
"""Return a fully-qualified location string."""
@@ -95,6 +88,13 @@ def location_path(cls, project, location):
9588
location=location,
9689
)
9790

91+
@classmethod
92+
def project_path(cls, project):
93+
"""Return a fully-qualified project string."""
94+
return google.api_core.path_template.expand(
95+
"projects/{project}", project=project
96+
)
97+
9898
@classmethod
9999
def queue_path(cls, project, location, queue):
100100
"""Return a fully-qualified queue string."""

‎tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7777

7878
from_service_account_json = from_service_account_file
7979

80-
@classmethod
81-
def project_path(cls, project):
82-
"""Return a fully-qualified project string."""
83-
return google.api_core.path_template.expand(
84-
"projects/{project}", project=project
85-
)
86-
8780
@classmethod
8881
def location_path(cls, project, location):
8982
"""Return a fully-qualified location string."""
@@ -93,6 +86,13 @@ def location_path(cls, project, location):
9386
location=location,
9487
)
9588

89+
@classmethod
90+
def project_path(cls, project):
91+
"""Return a fully-qualified project string."""
92+
return google.api_core.path_template.expand(
93+
"projects/{project}", project=project
94+
)
95+
9696
@classmethod
9797
def queue_path(cls, project, location, queue):
9898
"""Return a fully-qualified queue string."""

‎tasks/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+
)

‎tasks/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-05T12:22:33.235008Z",
2+
"updateTime": "2019-04-30T20:51:13.173132Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.25",
8-
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
7+
"version": "0.17.1",
8+
"dockerImage": "googleapis/artman@sha256:a40ca4dd4ef031c0ded4df4909ffdf7b3f20d29b23e682ef991eb60ba0ca6025"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "327ff9c09f4b2bcc9633f035a58ad348e45fb2a0",
16-
"internalRef": "242045478"
15+
"sha": "be3005c8a16e8424d0330e977ac78f2976bf01d3",
16+
"internalRef": "245840921"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "python_library",
2222
"origin": "synthtool.gcp",
23-
"version": "2019.2.26"
23+
"version": "2019.4.24"
2424
}
2525
}
2626
],

‎tasks/synth.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
gapic = gcp.GAPICGenerator()
2424
common = gcp.CommonTemplates()
25-
excludes = ["README.rst", "setup.py", "nox*.py", "docs/conf.py", "docs/index.rst"]
25+
excludes = ["README.rst", "setup.py", "nox*.py", "docs/index.rst"]
2626

2727
# ----------------------------------------------------------------------------
2828
# Generate tasks GAPIC layer

0 commit comments

Comments
 (0)