Skip to content

Commit 81183d2

Browse files
yoshi-automationbusunkim96
authored andcommitted
Add nox session docs, reorder methods (via synth). (#7779)
1 parent 01cb423 commit 81183d2

File tree

7 files changed

+85
-30
lines changed

7 files changed

+85
-30
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-scheduler/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-scheduler-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 = {
@@ -289,7 +313,7 @@
289313
u"google-cloud-scheduler Documentation",
290314
author,
291315
"google-cloud-scheduler",
292-
"GAPIC library for the {metadata.shortName} v1beta1 service",
316+
"GAPIC library for the {metadata.shortName} service",
293317
"APIs",
294318
)
295319
]
@@ -310,6 +334,16 @@
310334
intersphinx_mapping = {
311335
"python": ("http://python.readthedocs.org/en/latest/", None),
312336
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
337+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
338+
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
339+
"google.api_core": (
340+
"https://googleapis.github.io/google-cloud-python/latest",
341+
None,
342+
),
343+
"grpc": ("https://grpc.io/grpc/python/", None),
344+
"requests": ("http://docs.python-requests.org/en/master/", None),
345+
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
346+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
313347
}
314348

315349
# Napoleon settings

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

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

33
This package includes clients for multiple versions of the Cloud Scheduler
44
API. By default, you will get ``v1``, the latest stable version.

packages/google-cloud-scheduler/google/cloud/scheduler_v1/gapic/cloud_scheduler_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7777
from_service_account_json = from_service_account_file
7878

7979
@classmethod
80-
def project_path(cls, project):
81-
"""Return a fully-qualified project string."""
80+
def job_path(cls, project, location, job):
81+
"""Return a fully-qualified job string."""
8282
return google.api_core.path_template.expand(
83-
"projects/{project}", project=project
83+
"projects/{project}/locations/{location}/jobs/{job}",
84+
project=project,
85+
location=location,
86+
job=job,
8487
)
8588

8689
@classmethod
@@ -93,13 +96,10 @@ def location_path(cls, project, location):
9396
)
9497

9598
@classmethod
96-
def job_path(cls, project, location, job):
97-
"""Return a fully-qualified job string."""
99+
def project_path(cls, project):
100+
"""Return a fully-qualified project string."""
98101
return google.api_core.path_template.expand(
99-
"projects/{project}/locations/{location}/jobs/{job}",
100-
project=project,
101-
location=location,
102-
job=job,
102+
"projects/{project}", project=project
103103
)
104104

105105
def __init__(

packages/google-cloud-scheduler/google/cloud/scheduler_v1beta1/gapic/cloud_scheduler_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7979
from_service_account_json = from_service_account_file
8080

8181
@classmethod
82-
def project_path(cls, project):
83-
"""Return a fully-qualified project string."""
82+
def job_path(cls, project, location, job):
83+
"""Return a fully-qualified job string."""
8484
return google.api_core.path_template.expand(
85-
"projects/{project}", project=project
85+
"projects/{project}/locations/{location}/jobs/{job}",
86+
project=project,
87+
location=location,
88+
job=job,
8689
)
8790

8891
@classmethod
@@ -95,13 +98,10 @@ def location_path(cls, project, location):
9598
)
9699

97100
@classmethod
98-
def job_path(cls, project, location, job):
99-
"""Return a fully-qualified job string."""
101+
def project_path(cls, project):
102+
"""Return a fully-qualified project string."""
100103
return google.api_core.path_template.expand(
101-
"projects/{project}/locations/{location}/jobs/{job}",
102-
project=project,
103-
location=location,
104-
job=job,
104+
"projects/{project}", project=project
105105
)
106106

107107
def __init__(

packages/google-cloud-scheduler/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+
)

packages/google-cloud-scheduler/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:19:48.308871Z",
2+
"updateTime": "2019-04-23T12:25:40.611010Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.25",
8-
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
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": "327ff9c09f4b2bcc9633f035a58ad348e45fb2a0",
16-
"internalRef": "242045478"
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)