From 775f1627877682f2cab4df6ba8a1b3746df02a1f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 23 Jun 2020 13:06:32 -0700 Subject: [PATCH] chore: update templates (#48) --- packages/google-cloud-asset/.flake8 | 2 + packages/google-cloud-asset/.gitignore | 2 + .../.kokoro/samples/lint/common.cfg | 34 ++++++ .../.kokoro/samples/lint/continuous.cfg | 6 + .../.kokoro/samples/lint/periodic.cfg | 6 + .../.kokoro/samples/lint/presubmit.cfg | 6 + .../.kokoro/samples/python3.6/common.cfg | 34 ++++++ .../.kokoro/samples/python3.6/continuous.cfg | 7 ++ .../.kokoro/samples/python3.6/periodic.cfg | 6 + .../.kokoro/samples/python3.6/presubmit.cfg | 6 + .../.kokoro/samples/python3.7/common.cfg | 34 ++++++ .../.kokoro/samples/python3.7/continuous.cfg | 6 + .../.kokoro/samples/python3.7/periodic.cfg | 6 + .../.kokoro/samples/python3.7/presubmit.cfg | 6 + .../.kokoro/samples/python3.8/common.cfg | 34 ++++++ .../.kokoro/samples/python3.8/continuous.cfg | 6 + .../.kokoro/samples/python3.8/periodic.cfg | 6 + .../.kokoro/samples/python3.8/presubmit.cfg | 6 + .../.kokoro/test-samples.sh | 104 ++++++++++++++++++ packages/google-cloud-asset/MANIFEST.in | 3 + packages/google-cloud-asset/docs/conf.py | 17 +-- .../google-cloud-asset/google/cloud/asset.py | 6 +- .../google/cloud/asset_v1/__init__.py | 6 +- .../asset_v1/gapic/asset_service_client.py | 22 ++-- .../asset_service_grpc_transport.py | 4 +- .../cloud/asset_v1/proto/asset_service_pb2.py | 20 ++-- .../google/cloud/asset_v1/proto/assets_pb2.py | 12 +- .../google/cloud/asset_v1/types.py | 5 +- .../google/cloud/asset_v1beta1/__init__.py | 6 +- .../gapic/asset_service_client.py | 8 +- .../asset_service_grpc_transport.py | 4 +- .../asset_v1beta1/proto/asset_service_pb2.py | 8 +- .../google/cloud/asset_v1beta1/types.py | 5 +- .../google/cloud/asset_v1p1beta1/__init__.py | 5 +- .../gapic/asset_service_client.py | 10 +- .../asset_service_grpc_transport.py | 4 +- .../cloud/asset_v1p1beta1/proto/assets_pb2.py | 10 +- .../google/cloud/asset_v1p1beta1/types.py | 12 +- .../google/cloud/asset_v1p2beta1/__init__.py | 6 +- .../gapic/asset_service_client.py | 20 ++-- .../asset_service_grpc_transport.py | 4 +- .../proto/asset_service_pb2.py | 22 ++-- .../google/cloud/asset_v1p2beta1/types.py | 11 +- .../google/cloud/asset_v1p4beta1/__init__.py | 6 +- .../gapic/asset_service_client.py | 14 ++- .../asset_service_grpc_transport.py | 4 +- .../proto/asset_service_pb2.py | 20 ++-- .../cloud/asset_v1p4beta1/proto/assets_pb2.py | 2 +- .../google/cloud/asset_v1p4beta1/types.py | 5 +- packages/google-cloud-asset/noxfile.py | 31 ++++-- .../scripts/decrypt-secrets.sh | 33 ++++++ .../scripts/readme-gen/readme_gen.py | 66 +++++++++++ .../readme-gen/templates/README.tmpl.rst | 87 +++++++++++++++ .../readme-gen/templates/auth.tmpl.rst | 9 ++ .../templates/auth_api_key.tmpl.rst | 14 +++ .../templates/install_deps.tmpl.rst | 29 +++++ .../templates/install_portaudio.tmpl.rst | 35 ++++++ packages/google-cloud-asset/synth.metadata | 6 +- packages/google-cloud-asset/synth.py | 3 + .../google-cloud-asset/testing/.gitignore | 3 + 60 files changed, 784 insertions(+), 130 deletions(-) create mode 100644 packages/google-cloud-asset/.kokoro/samples/lint/common.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/lint/continuous.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/lint/periodic.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/lint/presubmit.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.6/common.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.6/continuous.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.6/periodic.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.6/presubmit.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.7/common.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.7/continuous.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.7/periodic.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.7/presubmit.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.8/common.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.8/continuous.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.8/periodic.cfg create mode 100644 packages/google-cloud-asset/.kokoro/samples/python3.8/presubmit.cfg create mode 100755 packages/google-cloud-asset/.kokoro/test-samples.sh create mode 100755 packages/google-cloud-asset/scripts/decrypt-secrets.sh create mode 100644 packages/google-cloud-asset/scripts/readme-gen/readme_gen.py create mode 100644 packages/google-cloud-asset/scripts/readme-gen/templates/README.tmpl.rst create mode 100644 packages/google-cloud-asset/scripts/readme-gen/templates/auth.tmpl.rst create mode 100644 packages/google-cloud-asset/scripts/readme-gen/templates/auth_api_key.tmpl.rst create mode 100644 packages/google-cloud-asset/scripts/readme-gen/templates/install_deps.tmpl.rst create mode 100644 packages/google-cloud-asset/scripts/readme-gen/templates/install_portaudio.tmpl.rst create mode 100644 packages/google-cloud-asset/testing/.gitignore diff --git a/packages/google-cloud-asset/.flake8 b/packages/google-cloud-asset/.flake8 index 20fe9bda2ee4..ed9316381c9c 100644 --- a/packages/google-cloud-asset/.flake8 +++ b/packages/google-cloud-asset/.flake8 @@ -21,6 +21,8 @@ exclude = # Exclude generated code. **/proto/** **/gapic/** + **/services/** + **/types/** *_pb2.py # Standard linting exemptions. diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index 3fb06e09ce74..b87e1ed580d9 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -10,6 +10,7 @@ dist build eggs +.eggs parts bin var @@ -49,6 +50,7 @@ bigquery/docs/generated # Virtual environment env/ coverage.xml +sponge_log.xml # System test environment variables. system_tests/local_test_setup diff --git a/packages/google-cloud-asset/.kokoro/samples/lint/common.cfg b/packages/google-cloud-asset/.kokoro/samples/lint/common.cfg new file mode 100644 index 000000000000..3f0e83964466 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/lint/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "lint" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-asset/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-asset/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/lint/continuous.cfg b/packages/google-cloud-asset/.kokoro/samples/lint/continuous.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/lint/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/lint/periodic.cfg b/packages/google-cloud-asset/.kokoro/samples/lint/periodic.cfg new file mode 100644 index 000000000000..50fec9649732 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/lint/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/lint/presubmit.cfg b/packages/google-cloud-asset/.kokoro/samples/lint/presubmit.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/lint/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.6/common.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.6/common.cfg new file mode 100644 index 000000000000..9e996a7bb7ff --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.6/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.6" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-asset/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-asset/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.6/continuous.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.6/continuous.cfg new file mode 100644 index 000000000000..7218af1499e5 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.6/continuous.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} + diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.6/periodic.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.6/periodic.cfg new file mode 100644 index 000000000000..50fec9649732 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.6/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.6/presubmit.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.6/presubmit.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.6/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.7/common.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.7/common.cfg new file mode 100644 index 000000000000..a1ab4729f34e --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.7/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.7" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-asset/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-asset/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.7/continuous.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.7/continuous.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.7/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.7/periodic.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.7/periodic.cfg new file mode 100644 index 000000000000..50fec9649732 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.7/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.7/presubmit.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.7/presubmit.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.7/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.8/common.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.8/common.cfg new file mode 100644 index 000000000000..03bec5df7eba --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.8/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-asset/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-asset/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.8/continuous.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.8/continuous.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.8/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.8/periodic.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.8/periodic.cfg new file mode 100644 index 000000000000..50fec9649732 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.8/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/samples/python3.8/presubmit.cfg b/packages/google-cloud-asset/.kokoro/samples/python3.8/presubmit.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/samples/python3.8/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/google-cloud-asset/.kokoro/test-samples.sh b/packages/google-cloud-asset/.kokoro/test-samples.sh new file mode 100755 index 000000000000..5972d11e4ac0 --- /dev/null +++ b/packages/google-cloud-asset/.kokoro/test-samples.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# `-e` enables the script to automatically fail when a command fails +# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero +set -eo pipefail +# Enables `**` to include files nested inside sub-folders +shopt -s globstar + +cd github/python-asset + +# Run periodic samples tests at latest release +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then + LATEST_RELEASE=$(git describe --abbrev=0 --tags) + git checkout $LATEST_RELEASE +fi + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Debug: show build environment +env | grep KOKORO + +# Install nox +python3.6 -m pip install --upgrade --quiet nox + +# Use secrets acessor service account to get secrets +if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then + gcloud auth activate-service-account \ + --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \ + --project="cloud-devrel-kokoro-resources" +fi + +# This script will create 3 files: +# - testing/test-env.sh +# - testing/service-account.json +# - testing/client-secrets.json +./scripts/decrypt-secrets.sh + +source ./testing/test-env.sh +export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json + +# For cloud-run session, we activate the service account for gcloud sdk. +gcloud auth activate-service-account \ + --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" + +export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json + +echo -e "\n******************** TESTING PROJECTS ********************" + +# Switch to 'fail at end' to allow all tests to complete before exiting. +set +e +# Use RTN to return a non-zero value if the test fails. +RTN=0 +ROOT=$(pwd) +# Find all requirements.txt in the samples directory (may break on whitespace). +for file in samples/**/requirements.txt; do + cd "$ROOT" + # Navigate to the project folder. + file=$(dirname "$file") + cd "$file" + + echo "------------------------------------------------------------" + echo "- testing $file" + echo "------------------------------------------------------------" + + # Use nox to execute the tests for the project. + python3.6 -m nox -s "$RUN_TESTS_SESSION" + EXIT=$? + + # If this is a periodic build, send the test log to the Build Cop Bot. + # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop. + if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then + chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop + $KOKORO_GFILE_DIR/linux_amd64/buildcop + fi + + if [[ $EXIT -ne 0 ]]; then + RTN=1 + echo -e "\n Testing failed: Nox returned a non-zero exit code. \n" + else + echo -e "\n Testing completed.\n" + fi + +done +cd "$ROOT" + +# Workaround for Kokoro permissions issue: delete secrets +rm testing/{test-env.sh,client-secrets.json,service-account.json} + +exit "$RTN" \ No newline at end of file diff --git a/packages/google-cloud-asset/MANIFEST.in b/packages/google-cloud-asset/MANIFEST.in index 68855abc3f02..e9e29d12033d 100644 --- a/packages/google-cloud-asset/MANIFEST.in +++ b/packages/google-cloud-asset/MANIFEST.in @@ -20,3 +20,6 @@ recursive-include google *.json *.proto recursive-include tests * global-exclude *.py[co] global-exclude __pycache__ + +# Exclude scripts for samples readmegen +prune scripts/readme-gen \ No newline at end of file diff --git a/packages/google-cloud-asset/docs/conf.py b/packages/google-cloud-asset/docs/conf.py index 3b11ec8053a7..3f521b958900 100644 --- a/packages/google-cloud-asset/docs/conf.py +++ b/packages/google-cloud-asset/docs/conf.py @@ -38,21 +38,18 @@ "sphinx.ext.napoleon", "sphinx.ext.todo", "sphinx.ext.viewcode", + "recommonmark", ] # autodoc/autosummary flags autoclass_content = "both" -autodoc_default_flags = ["members"] +autodoc_default_options = {"members": True} autosummary_generate = True # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] @@ -293,7 +290,13 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, "google-cloud-asset", u"google-cloud-asset Documentation", [author], 1) + ( + master_doc, + "google-cloud-asset", + u"google-cloud-asset Documentation", + [author], + 1, + ) ] # If true, show URL addresses after external links. @@ -334,7 +337,7 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), "grpc": ("https://grpc.io/grpc/python/", None), } diff --git a/packages/google-cloud-asset/google/cloud/asset.py b/packages/google-cloud-asset/google/cloud/asset.py index c6c189194e7c..2ebc40d02d05 100644 --- a/packages/google-cloud-asset/google/cloud/asset.py +++ b/packages/google-cloud-asset/google/cloud/asset.py @@ -22,4 +22,8 @@ from google.cloud.asset_v1 import types -__all__ = ("enums", "types", "AssetServiceClient") +__all__ = ( + "enums", + "types", + "AssetServiceClient", +) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py index 1e76aa20cc54..f8e02189bae5 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py @@ -38,4 +38,8 @@ class AssetServiceClient(asset_service_client.AssetServiceClient): enums = enums -__all__ = ("enums", "types", "AssetServiceClient") +__all__ = ( + "enums", + "types", + "AssetServiceClient", +) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/gapic/asset_service_client.py b/packages/google-cloud-asset/google/cloud/asset_v1/gapic/asset_service_client.py index 8e2ba0d06e91..fb3aae32eb67 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/gapic/asset_service_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/gapic/asset_service_client.py @@ -45,7 +45,7 @@ from google.protobuf import timestamp_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset").version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset",).version class AssetServiceClient(object): @@ -82,7 +82,7 @@ def from_service_account_file(cls, filename, *args, **kwargs): def feed_path(cls, project, feed): """Return a fully-qualified feed string.""" return google.api_core.path_template.expand( - "projects/{project}/feeds/{feed}", project=project, feed=feed + "projects/{project}/feeds/{feed}", project=project, feed=feed, ) @classmethod @@ -179,12 +179,12 @@ def __init__( self.transport = transport else: self.transport = asset_service_grpc_transport.AssetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -195,7 +195,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -257,7 +257,7 @@ def delete_feed( client_info=self._client_info, ) - request = asset_service_pb2.DeleteFeedRequest(name=name) + request = asset_service_pb2.DeleteFeedRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -584,7 +584,7 @@ def create_feed( ) request = asset_service_pb2.CreateFeedRequest( - parent=parent, feed_id=feed_id, feed=feed + parent=parent, feed_id=feed_id, feed=feed, ) if metadata is None: metadata = [] @@ -658,7 +658,7 @@ def get_feed( client_info=self._client_info, ) - request = asset_service_pb2.GetFeedRequest(name=name) + request = asset_service_pb2.GetFeedRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -730,7 +730,7 @@ def list_feeds( client_info=self._client_info, ) - request = asset_service_pb2.ListFeedsRequest(parent=parent) + request = asset_service_pb2.ListFeedsRequest(parent=parent,) if metadata is None: metadata = [] metadata = list(metadata) @@ -818,7 +818,7 @@ def update_feed( ) request = asset_service_pb2.UpdateFeedRequest( - feed=feed, update_mask=update_mask + feed=feed, update_mask=update_mask, ) if metadata is None: metadata = [] @@ -1109,7 +1109,7 @@ def search_all_iam_policies( ) request = asset_service_pb2.SearchAllIamPoliciesRequest( - scope=scope, query=query, page_size=page_size + scope=scope, query=query, page_size=page_size, ) if metadata is None: metadata = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py b/packages/google-cloud-asset/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py index 315f98dd2807..6b1df3042fe2 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py @@ -54,7 +54,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -73,7 +73,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel) + "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel), } # Because this API includes a method that returns a diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/proto/asset_service_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1/proto/asset_service_pb2.py index 8e09f9009f57..801f940e1054 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/proto/asset_service_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/proto/asset_service_pb2.py @@ -416,7 +416,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -536,7 +536,7 @@ serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -577,7 +577,7 @@ serialized_options=b"\340A\002", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -618,7 +618,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -719,7 +719,7 @@ serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -796,7 +796,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1640, serialized_end=1811, @@ -865,7 +865,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1813, serialized_end=1880, @@ -977,7 +977,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -1018,7 +1018,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -1035,7 +1035,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1998, serialized_end=2103, diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/proto/assets_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1/proto/assets_pb2.py index d0c3db03ec20..a1f1a8036a4b 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/proto/assets_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/proto/assets_pb2.py @@ -218,7 +218,7 @@ ], extensions=[], nested_types=[], - enum_types=[_TEMPORALASSET_PRIORASSETSTATE], + enum_types=[_TEMPORALASSET_PRIORASSETSTATE,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -503,7 +503,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=979, serialized_end=1549, @@ -905,7 +905,7 @@ ), ], extensions=[], - nested_types=[_RESOURCESEARCHRESULT_LABELSENTRY], + nested_types=[_RESOURCESEARCHRESULT_LABELSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -943,7 +943,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -1042,7 +1042,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[ @@ -1145,7 +1145,7 @@ ), ], extensions=[], - nested_types=[_IAMPOLICYSEARCHRESULT_EXPLANATION], + nested_types=[_IAMPOLICYSEARCHRESULT_EXPLANATION,], enum_types=[], serialized_options=None, is_extendable=False, diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/types.py b/packages/google-cloud-asset/google/cloud/asset_v1/types.py index 6d6fc67b4acb..dcb5e9e09a54 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/types.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/types.py @@ -53,7 +53,10 @@ expr_pb2, ] -_local_modules = [asset_service_pb2, assets_pb2] +_local_modules = [ + asset_service_pb2, + assets_pb2, +] names = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1beta1/__init__.py index 8680e8844c0e..d060c1ae1c65 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1beta1/__init__.py @@ -38,4 +38,8 @@ class AssetServiceClient(asset_service_client.AssetServiceClient): enums = enums -__all__ = ("enums", "types", "AssetServiceClient") +__all__ = ( + "enums", + "types", + "AssetServiceClient", +) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/asset_service_client.py b/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/asset_service_client.py index a3416e7703bd..3da195da80c8 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/asset_service_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/asset_service_client.py @@ -40,7 +40,7 @@ from google.protobuf import timestamp_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset").version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset",).version class AssetServiceClient(object): @@ -167,12 +167,12 @@ def __init__( self.transport = transport else: self.transport = asset_service_grpc_transport.AssetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -183,7 +183,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. diff --git a/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py b/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py index ec983c277eec..26dc3c3e8bb6 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py @@ -54,7 +54,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -73,7 +73,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel) + "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel), } # Because this API includes a method that returns a diff --git a/packages/google-cloud-asset/google/cloud/asset_v1beta1/proto/asset_service_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1beta1/proto/asset_service_pb2.py index 0dd4decf1e69..e7edfafff94e 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1beta1/proto/asset_service_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1beta1/proto/asset_service_pb2.py @@ -390,7 +390,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -431,7 +431,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -448,7 +448,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1077, serialized_end=1177, @@ -517,7 +517,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1179, serialized_end=1246, diff --git a/packages/google-cloud-asset/google/cloud/asset_v1beta1/types.py b/packages/google-cloud-asset/google/cloud/asset_v1beta1/types.py index e1f5fb7d1013..b2daa8fffa22 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1beta1/types.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1beta1/types.py @@ -41,7 +41,10 @@ expr_pb2, ] -_local_modules = [asset_service_pb2, assets_pb2] +_local_modules = [ + asset_service_pb2, + assets_pb2, +] names = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py index 579f8ff37bf7..dbcb4243b53b 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py @@ -36,4 +36,7 @@ class AssetServiceClient(asset_service_client.AssetServiceClient): __doc__ = asset_service_client.AssetServiceClient.__doc__ -__all__ = ("types", "AssetServiceClient") +__all__ = ( + "types", + "AssetServiceClient", +) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/asset_service_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/asset_service_client.py index 0af1e09a1cd4..1c5a93dfdf41 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/asset_service_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/asset_service_client.py @@ -36,7 +36,7 @@ from google.cloud.asset_v1p1beta1.proto import asset_service_pb2_grpc -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset").version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset",).version class AssetServiceClient(object): @@ -156,12 +156,12 @@ def __init__( self.transport = transport else: self.transport = asset_service_grpc_transport.AssetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -172,7 +172,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -401,7 +401,7 @@ def search_all_iam_policies( ) request = asset_service_pb2.SearchAllIamPoliciesRequest( - scope=scope, query=query, page_size=page_size + scope=scope, query=query, page_size=page_size, ) if metadata is None: metadata = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/transports/asset_service_grpc_transport.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/transports/asset_service_grpc_transport.py index 8b7027a81065..5bffbf512eb6 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/transports/asset_service_grpc_transport.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/gapic/transports/asset_service_grpc_transport.py @@ -53,7 +53,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -72,7 +72,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel) + "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel), } @classmethod diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/proto/assets_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/proto/assets_pb2.py index a7d10aecbb3d..f85e6e9adfc7 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/proto/assets_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/proto/assets_pb2.py @@ -270,7 +270,7 @@ ), ], extensions=[], - nested_types=[_STANDARDRESOURCEMETADATA_LABELSENTRY], + nested_types=[_STANDARDRESOURCEMETADATA_LABELSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -367,10 +367,10 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], - nested_types=[_IAMPOLICYSEARCHRESULT_EXPLANATION_MATCHEDPERMISSIONSENTRY], + nested_types=[_IAMPOLICYSEARCHRESULT_EXPLANATION_MATCHEDPERMISSIONSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -467,7 +467,7 @@ ), ], extensions=[], - nested_types=[_IAMPOLICYSEARCHRESULT_EXPLANATION], + nested_types=[_IAMPOLICYSEARCHRESULT_EXPLANATION,], enum_types=[], serialized_options=None, is_extendable=False, @@ -505,7 +505,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/types.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/types.py index 68b91edfc994..f5cf296d2086 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/types.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/types.py @@ -26,9 +26,15 @@ from google.type import expr_pb2 -_shared_modules = [policy_pb2, expr_pb2] - -_local_modules = [asset_service_pb2, assets_pb2] +_shared_modules = [ + policy_pb2, + expr_pb2, +] + +_local_modules = [ + asset_service_pb2, + assets_pb2, +] names = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py index 86acaab4797b..30e985756fac 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py @@ -38,4 +38,8 @@ class AssetServiceClient(asset_service_client.AssetServiceClient): enums = enums -__all__ = ("enums", "types", "AssetServiceClient") +__all__ = ( + "enums", + "types", + "AssetServiceClient", +) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py index 690a7930ce30..5cbf3acf44ed 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py @@ -38,7 +38,7 @@ from google.protobuf import field_mask_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset").version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset",).version class AssetServiceClient(object): @@ -75,7 +75,7 @@ def from_service_account_file(cls, filename, *args, **kwargs): def feed_path(cls, project, feed): """Return a fully-qualified feed string.""" return google.api_core.path_template.expand( - "projects/{project}/feeds/{feed}", project=project, feed=feed + "projects/{project}/feeds/{feed}", project=project, feed=feed, ) def __init__( @@ -165,12 +165,12 @@ def __init__( self.transport = transport else: self.transport = asset_service_grpc_transport.AssetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -181,7 +181,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -243,7 +243,7 @@ def delete_feed( client_info=self._client_info, ) - request = asset_service_pb2.DeleteFeedRequest(name=name) + request = asset_service_pb2.DeleteFeedRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -337,7 +337,7 @@ def create_feed( ) request = asset_service_pb2.CreateFeedRequest( - parent=parent, feed_id=feed_id, feed=feed + parent=parent, feed_id=feed_id, feed=feed, ) if metadata is None: metadata = [] @@ -411,7 +411,7 @@ def get_feed( client_info=self._client_info, ) - request = asset_service_pb2.GetFeedRequest(name=name) + request = asset_service_pb2.GetFeedRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -483,7 +483,7 @@ def list_feeds( client_info=self._client_info, ) - request = asset_service_pb2.ListFeedsRequest(parent=parent) + request = asset_service_pb2.ListFeedsRequest(parent=parent,) if metadata is None: metadata = [] metadata = list(metadata) @@ -571,7 +571,7 @@ def update_feed( ) request = asset_service_pb2.UpdateFeedRequest( - feed=feed, update_mask=update_mask + feed=feed, update_mask=update_mask, ) if metadata is None: metadata = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/transports/asset_service_grpc_transport.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/transports/asset_service_grpc_transport.py index 563adde2c8e8..3cff05c55e20 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/transports/asset_service_grpc_transport.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/gapic/transports/asset_service_grpc_transport.py @@ -53,7 +53,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -72,7 +72,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel) + "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel), } @classmethod diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py index 0bc7d29ef55d..1af5d9b36553 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py @@ -198,7 +198,7 @@ serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -239,7 +239,7 @@ serialized_options=b"\340A\002", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -280,7 +280,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -381,7 +381,7 @@ serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -422,7 +422,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -439,7 +439,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=895, serialized_end=997, @@ -472,7 +472,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -489,7 +489,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=999, serialized_end=1044, @@ -522,7 +522,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -563,7 +563,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -580,7 +580,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1082, serialized_end=1194, diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/types.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/types.py index 11791870497b..56de02c40d1e 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/types.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/types.py @@ -25,9 +25,14 @@ from google.protobuf import field_mask_pb2 -_shared_modules = [empty_pb2, field_mask_pb2] - -_local_modules = [asset_service_pb2] +_shared_modules = [ + empty_pb2, + field_mask_pb2, +] + +_local_modules = [ + asset_service_pb2, +] names = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/__init__.py index 8101c6101efb..61850095572b 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/__init__.py @@ -38,4 +38,8 @@ class AssetServiceClient(asset_service_client.AssetServiceClient): enums = enums -__all__ = ("enums", "types", "AssetServiceClient") +__all__ = ( + "enums", + "types", + "AssetServiceClient", +) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py index a27310be3d8a..193ecf6c5ff3 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py @@ -38,7 +38,7 @@ from google.longrunning import operations_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset").version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset",).version class AssetServiceClient(object): @@ -158,12 +158,12 @@ def __init__( self.transport = transport else: self.transport = asset_service_grpc_transport.AssetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -174,7 +174,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -265,7 +265,9 @@ def export_iam_policy_analysis( ) request = asset_service_pb2.ExportIamPolicyAnalysisRequest( - analysis_query=analysis_query, output_config=output_config, options=options_ + analysis_query=analysis_query, + output_config=output_config, + options=options_, ) if metadata is None: metadata = [] @@ -352,7 +354,7 @@ def analyze_iam_policy( ) request = asset_service_pb2.AnalyzeIamPolicyRequest( - analysis_query=analysis_query, options=options_ + analysis_query=analysis_query, options=options_, ) if metadata is None: metadata = [] diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py index 22295df8175a..ea8df7ca7df6 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py @@ -54,7 +54,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -73,7 +73,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel) + "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel), } # Because this API includes a method that returns a diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py index 45c68b6cbf9b..3e489833b09e 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py @@ -70,7 +70,7 @@ serialized_options=b"\340A\002", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -110,7 +110,7 @@ serialized_options=b"\340A\002", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -487,7 +487,7 @@ ), ], extensions=[], - nested_types=[_ANALYZEIAMPOLICYREQUEST_OPTIONS], + nested_types=[_ANALYZEIAMPOLICYREQUEST_OPTIONS,], enum_types=[], serialized_options=None, is_extendable=False, @@ -663,7 +663,7 @@ ), ], extensions=[], - nested_types=[_ANALYZEIAMPOLICYRESPONSE_IAMPOLICYANALYSIS], + nested_types=[_ANALYZEIAMPOLICYRESPONSE_IAMPOLICYANALYSIS,], enum_types=[], serialized_options=None, is_extendable=False, @@ -701,7 +701,7 @@ serialized_options=b"\340A\002", file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], @@ -741,10 +741,10 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], - nested_types=[_IAMPOLICYANALYSISOUTPUTCONFIG_GCSDESTINATION], + nested_types=[_IAMPOLICYANALYSISOUTPUTCONFIG_GCSDESTINATION,], enum_types=[], serialized_options=None, is_extendable=False, @@ -758,7 +758,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1885, serialized_end=2070, @@ -967,7 +967,7 @@ ), ], extensions=[], - nested_types=[_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS], + nested_types=[_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS,], enum_types=[], serialized_options=None, is_extendable=False, @@ -1005,7 +1005,7 @@ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, - ) + ), ], extensions=[], nested_types=[], diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/assets_pb2.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/assets_pb2.py index 1f7ed7d001cb..227c6fe8fc15 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/assets_pb2.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/proto/assets_pb2.py @@ -231,7 +231,7 @@ containing_type=None, create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=689, serialized_end=844, diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/types.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/types.py index 6edd443331d9..00e0a7cbf3dd 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/types.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/types.py @@ -39,7 +39,10 @@ expr_pb2, ] -_local_modules = [asset_service_pb2, assets_pb2] +_local_modules = [ + asset_service_pb2, + assets_pb2, +] names = [] diff --git a/packages/google-cloud-asset/noxfile.py b/packages/google-cloud-asset/noxfile.py index 71f30eadca1f..ece032ada007 100644 --- a/packages/google-cloud-asset/noxfile.py +++ b/packages/google-cloud-asset/noxfile.py @@ -23,14 +23,15 @@ import nox -BLACK_VERSION = "black==19.3b0" +BLACK_VERSION = "black==19.10b0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] -if os.path.exists("samples"): - BLACK_PATHS.append("samples") +DEFAULT_PYTHON_VERSION = "3.8" +SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"] +UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8"] -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): """Run linters. @@ -38,7 +39,9 @@ def lint(session): serious code quality issues. """ session.install("flake8", BLACK_VERSION) - session.run("black", "--check", *BLACK_PATHS) + session.run( + "black", "--check", *BLACK_PATHS, + ) session.run("flake8", "google", "tests") @@ -53,10 +56,12 @@ def blacken(session): check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) + session.run( + "black", *BLACK_PATHS, + ) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" session.install("docutils", "pygments") @@ -84,13 +89,13 @@ def default(session): ) -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) def unit(session): """Run the unit test suite.""" default(session) -@nox.session(python=["2.7", "3.7"]) +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" system_test_path = os.path.join("tests", "system.py") @@ -110,7 +115,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils") + session.install( + "mock", "pytest", "google-cloud-testutils", + ) session.install("-e", ".") # Run py.test against the system tests. @@ -120,7 +127,7 @@ def system(session): session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -133,7 +140,7 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def docs(session): """Build the docs for this library.""" diff --git a/packages/google-cloud-asset/scripts/decrypt-secrets.sh b/packages/google-cloud-asset/scripts/decrypt-secrets.sh new file mode 100755 index 000000000000..ff599eb2af25 --- /dev/null +++ b/packages/google-cloud-asset/scripts/decrypt-secrets.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2015 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT=$( dirname "$DIR" ) + +# Work from the project root. +cd $ROOT + +# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources. +PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}" + +gcloud secrets versions access latest --secret="python-docs-samples-test-env" \ + > testing/test-env.sh +gcloud secrets versions access latest \ + --secret="python-docs-samples-service-account" \ + > testing/service-account.json +gcloud secrets versions access latest \ + --secret="python-docs-samples-client-secrets" \ + > testing/client-secrets.json \ No newline at end of file diff --git a/packages/google-cloud-asset/scripts/readme-gen/readme_gen.py b/packages/google-cloud-asset/scripts/readme-gen/readme_gen.py new file mode 100644 index 000000000000..d309d6e97518 --- /dev/null +++ b/packages/google-cloud-asset/scripts/readme-gen/readme_gen.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Copyright 2016 Google Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Generates READMEs using configuration defined in yaml.""" + +import argparse +import io +import os +import subprocess + +import jinja2 +import yaml + + +jinja_env = jinja2.Environment( + trim_blocks=True, + loader=jinja2.FileSystemLoader( + os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + +README_TMPL = jinja_env.get_template('README.tmpl.rst') + + +def get_help(file): + return subprocess.check_output(['python', file, '--help']).decode() + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('source') + parser.add_argument('--destination', default='README.rst') + + args = parser.parse_args() + + source = os.path.abspath(args.source) + root = os.path.dirname(source) + destination = os.path.join(root, args.destination) + + jinja_env.globals['get_help'] = get_help + + with io.open(source, 'r') as f: + config = yaml.load(f) + + # This allows get_help to execute in the right directory. + os.chdir(root) + + output = README_TMPL.render(config) + + with io.open(destination, 'w') as f: + f.write(output) + + +if __name__ == '__main__': + main() diff --git a/packages/google-cloud-asset/scripts/readme-gen/templates/README.tmpl.rst b/packages/google-cloud-asset/scripts/readme-gen/templates/README.tmpl.rst new file mode 100644 index 000000000000..4fd239765b0a --- /dev/null +++ b/packages/google-cloud-asset/scripts/readme-gen/templates/README.tmpl.rst @@ -0,0 +1,87 @@ +{# The following line is a lie. BUT! Once jinja2 is done with it, it will + become truth! #} +.. This file is automatically generated. Do not edit this file directly. + +{{product.name}} Python Samples +=============================================================================== + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/README.rst + + +This directory contains samples for {{product.name}}. {{product.description}} + +{{description}} + +.. _{{product.name}}: {{product.url}} + +{% if required_api_url %} +To run the sample, you need to enable the API at: {{required_api_url}} +{% endif %} + +{% if required_role %} +To run the sample, you need to have `{{required_role}}` role. +{% endif %} + +{{other_required_steps}} + +{% if setup %} +Setup +------------------------------------------------------------------------------- + +{% for section in setup %} + +{% include section + '.tmpl.rst' %} + +{% endfor %} +{% endif %} + +{% if samples %} +Samples +------------------------------------------------------------------------------- + +{% for sample in samples %} +{{sample.name}} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +{% if not sample.hide_cloudshell_button %} +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/{{sample.file}},{{folder}}/README.rst +{% endif %} + + +{{sample.description}} + +To run this sample: + +.. code-block:: bash + + $ python {{sample.file}} +{% if sample.show_help %} + + {{get_help(sample.file)|indent}} +{% endif %} + + +{% endfor %} +{% endif %} + +{% if cloud_client_library %} + +The client library +------------------------------------------------------------------------------- + +This sample uses the `Google Cloud Client Library for Python`_. +You can read the documentation for more details on API usage and use GitHub +to `browse the source`_ and `report issues`_. + +.. _Google Cloud Client Library for Python: + https://googlecloudplatform.github.io/google-cloud-python/ +.. _browse the source: + https://github.com/GoogleCloudPlatform/google-cloud-python +.. _report issues: + https://github.com/GoogleCloudPlatform/google-cloud-python/issues + +{% endif %} + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/packages/google-cloud-asset/scripts/readme-gen/templates/auth.tmpl.rst b/packages/google-cloud-asset/scripts/readme-gen/templates/auth.tmpl.rst new file mode 100644 index 000000000000..1446b94a5e3a --- /dev/null +++ b/packages/google-cloud-asset/scripts/readme-gen/templates/auth.tmpl.rst @@ -0,0 +1,9 @@ +Authentication +++++++++++++++ + +This sample requires you to have authentication setup. Refer to the +`Authentication Getting Started Guide`_ for instructions on setting up +credentials for applications. + +.. _Authentication Getting Started Guide: + https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-asset/scripts/readme-gen/templates/auth_api_key.tmpl.rst b/packages/google-cloud-asset/scripts/readme-gen/templates/auth_api_key.tmpl.rst new file mode 100644 index 000000000000..11957ce2714a --- /dev/null +++ b/packages/google-cloud-asset/scripts/readme-gen/templates/auth_api_key.tmpl.rst @@ -0,0 +1,14 @@ +Authentication +++++++++++++++ + +Authentication for this service is done via an `API Key`_. To obtain an API +Key: + +1. Open the `Cloud Platform Console`_ +2. Make sure that billing is enabled for your project. +3. From the **Credentials** page, create a new **API Key** or use an existing + one for your project. + +.. _API Key: + https://developers.google.com/api-client-library/python/guide/aaa_apikeys +.. _Cloud Console: https://console.cloud.google.com/project?_ diff --git a/packages/google-cloud-asset/scripts/readme-gen/templates/install_deps.tmpl.rst b/packages/google-cloud-asset/scripts/readme-gen/templates/install_deps.tmpl.rst new file mode 100644 index 000000000000..a0406dba8c84 --- /dev/null +++ b/packages/google-cloud-asset/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -0,0 +1,29 @@ +Install Dependencies +++++++++++++++++++++ + +#. Clone python-docs-samples and change directory to the sample directory you want to use. + + .. code-block:: bash + + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. + + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup + +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. + + .. code-block:: bash + + $ virtualenv env + $ source env/bin/activate + +#. Install the dependencies needed to run the samples. + + .. code-block:: bash + + $ pip install -r requirements.txt + +.. _pip: https://pip.pypa.io/ +.. _virtualenv: https://virtualenv.pypa.io/ diff --git a/packages/google-cloud-asset/scripts/readme-gen/templates/install_portaudio.tmpl.rst b/packages/google-cloud-asset/scripts/readme-gen/templates/install_portaudio.tmpl.rst new file mode 100644 index 000000000000..5ea33d18c00c --- /dev/null +++ b/packages/google-cloud-asset/scripts/readme-gen/templates/install_portaudio.tmpl.rst @@ -0,0 +1,35 @@ +Install PortAudio ++++++++++++++++++ + +Install `PortAudio`_. This is required by the `PyAudio`_ library to stream +audio from your computer's microphone. PyAudio depends on PortAudio for cross-platform compatibility, and is installed differently depending on the +platform. + +* For Mac OS X, you can use `Homebrew`_:: + + brew install portaudio + + **Note**: if you encounter an error when running `pip install` that indicates + it can't find `portaudio.h`, try running `pip install` with the following + flags:: + + pip install --global-option='build_ext' \ + --global-option='-I/usr/local/include' \ + --global-option='-L/usr/local/lib' \ + pyaudio + +* For Debian / Ubuntu Linux:: + + apt-get install portaudio19-dev python-all-dev + +* Windows may work without having to install PortAudio explicitly (it will get + installed with PyAudio). + +For more details, see the `PyAudio installation`_ page. + + +.. _PyAudio: https://people.csail.mit.edu/hubert/pyaudio/ +.. _PortAudio: http://www.portaudio.com/ +.. _PyAudio installation: + https://people.csail.mit.edu/hubert/pyaudio/#downloads +.. _Homebrew: http://brew.sh diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index b0f90d19e9aa..6bb8186ea607 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-asset.git", - "sha": "6e48d8c588e907256144dc16e431c4a54fefddff" + "sha": "f0e299275662a3a1825698069258753d9a37100e" } }, { @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "d2364eb80b840a36136c8ce12f1c6efabcc9600e" + "sha": "cf2eff09d0f5319a4dc5cdce2b6356d85af4a798" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "d2364eb80b840a36136c8ce12f1c6efabcc9600e" + "sha": "cf2eff09d0f5319a4dc5cdce2b6356d85af4a798" } } ], diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 37ac87033a32..457079a23eb1 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -174,4 +174,7 @@ def project_path(cls, project): templated_files = gcp.CommonTemplates().py_library(unit_cov_level=79, cov_level=80) s.move(templated_files) +# TODO(busunkim): Use latest sphinx after microgenerator transition +s.replace("noxfile.py", '"sphinx"', '"sphinx<3.0.0"') + s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/packages/google-cloud-asset/testing/.gitignore b/packages/google-cloud-asset/testing/.gitignore new file mode 100644 index 000000000000..b05fbd630881 --- /dev/null +++ b/packages/google-cloud-asset/testing/.gitignore @@ -0,0 +1,3 @@ +test-env.sh +service-account.json +client-secrets.json \ No newline at end of file