Skip to content

Commit 162e2f0

Browse files
committed
Add owlbot replacements to persist changes
1 parent 7c9119c commit 162e2f0

File tree

1 file changed

+64
-11
lines changed

1 file changed

+64
-11
lines changed

owlbot.py

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,58 @@
6363
s.replace(
6464
library / f"google/cloud/bigquery_{library.name}/types/standard_sql.py",
6565
r"type_ ",
66-
"type "
66+
"type ",
67+
)
68+
69+
# Remove the replacements below once
70+
# https://github.com/googleapis/synthtool/pull/1188 is merged
71+
72+
# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
73+
s.replace(
74+
".kokoro/*.sh",
75+
"repo-automation-bots/tree/master",
76+
"repo-automation-bots/tree/main",
77+
)
78+
79+
# Customize CONTRIBUTING.rst to replace master with main
80+
s.replace(
81+
"CONTRIBUTING.rst",
82+
"fetch and merge changes from upstream into master",
83+
"fetch and merge changes from upstream into main",
84+
)
85+
86+
s.replace(
87+
"CONTRIBUTING.rst", "git merge upstream/master", "git merge upstream/main",
88+
)
89+
90+
s.replace(
91+
"CONTRIBUTING.rst",
92+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""",
93+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""",
94+
)
95+
96+
s.replace(
97+
"CONTRIBUTING.rst", r"remote \(``master``\)", "remote (``main``)",
98+
)
99+
100+
s.replace(
101+
"CONTRIBUTING.rst",
102+
"blob/master/CONTRIBUTING.rst",
103+
"blob/main/CONTRIBUTING.rst",
104+
)
105+
106+
s.replace(
107+
"CONTRIBUTING.rst", "blob/master/noxfile.py", "blob/main/noxfile.py",
108+
)
109+
110+
s.replace(
111+
"docs/conf.py", "master_doc", "root_doc",
112+
)
113+
114+
s.replace(
115+
"docs/conf.py",
116+
"# The master toctree document.",
117+
"# The root toctree document.",
67118
)
68119

69120
s.move(
@@ -78,8 +129,8 @@
78129
"noxfile.py",
79130
"setup.py",
80131
f"scripts/fixup_bigquery_{library.name}_keywords.py",
81-
f"google/cloud/bigquery/__init__.py",
82-
f"google/cloud/bigquery/py.typed",
132+
"google/cloud/bigquery/__init__.py",
133+
"google/cloud/bigquery/py.typed",
83134
# There are no public API endpoints for the generated ModelServiceClient,
84135
# thus there's no point in generating it and its tests.
85136
f"google/cloud/bigquery_{library.name}/services/**",
@@ -98,9 +149,9 @@
98149
microgenerator=True,
99150
split_system_tests=True,
100151
intersphinx_dependencies={
101-
"pandas": 'http://pandas.pydata.org/pandas-docs/dev',
152+
"pandas": "http://pandas.pydata.org/pandas-docs/dev",
102153
"geopandas": "https://geopandas.org/",
103-
}
154+
},
104155
)
105156

106157
# BigQuery has a custom multiprocessing note
@@ -113,7 +164,7 @@
113164
# Include custom SNIPPETS_TESTS job for performance.
114165
# https://github.com/googleapis/python-bigquery/issues/191
115166
".kokoro/presubmit/presubmit.cfg",
116-
]
167+
],
117168
)
118169

119170
# ----------------------------------------------------------------------------
@@ -125,28 +176,29 @@
125176
s.replace(
126177
"docs/conf.py",
127178
r'\{"members": True\}',
128-
'{"members": True, "inherited-members": True}'
179+
'{"members": True, "inherited-members": True}',
129180
)
130181

131182
# Tell Sphinx to ingore autogenerated docs files.
132183
s.replace(
133184
"docs/conf.py",
134185
r'"samples/snippets/README\.rst",',
135-
'\g<0>\n "bigquery_v2/services.rst", # generated by the code generator',
186+
'\\g<0>\n "bigquery_v2/services.rst", # generated by the code generator',
136187
)
137188

138189
# ----------------------------------------------------------------------------
139190
# pytype-related changes
140191
# ----------------------------------------------------------------------------
141192

142193
# Add .pytype to .gitignore
143-
s.replace(".gitignore", r"\.pytest_cache", "\g<0>\n.pytype")
194+
s.replace(".gitignore", r"\.pytest_cache", "\\g<0>\n.pytype")
144195

145196
# Add pytype config to setup.cfg
146197
s.replace(
147198
"setup.cfg",
148199
r"universal = 1",
149-
textwrap.dedent(""" \g<0>
200+
textwrap.dedent(
201+
""" \\g<0>
150202
151203
[pytype]
152204
python_version = 3.8
@@ -160,7 +212,8 @@
160212
# There's some issue with finding some pyi files, thus disabling.
161213
# The issue https://github.com/google/pytype/issues/150 is closed, but the
162214
# error still occurs for some reason.
163-
pyi-error""")
215+
pyi-error"""
216+
),
164217
)
165218

166219
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 commit comments

Comments
 (0)