-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR migrates from autosynth to [owl bot](https://github.com/googleapis/repo-automation-bots/tree/master/packages/owl-bot). owl bot will save time for maintainers as it will automatically open PRs when there are updates in [googleapis-gen](https://github.com/googleapis/googleapis-gen/tree/master/google) without requiring maintainers to run `synthtool` to build the client from protos. Additionally, similar to autosynth, PRs will be automatically opened when there are template updates. With owl bot, on every PR, a post-processor image will run so that we won't have to ask contributors to run [blacken](https://github.com/googleapis/python-spanner/blob/master/synth.py#L88).
- Loading branch information
Showing
14 changed files
with
156 additions
and
318 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:cfc0e802701262c211703c468874d767f65dabe6a1a71d0e07bfc8a3d5175f32 | ||
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,30 @@ | ||
# 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/spanner/(v.*)/.*-py/(.*) | ||
dest: /owl-bot-staging/spanner/$1/$2 | ||
- source: /google/spanner/admin/instance/(v.*)/.*-py/(.*) | ||
dest: /owl-bot-staging/spanner_admin_instance/$1/$2 | ||
- source: /google/spanner/admin/database/(v.*)/.*-py/(.*) | ||
dest: /owl-bot-staging/spanner_admin_database/$1/$2 | ||
|
||
begin-after-commit-hash: b154da710c5c9eedee127c07f74b6158c9c22382 | ||
|
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
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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
div#python2-eol { | ||
border-color: red; | ||
border-width: medium; | ||
} | ||
} | ||
|
||
/* Ensure minimum width for 'Parameters' / 'Returns' column */ | ||
dl.field-list > dt { | ||
min-width: 100px | ||
} | ||
|
||
/* Insert space between methods for readability */ | ||
dl.method { | ||
padding-top: 10px; | ||
padding-bottom: 10px | ||
} | ||
|
||
/* Insert empty space between classes */ | ||
dl.class { | ||
padding-bottom: 50px | ||
} |
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,65 @@ | ||
# 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 | ||
from synthtool.languages import python | ||
|
||
common = gcp.CommonTemplates() | ||
|
||
spanner_default_version = "v1" | ||
spanner_admin_instance_default_version = "v1" | ||
spanner_admin_database_default_version = "v1" | ||
|
||
for library in s.get_staging_dirs(spanner_default_version): | ||
if library.parent.absolute() == "spanner": | ||
s.move(library, excludes=["google/cloud/spanner/**", "*.*", "docs/index.rst", "google/cloud/spanner_v1/__init__.py"]) | ||
|
||
s.remove_staging_dirs() | ||
|
||
for library in s.get_staging_dirs(spanner_admin_instance_default_version): | ||
if library.parent.absolute() == "spanner_admin_instance": | ||
s.move(library, excludes=["google/cloud/spanner_admin_instance/**", "*.*", "docs/index.rst"]) | ||
|
||
s.remove_staging_dirs() | ||
|
||
for library in s.get_staging_dirs(spanner_admin_database_default_version): | ||
if library.parent.absolute() == "spanner_admin_database": | ||
s.move(library, excludes=["google/cloud/spanner_admin_database/**", "*.*", "docs/index.rst"]) | ||
|
||
s.remove_staging_dirs() | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Add templated files | ||
# ---------------------------------------------------------------------------- | ||
templated_files = common.py_library(microgenerator=True, samples=True) | ||
s.move(templated_files, excludes=[".coveragerc", "noxfile.py"]) | ||
|
||
# Ensure CI runs on a new instance each time | ||
s.replace( | ||
".kokoro/build.sh", | ||
"# Remove old nox", | ||
"# Set up creating a new instance for each system test run\n" | ||
"export GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE=true\n" | ||
"\n\g<0>", | ||
) | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Samples templates | ||
# ---------------------------------------------------------------------------- | ||
|
||
python.py_samples() | ||
|
||
s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
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
Oops, something went wrong.