2626
2727for library in s .get_staging_dirs (default_version ):
2828 # Work around gapic generator bug https://github.com/googleapis/gapic-generator-python/issues/902
29- s .replace (library / f"google/cloud/bigquery_storage_{ library .name } /types/arrow.py" ,
30- r""".
29+ s .replace (
30+ library / f"google/cloud/bigquery_storage_{ library .name } /types/arrow.py" ,
31+ r""".
3132 Attributes:""" ,
32- r""".\n
33+ r""".\n
3334 Attributes:""" ,
3435 )
3536
99100 # The append_rows method doesn't contain keyword arguments that build request
100101 # objects, so flattened tests are not needed and break with TypeError.
101102 s .replace (
102- library / f'tests/unit/gapic/bigquery_storage_{ library .name } */test_big_query_write.py' ,
103+ library
104+ / f"tests/unit/gapic/bigquery_storage_{ library .name } */test_big_query_write.py" ,
103105 r"(@[a-z.()\n]*\n)?(async )?"
104106 r"def test_append_rows_flattened[_a-z]*\(\):\n"
105107 r"( {4}.*|\n)+" ,
106- ' \n ' ,
108+ " \n " ,
107109 )
108110
109111 s .move (
148150
149151python .py_samples (skip_readmes = True )
150152
153+ # Remove the replacements below once
154+ # https://github.com/googleapis/synthtool/pull/1188 is merged
155+
156+ # Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
157+ s .replace (
158+ ".kokoro/*.sh" ,
159+ "repo-automation-bots/tree/master" ,
160+ "repo-automation-bots/tree/main" ,
161+ )
162+
163+ # Customize CONTRIBUTING.rst to replace master with main
164+ s .replace (
165+ "CONTRIBUTING.rst" ,
166+ "fetch and merge changes from upstream into master" ,
167+ "fetch and merge changes from upstream into main" ,
168+ )
169+
170+ s .replace (
171+ "CONTRIBUTING.rst" , "git merge upstream/master" , "git merge upstream/main" ,
172+ )
173+
174+ s .replace (
175+ "CONTRIBUTING.rst" ,
176+ """export GOOGLE_CLOUD_TESTING_BRANCH=\" master\" """ ,
177+ """export GOOGLE_CLOUD_TESTING_BRANCH=\" main\" """ ,
178+ )
179+
180+ s .replace (
181+ "CONTRIBUTING.rst" , "remote \(``master``\)" , "remote (``main``)" ,
182+ )
183+
184+ s .replace (
185+ "CONTRIBUTING.rst" , "blob/master/CONTRIBUTING.rst" , "blob/main/CONTRIBUTING.rst" ,
186+ )
187+
188+ s .replace (
189+ "CONTRIBUTING.rst" , "blob/master/noxfile.py" , "blob/main/noxfile.py" ,
190+ )
191+
192+ s .replace (
193+ "docs/conf.py" , "master_doc" , "root_doc" ,
194+ )
195+
196+ s .replace (
197+ "docs/conf.py" , "# The master toctree document." , "# The root toctree document." ,
198+ )
151199
152- s .shell .run (["nox" , "-s" , "blacken" ], hide_output = False )
200+ s .shell .run (["nox" , "-s" , "blacken" ], hide_output = False )
0 commit comments