Skip to content
Closed
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 containeranalysis/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by synthtool. DO NOT EDIT!
[run]
branch = True

Expand Down
1 change: 1 addition & 0 deletions containeranalysis/.flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by synthtool. DO NOT EDIT!
[flake8]
ignore = E203, E266, E501, W503
exclude =
Expand Down
8 changes: 4 additions & 4 deletions containeranalysis/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand All @@ -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
Expand Down Expand Up @@ -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
86 changes: 75 additions & 11 deletions containeranalysis/docs/index.rst
Original file line number Diff line number Diff line change
@@ -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 <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-containeranalysis


Windows
^^^^^^^

.. code-block:: console

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\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
gapic/v1/api
gapic/v1/types
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions containeranalysis/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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")


Expand All @@ -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")
Expand All @@ -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,
)
Expand Down Expand Up @@ -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", ""),
)
1 change: 1 addition & 0 deletions containeranalysis/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Generated by synthtool. DO NOT EDIT!
[bdist_wheel]
universal = 1
64 changes: 31 additions & 33 deletions containeranalysis/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,61 +20,59 @@
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(
name=name,
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,
)
)
Loading