Skip to content

Commit 9104845

Browse files
yoshi-automationbusunkim96
authored andcommitted
Add session docs to nox (via synth). (#7788)
1 parent 344e8a3 commit 9104845

File tree

8 files changed

+61
-21
lines changed

8 files changed

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

‎packages/google-cloud-websecurityscanner/docs/conf.py

Lines changed: 38 additions & 4 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-websecurityscanner-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 = {
@@ -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
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: /../websecurityscanner/README.rst
1+
.. include:: README.rst
22

33
Api Reference
44
-------------
@@ -7,3 +7,4 @@ Api Reference
77

88
gapic/v1alpha/api
99
gapic/v1alpha/types
10+
changelog

‎packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8383

8484
from_service_account_json = from_service_account_file
8585

86+
@classmethod
87+
def finding_path(cls, project, scan_config, scan_run, finding):
88+
"""Return a fully-qualified finding string."""
89+
return google.api_core.path_template.expand(
90+
"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}",
91+
project=project,
92+
scan_config=scan_config,
93+
scan_run=scan_run,
94+
finding=finding,
95+
)
96+
8697
@classmethod
8798
def project_path(cls, project):
8899
"""Return a fully-qualified project string."""
@@ -109,17 +120,6 @@ def scan_run_path(cls, project, scan_config, scan_run):
109120
scan_run=scan_run,
110121
)
111122

112-
@classmethod
113-
def finding_path(cls, project, scan_config, scan_run, finding):
114-
"""Return a fully-qualified finding string."""
115-
return google.api_core.path_template.expand(
116-
"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}",
117-
project=project,
118-
scan_config=scan_config,
119-
scan_run=scan_run,
120-
finding=finding,
121-
)
122-
123123
def __init__(
124124
self,
125125
transport=None,

‎packages/google-cloud-websecurityscanner/noxfile.py

Lines changed: 2 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

@@ -144,6 +145,7 @@ def docs(session):
144145
"""Build the docs for this library."""
145146

146147
session.install('sphinx', 'alabaster', 'recommonmark')
148+
session.install('e', '.')
147149

148150
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
149151
session.run(

‎packages/google-cloud-websecurityscanner/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-04-18T12:37:39.742265Z",
2+
"updateTime": "2019-04-23T21:39:46.088381Z",
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": "d35ca3509160f09d3b0cc5360531751d95f3e292",
16-
"internalRef": "244086609"
15+
"sha": "45199a22a4e47c8d53213d1ac4a5ad7f22382c56",
16+
"internalRef": "244925894"
1717
}
1818
},
1919
{

‎packages/google-cloud-websecurityscanner/synth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
s.move(library / "google/cloud/websecurityscanner_v1alpha/proto")
3535
s.move(library / "google/cloud/websecurityscanner_v1alpha/gapic")
3636
s.move(library / "tests/unit/gapic/v1alpha")
37+
s.move(library / "docs/conf.py")
3738

3839
# ----------------------------------------------------------------------------
3940
# Add templated files

0 commit comments

Comments
 (0)