From e88c378e7b70e19fbc18d54d2f4710f5324d6bd3 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Tue, 18 Jun 2019 05:13:40 -0700 Subject: [PATCH] [CHANGE ME] Re-generated containeranalysis to pick up changes in the API or client library generator. --- containeranalysis/.coveragerc | 1 + containeranalysis/.flake8 | 1 + containeranalysis/README.rst | 8 +- containeranalysis/docs/index.rst | 86 ++++++++++++++++--- .../container_analysis_grpc_transport.py | 6 +- .../proto/containeranalysis.proto | 1 + .../proto/containeranalysis_pb2.py | 5 +- containeranalysis/noxfile.py | 52 +++++------ containeranalysis/setup.cfg | 1 + containeranalysis/setup.py | 64 +++++++------- containeranalysis/synth.metadata | 10 +-- 11 files changed, 152 insertions(+), 83 deletions(-) diff --git a/containeranalysis/.coveragerc b/containeranalysis/.coveragerc index 6b9ab9da4a1b..b178b094aa1d 100644 --- a/containeranalysis/.coveragerc +++ b/containeranalysis/.coveragerc @@ -1,3 +1,4 @@ +# Generated by synthtool. DO NOT EDIT! [run] branch = True diff --git a/containeranalysis/.flake8 b/containeranalysis/.flake8 index 61766fa84d02..0268ecc9c55c 100644 --- a/containeranalysis/.flake8 +++ b/containeranalysis/.flake8 @@ -1,3 +1,4 @@ +# Generated by synthtool. DO NOT EDIT! [flake8] ignore = E203, E266, E501, W503 exclude = diff --git a/containeranalysis/README.rst b/containeranalysis/README.rst index 645ee4364aa5..36c82c65053a 100644 --- a/containeranalysis/README.rst +++ b/containeranalysis/README.rst @@ -8,9 +8,9 @@ and retrieval of critical metadata about all of your software artifacts. - `Product Documentation`_ .. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Container Analysis API: https://cloud.google.com/container-registry/docs/container-analysis +.. _Container Analysis API: https://cloud.google.com/containeranalysis .. _Client Library Documentation: https://googleapis.github.io/google-cloud-python/latest/containeranalysis/usage.html -.. _Product Documentation: https://cloud.google.com/container-registry/docs/container-analysis +.. _Product Documentation: https://cloud.google.com/containeranalysis Quick Start ----------- @@ -24,7 +24,7 @@ In order to use this library, you first need to go through the following steps: .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Container Analysis API.: https://cloud.google.com/container-registry/docs/container-analysis +.. _Enable the Container Analysis API.: https://cloud.google.com/containeranalysis .. _Setup Authentication.: https://googleapis.github.io/google-cloud-python/latest/core/auth.html Installation @@ -72,5 +72,5 @@ Next Steps - View this `repository’s main README`_ to see the full list of Cloud APIs that we cover. -.. _Container Analysis API Product documentation: https://cloud.google.com/container-registry/docs/container-analysis +.. _Container Analysis API Product documentation: https://cloud.google.com/containeranalysis .. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file diff --git a/containeranalysis/docs/index.rst b/containeranalysis/docs/index.rst index 51824979bb1b..4857da4f3bec 100644 --- a/containeranalysis/docs/index.rst +++ b/containeranalysis/docs/index.rst @@ -1,20 +1,84 @@ -.. include:: README.rst +Python Client for Container Analysis API (`Alpha`_) +=================================================== -Api Reference -------------- -.. toctree:: - :maxdepth: 2 +`Container Analysis API`_: An implementation of the Grafeas API, which stores, and enables querying +and retrieval of critical metadata about all of your software artifacts. - gapic/v1/api - gapic/v1/types +- `Client Library Documentation`_ +- `Product Documentation`_ + +.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst +.. _Container Analysis API: https://cloud.google.com/containeranalysis +.. _Client Library Documentation: https://googleapis.github.io/google-cloud-python/latest/containeranalysis/usage.html +.. _Product Documentation: https://cloud.google.com/containeranalysis + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. `Enable the Container Analysis API.`_ +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Enable the Container Analysis API.: https://cloud.google.com/containeranalysis +.. _Setup Authentication.: https://googleapis.github.io/google-cloud-python/latest/core/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ -Changelog ----------- -For all previous ``google-cloud-containeranalysis`` releases: +Mac/Linux +^^^^^^^^^ +.. code-block:: console + + pip install virtualenv + virtualenv + source /bin/activate + /bin/pip install google-cloud-containeranalysis + + +Windows +^^^^^^^ + +.. code-block:: console + + pip install virtualenv + virtualenv + \Scripts\activate + \Scripts\pip.exe install google-cloud-containeranalysis + +Next Steps +~~~~~~~~~~ + +- Read the `Client Library Documentation`_ for Container Analysis API + API to see other available methods on the client. +- Read the `Container Analysis API Product documentation`_ to learn + more about the product and see How-to Guides. +- View this `repository’s main README`_ to see the full list of Cloud + APIs that we cover. + +.. _Container Analysis API Product documentation: https://cloud.google.com/containeranalysis +.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst + +Api Reference +------------- .. toctree:: :maxdepth: 2 - changelog \ No newline at end of file + gapic/v1/api + gapic/v1/types \ No newline at end of file diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py index 7627fb4ecc5c..5b368cc3f45b 100644 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py +++ b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py @@ -75,7 +75,7 @@ def __init__( @classmethod def create_channel( - cls, address="containeranalysis.googleapis.com:443", credentials=None + cls, address="containeranalysis.googleapis.com:443", credentials=None, **kwargs ): """Create and return a gRPC channel object. @@ -86,12 +86,14 @@ def create_channel( credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. + kwargs (dict): Keyword arguments, which are passed to the + channel creation. Returns: grpc.Channel: A gRPC channel object. """ return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES + address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs ) @property diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto index 5c855acbd5ee..054d19797452 100644 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto +++ b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto @@ -27,6 +27,7 @@ option go_package = "google.golang.org/genproto/googleapis/devtools/containerana option java_multiple_files = true; option java_package = "com.google.containeranalysis.v1"; option objc_class_prefix = "GCA"; +option ruby_package = "Google::Cloud::ContainerAnalysis::V1"; // Retrieves analysis results of Cloud components such as Docker container // images. The Container Analysis API is an implementation of the diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py index 17d3b1845976..97ecb2b86f10 100644 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py +++ b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto @@ -25,10 +26,10 @@ package="google.devtools.containeranalysis.v1", syntax="proto3", serialized_options=_b( - "\n\037com.google.containeranalysis.v1P\001ZUgoogle.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis\242\002\003GCA\252\002*Google.Cloud.DevTools.ContainerAnalysis.V1" + "\n\037com.google.containeranalysis.v1P\001ZUgoogle.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis\242\002\003GCA\252\002*Google.Cloud.DevTools.ContainerAnalysis.V1\352\002$Google::Cloud::ContainerAnalysis::V1" ), serialized_pb=_b( - '\nHgoogle/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto\x12$google.devtools.containeranalysis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1fgoogle/protobuf/timestamp.proto2\x86\x05\n\x11\x43ontainerAnalysis\x12\xbf\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"t\x82\xd3\xe4\x93\x02n"./v1/{resource=projects/*/notes/*}:setIamPolicy:\x01*Z9"4/v1/{resource=projects/*/occurrences/*}:setIamPolicy:\x01*\x12\xbf\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"t\x82\xd3\xe4\x93\x02n"./v1/{resource=projects/*/notes/*}:getIamPolicy:\x01*Z9"4/v1/{resource=projects/*/occurrences/*}:getIamPolicy:\x01*\x12\xec\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\x80\x01\x82\xd3\xe4\x93\x02z"4/v1/{resource=projects/*/notes/*}:testIamPermissions:\x01*Z?":/v1/{resource=projects/*/occurrences/*}:testIamPermissions:\x01*B\xad\x01\n\x1f\x63om.google.containeranalysis.v1P\x01ZUgoogle.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis\xa2\x02\x03GCA\xaa\x02*Google.Cloud.DevTools.ContainerAnalysis.V1b\x06proto3' + '\nHgoogle/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto\x12$google.devtools.containeranalysis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1fgoogle/protobuf/timestamp.proto2\x86\x05\n\x11\x43ontainerAnalysis\x12\xbf\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"t\x82\xd3\xe4\x93\x02n"./v1/{resource=projects/*/notes/*}:setIamPolicy:\x01*Z9"4/v1/{resource=projects/*/occurrences/*}:setIamPolicy:\x01*\x12\xbf\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"t\x82\xd3\xe4\x93\x02n"./v1/{resource=projects/*/notes/*}:getIamPolicy:\x01*Z9"4/v1/{resource=projects/*/occurrences/*}:getIamPolicy:\x01*\x12\xec\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\x80\x01\x82\xd3\xe4\x93\x02z"4/v1/{resource=projects/*/notes/*}:testIamPermissions:\x01*Z?":/v1/{resource=projects/*/occurrences/*}:testIamPermissions:\x01*B\xd4\x01\n\x1f\x63om.google.containeranalysis.v1P\x01ZUgoogle.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis\xa2\x02\x03GCA\xaa\x02*Google.Cloud.DevTools.ContainerAnalysis.V1\xea\x02$Google::Cloud::ContainerAnalysis::V1b\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, diff --git a/containeranalysis/noxfile.py b/containeranalysis/noxfile.py index cd57422e5961..85a4054e6e68 100644 --- a/containeranalysis/noxfile.py +++ b/containeranalysis/noxfile.py @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Generated by synthtool. DO NOT EDIT! + from __future__ import absolute_import import os import shutil @@ -23,6 +25,12 @@ LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) +BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + +if os.path.exists("samples"): + BLACK_PATHS.append("samples") + + @nox.session(python="3.7") def lint(session): """Run linters. @@ -31,13 +39,7 @@ def lint(session): serious code quality issues. """ session.install("flake8", "black", *LOCAL_DEPS) - session.run( - "black", - "--check", - "google", - "tests", - "docs", - ) + session.run("black", "--check", *BLACK_PATHS) session.run("flake8", "google", "tests") @@ -46,18 +48,13 @@ def blacken(session): """Run black. Format code to uniform standard. - + This currently uses Python 3.6 due to the automated Kokoro run of synthtool. That run uses an image that doesn't have 3.6 installed. Before updating this check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install("black") - session.run( - "black", - "google", - "tests", - "docs", - ) + session.run("black", *BLACK_PATHS) @nox.session(python="3.7") @@ -83,7 +80,7 @@ def default(session): "--cov-append", "--cov-config=.coveragerc", "--cov-report=", - "--cov-fail-under=51", + "--cov-fail-under=0", os.path.join("tests", "unit"), *session.posargs, ) @@ -140,21 +137,24 @@ def cover(session): 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') + session.install("-e", ".") + session.install("sphinx", "alabaster", "recommonmark") - shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) + 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', ''), + "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", ""), ) diff --git a/containeranalysis/setup.cfg b/containeranalysis/setup.cfg index 2a9acf13daa9..3bd555500e37 100644 --- a/containeranalysis/setup.cfg +++ b/containeranalysis/setup.cfg @@ -1,2 +1,3 @@ +# Generated by synthtool. DO NOT EDIT! [bdist_wheel] universal = 1 diff --git a/containeranalysis/setup.py b/containeranalysis/setup.py index 4c1762ed599e..afc189492e83 100644 --- a/containeranalysis/setup.py +++ b/containeranalysis/setup.py @@ -20,32 +20,30 @@ import setuptools - -name = 'google-cloud-containeranalysis' -description = 'Container Analysis API API client library' -version = '0.1.0' -release_status = '3 - Alpha' +name = "google-cloud-containeranalysis" +description = "Container Analysis API API client library" +version = "0.1.0" +release_status = "3 - Alpha" dependencies = [ - 'google-api-core[grpc] >= 1.4.1, < 2.0.0dev', - 'grpc-google-iam-v1 >= 0.11.1, < 0.12dev', - 'enum34; python_version < "3.4"', + "google-api-core[grpc] >= 1.4.1, < 2.0.0dev", + "grpc-google-iam-v1 >= 0.11.1, < 0.12dev", + 'enum34; python_version < "3.4"', ] - package_root = os.path.abspath(os.path.dirname(__file__)) -readme_filename = os.path.join(package_root, 'README.rst') -with io.open(readme_filename, encoding='utf-8') as readme_file: +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: readme = readme_file.read() packages = [ - package for package in setuptools.find_packages() - if package.startswith('google')] + package for package in setuptools.find_packages() if package.startswith("google") +] -namespaces = ['google'] -if 'google.cloud' in packages: - namespaces.append('google.cloud') +namespaces = ["google"] +if "google.cloud" in packages: + namespaces.append("google.cloud") setuptools.setup( @@ -53,28 +51,28 @@ version=version, description=description, long_description=readme, - author='Google LLC', - author_email='googleapis-packages@google.com', - license='Apache 2.0', - url='https://github.com/googleapis/google-cloud-python', + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url="https://github.com/googleapis/google-cloud-python", classifiers=[ release_status, - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Operating System :: OS Independent', - 'Topic :: Internet', + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Operating System :: OS Independent", + "Topic :: Internet", ], - platforms='Posix; MacOS X; Windows', + platforms="Posix; MacOS X; Windows", packages=packages, namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, zip_safe=False, -) \ No newline at end of file +) diff --git a/containeranalysis/synth.metadata b/containeranalysis/synth.metadata index fbcbdd5fc932..66db2dc29fa2 100644 --- a/containeranalysis/synth.metadata +++ b/containeranalysis/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-05T22:45:41.734439Z", + "updateTime": "2019-06-18T12:13:39.969599Z", "sources": [ { "generator": { "name": "artman", - "version": "0.23.1", - "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" + "version": "0.27.0", + "dockerImage": "googleapis/artman@sha256:b036a7f4278d9deb5796f065e5c7f608d47d75369985ca7ab5039998120e972d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5487c78983f6bd5bbafa69166593826a90778a2f", - "internalRef": "251716150" + "sha": "384aa843867c4d17756d14a01f047b6368494d32", + "internalRef": "253675319" } }, {