Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spanner/docs/README.rst
3 changes: 2 additions & 1 deletion spanner/docs/client-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Configuration
-------------

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

- In addition to any authentication configuration, you can also set the
:envvar:`GCLOUD_PROJECT` environment variable for the Google Cloud Console
Expand Down
40 changes: 35 additions & 5 deletions spanner/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(".."))

__version__ = "0.90.4"
__version__ = "0.1.0"

# -- 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 @@ -37,6 +37,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
]

Expand All @@ -55,7 +56,7 @@
# 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 @@ -130,7 +131,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 @@ -219,6 +228,17 @@
# Output file base name for HTML help builder.
htmlhelp_basename = "google-cloud-spanner-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 @@ -294,7 +314,7 @@
u"google-cloud-spanner Documentation",
author,
"google-cloud-spanner",
"GAPIC library for the {metadata.shortName} v1 service",
"GAPIC library for the {metadata.shortName} service",
"APIs",
)
]
Expand All @@ -315,6 +335,16 @@
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-gax": ("https://gax-python.readthedocs.io/en/latest/", 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),
"fastavro": ("https://fastavro.readthedocs.io/en/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
}

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

Usage Documentation
-------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ def from_service_account_file(cls, filename, *args, **kwargs):
from_service_account_json = from_service_account_file

@classmethod
def instance_path(cls, project, instance):
"""Return a fully-qualified instance string."""
def database_path(cls, project, instance, database):
"""Return a fully-qualified database string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}",
"projects/{project}/instances/{instance}/databases/{database}",
project=project,
instance=instance,
database=database,
)

@classmethod
def database_path(cls, project, instance, database):
"""Return a fully-qualified database string."""
def instance_path(cls, project, instance):
"""Return a fully-qualified instance string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/databases/{database}",
"projects/{project}/instances/{instance}",
project=project,
instance=instance,
database=database,
)

def __init__(
Expand Down Expand Up @@ -760,8 +760,7 @@ def set_iam_policy(

Args:
resource (str): REQUIRED: The resource for which the policy is being specified.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
policy (Union[dict, ~google.cloud.spanner_admin_database_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
size of the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
Expand Down Expand Up @@ -842,8 +841,7 @@ def get_iam_policy(

Args:
resource (str): REQUIRED: The resource for which the policy is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
Expand Down Expand Up @@ -923,8 +921,7 @@ def test_iam_permissions(

Args:
resource (str): REQUIRED: The resource for which the policy detail is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more
information see `IAM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
from_service_account_json = from_service_account_file

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
def instance_path(cls, project, instance):
"""Return a fully-qualified instance string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
"projects/{project}/instances/{instance}",
project=project,
instance=instance,
)

@classmethod
Expand All @@ -116,12 +118,10 @@ def instance_config_path(cls, project, instance_config):
)

@classmethod
def instance_path(cls, project, instance):
"""Return a fully-qualified instance string."""
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}",
project=project,
instance=instance,
"projects/{project}", project=project
)

def __init__(
Expand Down Expand Up @@ -971,8 +971,7 @@ def set_iam_policy(

Args:
resource (str): REQUIRED: The resource for which the policy is being specified.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
policy (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
size of the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
Expand Down Expand Up @@ -1053,8 +1052,7 @@ def get_iam_policy(

Args:
resource (str): REQUIRED: The resource for which the policy is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
Expand Down Expand Up @@ -1134,8 +1132,7 @@ def test_iam_permissions(

Args:
resource (str): REQUIRED: The resource for which the policy detail is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
See the operation documentation for the appropriate value for this field.
permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more
information see `IAM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"interfaces": {
"google.spanner.v1.Spanner": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"idempotent": ["UNAVAILABLE"],
"non_idempotent": [],
"long_running": ["UNAVAILABLE"],
},
Expand Down
20 changes: 20 additions & 0 deletions spanner/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=100")

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', ''),
)
12 changes: 6 additions & 6 deletions spanner/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"updateTime": "2019-04-18T19:22:07.118132Z",
"updateTime": "2019-05-09T18:33:02.121279Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.25",
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
"version": "0.19.0",
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "9a89b9443aa9d43ccecbd5200cb866e551bbd5e7",
"internalRef": "244215550"
"sha": "f86c9531dc49d41267e2117ece1ea29840f15ce3",
"internalRef": "247457584"
}
},
{
"template": {
"name": "python_library",
"origin": "synthtool.gcp",
"version": "2019.4.10"
"version": "2019.5.2"
}
}
],
Expand Down