-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 130ce904e5d546c312943d10f48799590f9c0f66 * chore: run the post processor
- Loading branch information
Showing
5 changed files
with
128 additions
and
266 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:457583330eec64daa02aeb7a72a04d33e7be2428f646671ce4045dcbc0191b1e | ||
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,26 @@ | ||
# 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-copy-regex: | ||
- source: /google/container/(v.*)/.*-py/(.*) | ||
dest: /owl-bot-staging/$1/$2 | ||
|
||
begin-after-commit-hash: 130ce904e5d546c312943d10f48799590f9c0f66 | ||
|
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,98 @@ | ||
# 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 | ||
from synthtool import gcp | ||
|
||
common = gcp.CommonTemplates() | ||
|
||
default_version = "v1" | ||
|
||
for library in s.get_staging_dirs(default_version): | ||
# Issues exist where python files should define the source encoding | ||
# https://github.com/googleapis/gapic-generator/issues/2097 | ||
s.replace( | ||
library / "google/**/proto/*_pb2.py", | ||
r"(^.*$\n)*", | ||
r"# -*- coding: utf-8 -*-\n\g<0>") | ||
|
||
# Workaround https://github.com/googleapis/gapic-generator/issues/2449 | ||
s.replace( | ||
library / "google/**/proto/cluster_service_pb2.py", | ||
r"nodePool>\n", | ||
r"nodePool>`__\n", | ||
) | ||
s.replace( | ||
library / "google/**/proto/cluster_service_pb2.py", | ||
r"(\s+)`__ instead", | ||
r"\g<1>instead", | ||
) | ||
|
||
# Fix namespace | ||
s.replace( | ||
library / f"google/**/*.py", | ||
f"google.container_{library.name}", | ||
f"google.cloud.container_{library.name}", | ||
) | ||
|
||
s.replace( | ||
library / f"tests/unit/gapic/**/*.py", | ||
f"google.container_{library.name}", | ||
f"google.cloud.container_{library.name}", | ||
) | ||
|
||
s.replace( | ||
library / f"docs/**/*.rst", | ||
f"google.container_{library.name}", | ||
f"google.cloud.container_{library.name}", | ||
) | ||
|
||
# Fix package name | ||
s.replace( | ||
library / "google/**/*.py", | ||
"google-container", | ||
"google-cloud-container" | ||
) | ||
|
||
s.move(library / "google/container", "google/cloud/container") | ||
s.move( | ||
library / f"google/container_{library.name}", | ||
f"google/cloud/container_{library.name}" | ||
) | ||
s.move(library / "tests") | ||
s.move(library / "scripts") | ||
s.move(library / "docs", excludes=["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=99, | ||
) | ||
s.move(templated_files, excludes=[".coveragerc"]) # microgenerator has a good .coveragerc file | ||
|
||
|
||
# TODO(busunkim): Use latest sphinx after microgenerator transition | ||
s.replace("noxfile.py", """['"]sphinx['"]""", '"sphinx<3.0.0"') | ||
|
||
# Temporarily disable warnings due to | ||
# https://github.com/googleapis/gapic-generator-python/issues/525 | ||
s.replace("noxfile.py", '[\"\']-W[\"\']', '# "-W"') | ||
|
||
s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.