|
63 | 63 | s.replace(
|
64 | 64 | library / f"google/cloud/bigquery_{library.name}/types/standard_sql.py",
|
65 | 65 | 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.", |
67 | 118 | )
|
68 | 119 |
|
69 | 120 | s.move(
|
|
78 | 129 | "noxfile.py",
|
79 | 130 | "setup.py",
|
80 | 131 | 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", |
83 | 134 | # There are no public API endpoints for the generated ModelServiceClient,
|
84 | 135 | # thus there's no point in generating it and its tests.
|
85 | 136 | f"google/cloud/bigquery_{library.name}/services/**",
|
|
98 | 149 | microgenerator=True,
|
99 | 150 | split_system_tests=True,
|
100 | 151 | intersphinx_dependencies={
|
101 |
| - "pandas": 'http://pandas.pydata.org/pandas-docs/dev', |
| 152 | + "pandas": "http://pandas.pydata.org/pandas-docs/dev", |
102 | 153 | "geopandas": "https://geopandas.org/",
|
103 |
| - } |
| 154 | + }, |
104 | 155 | )
|
105 | 156 |
|
106 | 157 | # BigQuery has a custom multiprocessing note
|
|
113 | 164 | # Include custom SNIPPETS_TESTS job for performance.
|
114 | 165 | # https://github.com/googleapis/python-bigquery/issues/191
|
115 | 166 | ".kokoro/presubmit/presubmit.cfg",
|
116 |
| - ] |
| 167 | + ], |
117 | 168 | )
|
118 | 169 |
|
119 | 170 | # ----------------------------------------------------------------------------
|
|
125 | 176 | s.replace(
|
126 | 177 | "docs/conf.py",
|
127 | 178 | r'\{"members": True\}',
|
128 |
| - '{"members": True, "inherited-members": True}' |
| 179 | + '{"members": True, "inherited-members": True}', |
129 | 180 | )
|
130 | 181 |
|
131 | 182 | # Tell Sphinx to ingore autogenerated docs files.
|
132 | 183 | s.replace(
|
133 | 184 | "docs/conf.py",
|
134 | 185 | 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', |
136 | 187 | )
|
137 | 188 |
|
138 | 189 | # ----------------------------------------------------------------------------
|
139 | 190 | # pytype-related changes
|
140 | 191 | # ----------------------------------------------------------------------------
|
141 | 192 |
|
142 | 193 | # 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") |
144 | 195 |
|
145 | 196 | # Add pytype config to setup.cfg
|
146 | 197 | s.replace(
|
147 | 198 | "setup.cfg",
|
148 | 199 | r"universal = 1",
|
149 |
| - textwrap.dedent(""" \g<0> |
| 200 | + textwrap.dedent( |
| 201 | + """ \\g<0> |
150 | 202 |
|
151 | 203 | [pytype]
|
152 | 204 | python_version = 3.8
|
|
160 | 212 | # There's some issue with finding some pyi files, thus disabling.
|
161 | 213 | # The issue https://github.com/google/pytype/issues/150 is closed, but the
|
162 | 214 | # error still occurs for some reason.
|
163 |
| - pyi-error""") |
| 215 | + pyi-error""" |
| 216 | + ), |
164 | 217 | )
|
165 | 218 |
|
166 | 219 | s.shell.run(["nox", "-s", "blacken"], hide_output=False)
|
0 commit comments