This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: migrate to owl bot * chore: copy files from googleapis-gen 6a5da3f1274b088752f074da5bc9e30bd1beb27e * chore: run the post processor * 🦉 Updates from OwlBot * Update .OwlBot.lock.yaml * 🦉 Updates from OwlBot * chore: add SECURITY.md (#122) chore: add SECURITY.md * Update .OwlBot.lock.yaml * 🦉 Updates from OwlBot Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: google-cloud-policy-bot[bot] <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fbf9ba3
commit 29205ef
Showing
8 changed files
with
171 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker: | ||
digest: sha256:c0deb0984dd1c56fa04aaf6974f23f4fe674d80f4329310c3f52cd46c40b7419 | ||
image: gcr.io/repo-automation-bots/owlbot-python:latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2021 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 | ||
# | ||
# 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. | ||
|
||
docker: | ||
image: gcr.io/repo-automation-bots/owlbot-python:latest | ||
|
||
deep-remove-regex: | ||
- /owl-bot-staging | ||
|
||
deep-preserve-regex: | ||
- /owl-bot-staging/v1beta1 | ||
|
||
deep-copy-regex: | ||
- source: /google/devtools/containeranalysis/(v.*)/.*-py/(.*) | ||
dest: /owl-bot-staging/$1/$2 | ||
|
||
begin-after-commit-hash: 6a5da3f1274b088752f074da5bc9e30bd1beb27e | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ repos: | |
hooks: | ||
- id: black | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.1 | ||
rev: 3.9.0 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Copyright 2018 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 | ||
# | ||
# 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. | ||
|
||
"""This script is used to synthesize generated parts of this library.""" | ||
|
||
import synthtool as s | ||
import synthtool.gcp as gcp | ||
import logging | ||
from synthtool.languages import python | ||
|
||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
common = gcp.CommonTemplates() | ||
|
||
default_version = "v1" | ||
|
||
for library in s.get_staging_dirs(default_version): | ||
s.replace( | ||
library / "google/**/*client.py", | ||
r"""google-cloud-devtools-containeranalysis""", | ||
r"""google-cloud-containeranalysis""", | ||
) | ||
|
||
# Fix imported type from grafeas | ||
s.replace( | ||
library / "google/**/types/containeranalysis.py", | ||
"from grafeas\.v1 import vulnerability_pb2 as vulnerability", | ||
"from grafeas.grafeas_v1.types import vulnerability" | ||
) | ||
|
||
# Insert helper method to get grafeas client | ||
s.replace( | ||
library / "google/**/client.py", | ||
"class ContainerAnalysisClientMeta\(type\):", | ||
"from grafeas import grafeas_v1\n" | ||
"from grafeas.grafeas_v1.services.grafeas import transports\n\n" | ||
"class ContainerAnalysisClientMeta(type):", | ||
) | ||
|
||
s.replace( | ||
library / "google/**/async_client.py", | ||
"class ContainerAnalysisAsyncClient:", | ||
"from grafeas import grafeas_v1\n" | ||
"from grafeas.grafeas_v1.services.grafeas import transports\n\n" | ||
"class ContainerAnalysisAsyncClient:", | ||
) | ||
|
||
s.replace( | ||
library / "google/**/client.py", | ||
r"""(\s+)def set_iam_policy\(""", | ||
r'''\n\g<1>def get_grafeas_client( | ||
self | ||
) -> grafeas_v1.GrafeasClient: | ||
transport = type(self).get_transport_class("grpc")() | ||
grafeas_transport = grafeas_v1.services.grafeas.transports.GrafeasGrpcTransport( | ||
host=transport._host, | ||
scopes=transport.AUTH_SCOPES | ||
) | ||
return grafeas_v1.GrafeasClient(transport=grafeas_transport) | ||
\g<1># Service calls | ||
\g<1>def set_iam_policy(''', | ||
) | ||
|
||
s.replace( | ||
library / "google/**/async_client.py", | ||
r"""(\s+)async def set_iam_policy\(""", | ||
r'''\n\g<1>def get_grafeas_client( | ||
self | ||
) -> grafeas_v1.GrafeasClient: | ||
transport = type(self).get_transport_class("grpc_asyncio")() | ||
grafeas_transport = grafeas_v1.services.grafeas.transports.GrafeasGrpcTransport( | ||
host=transport._host, | ||
scopes=transport.AUTH_SCOPES | ||
) | ||
return grafeas_v1.GrafeasClient(transport=grafeas_transport) | ||
\g<1># Service calls | ||
\g<1>async def set_iam_policy(''', | ||
) | ||
|
||
s.move(library, excludes=["setup.py", "README.rst", "docs/index.rst"]) | ||
|
||
s.remove_staging_dirs() | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Add templated files | ||
# ---------------------------------------------------------------------------- | ||
templated_files = common.py_library( | ||
samples=False, # set to True only if there are samples | ||
microgenerator=True, | ||
cov_level=98, | ||
) | ||
s.move(templated_files, excludes=[".coveragerc"]) # microgenerator has a good coveragerc | ||
|
||
python.py_samples(skip_readmes=True) | ||
|
||
|
||
s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.