Skip to content

Commit

Permalink
Datacatalog: Add nox session docs, reorder methods (via synth). (#7766
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yoshi-automation authored and busunkim96 committed May 1, 2019
1 parent 6ef6c51 commit f953c55
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
1 change: 1 addition & 0 deletions datacatalog/docs/README.rst
2 changes: 1 addition & 1 deletion datacatalog/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: /../datacatalog/README.rst
.. include:: README.rst


API Reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ def from_service_account_file(cls, filename, *args, **kwargs):
from_service_account_json = from_service_account_file

@classmethod
def location_path(cls, project, location):
"""Return a fully-qualified location string."""
def entry_path(cls, project, location, entry_group, entry):
"""Return a fully-qualified entry string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}",
"projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}",
project=project,
location=location,
entry_group=entry_group,
entry=entry,
)

@classmethod
def entry_path(cls, project, location, entry_group, entry):
"""Return a fully-qualified entry string."""
def location_path(cls, project, location):
"""Return a fully-qualified location string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}",
"projects/{project}/locations/{location}",
project=project,
location=location,
entry_group=entry_group,
entry=entry,
)

def __init__(
Expand Down
20 changes: 20 additions & 0 deletions datacatalog/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 @@ -138,3 +139,22 @@ def cover(session):
session.run("coverage", "report", "--show-missing", "--fail-under=80")

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', ''),
)
16 changes: 12 additions & 4 deletions datacatalog/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"updateTime": "2019-04-15T18:20:24.527055Z",
"updateTime": "2019-05-01T20:20:02.550542Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.25",
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
"version": "0.17.1",
"dockerImage": "googleapis/artman@sha256:a40ca4dd4ef031c0ded4df4909ffdf7b3f20d29b23e682ef991eb60ba0ca6025"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "316b54c401ab9bc08ed71cb362915b9e7a23bb05",
"internalRef": "246014263"
}
},
{
"template": {
"name": "python_library",
"origin": "synthtool.gcp",
"version": "2019.4.10"
"version": "2019.4.24"
}
}
],
Expand Down

0 comments on commit f953c55

Please sign in to comment.