Skip to content

Commit e2d3bff

Browse files
authored
chore: migrate to owl bot (#97)
* chore: migrate to owl bot * chore: copy files from googleapis-gen 6a5da3f1274b088752f074da5bc9e30bd1beb27e * chore: run the post processor
1 parent f6dfb3e commit e2d3bff

File tree

5 files changed

+110
-219
lines changed

5 files changed

+110
-219
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docker:
2+
digest: sha256:457583330eec64daa02aeb7a72a04d33e7be2428f646671ce4045dcbc0191b1e
3+
image: gcr.io/repo-automation-bots/owlbot-python:latest
4+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
docker:
16+
image: gcr.io/repo-automation-bots/owlbot-python:latest
17+
18+
deep-remove-regex:
19+
- /owl-bot-staging
20+
21+
deep-copy-regex:
22+
- source: /google/devtools/cloudbuild/(v.*)/.*-py/(.*)
23+
dest: /owl-bot-staging/$1/$2
24+
25+
begin-after-commit-hash: 6a5da3f1274b088752f074da5bc9e30bd1beb27e
26+
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""This script is used to synthesize generated parts of this library."""
16+
17+
import synthtool as s
18+
from synthtool import gcp
19+
20+
common = gcp.CommonTemplates()
21+
22+
default_version = "v1"
23+
24+
for library in s.get_staging_dirs(default_version):
25+
# Fix namespace
26+
s.replace(
27+
library / f"google/devtools/**/*.py",
28+
f"google.devtools.cloudbuild_{library.name}",
29+
f"google.cloud.devtools.cloudbuild_{library.name}",
30+
)
31+
s.replace(
32+
library / f"tests/unit/gapic/**/*.py",
33+
f"google.devtools.cloudbuild_{library.name}",
34+
f"google.cloud.devtools.cloudbuild_{library.name}",
35+
)
36+
s.replace(
37+
library / f"docs/**/*.rst",
38+
f"google.devtools.cloudbuild_{library.name}",
39+
f"google.cloud.devtools.cloudbuild_{library.name}",
40+
)
41+
42+
# Rename package to `google-cloud-build`
43+
s.replace(
44+
[library / "**/*.rst", library / "*/**/*.py", library / "**/*.md"],
45+
"google-cloud-devtools-cloudbuild",
46+
"google-cloud-build"
47+
)
48+
49+
s.move(library / "google/devtools/cloudbuild", "google/cloud/devtools/cloudbuild")
50+
s.move(
51+
library / f"google/devtools/cloudbuild_{library.name}",
52+
f"google/cloud/devtools/cloudbuild_{library.name}"
53+
)
54+
s.move(library / "tests")
55+
s.move(library / "scripts")
56+
s.move(library / "docs", excludes=["index.rst"])
57+
58+
s.remove_staging_dirs()
59+
60+
# ----------------------------------------------------------------------------
61+
# Add templated files
62+
# ----------------------------------------------------------------------------
63+
templated_files = common.py_library(
64+
samples=False, # set to True only if there are samples
65+
microgenerator=True,
66+
cov_level=99,
67+
)
68+
s.move(templated_files, excludes=[".coveragerc"]) # microgenerator has a good .coveragerc file
69+
70+
# TODO(busunkim): Use latest sphinx after microgenerator transition
71+
s.replace("noxfile.py", """['"]sphinx['"]""", '"sphinx<3.0.0"')
72+
73+
s.replace(
74+
"noxfile.py",
75+
"google.cloud.cloudbuild",
76+
"google.cloud.devtools.cloudbuild",
77+
)
78+
79+
80+
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

packages/google-cloud-build/synth.metadata

Lines changed: 0 additions & 126 deletions
This file was deleted.

packages/google-cloud-build/synth.py

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)