Skip to content

Commit 0fad7b0

Browse files
author
Jim Fulton
authoredAug 27, 2021
chore: migrate default branch from master to main (#301)
1 parent 06c3bcc commit 0fad7b0

File tree

6 files changed

+63
-25
lines changed

6 files changed

+63
-25
lines changed
 

‎.kokoro/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox
4141
python3 -m nox --version
4242

4343
# If this is a continuous build, send the test log to the FlakyBot.
44-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
44+
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
4545
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
4646
cleanup() {
4747
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot

‎.kokoro/test-samples-impl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do
8080
EXIT=$?
8181

8282
# If this is a periodic build, send the test log to the FlakyBot.
83-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
83+
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
8484
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
8585
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
8686
$KOKORO_GFILE_DIR/linux_amd64/flakybot

‎CONTRIBUTING.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout:
5050
# Configure remotes such that you can pull changes from the googleapis/python-bigquery-sqlalchemy
5151
# repository into your local repository.
5252
$ git remote add upstream git@github.com:googleapis/python-bigquery-sqlalchemy.git
53-
# fetch and merge changes from upstream into master
53+
# fetch and merge changes from upstream into main
5454
$ git fetch upstream
55-
$ git merge upstream/master
55+
$ git merge upstream/main
5656

5757
Now your local repo is set up such that you will push changes to your GitHub
5858
repo, from which you can submit a pull request.
@@ -110,12 +110,12 @@ Coding Style
110110
variables::
111111

112112
export GOOGLE_CLOUD_TESTING_REMOTE="upstream"
113-
export GOOGLE_CLOUD_TESTING_BRANCH="master"
113+
export GOOGLE_CLOUD_TESTING_BRANCH="main"
114114

115115
By doing this, you are specifying the location of the most up-to-date
116116
version of ``python-bigquery-sqlalchemy``. The the suggested remote name ``upstream``
117117
should point to the official ``googleapis`` checkout and the
118-
the branch should be the main branch on that remote (``master``).
118+
the branch should be the main branch on that remote (``main``).
119119

120120
- This repository contains configuration for the
121121
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
@@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the
209209
``README``. Due to the reStructuredText (``rst``) parser used by
210210
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
211211
instead of
212-
``https://github.com/googleapis/python-bigquery-sqlalchemy/blob/master/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/python-bigquery-sqlalchemy/blob/main/CONTRIBUTING.rst``)
213213
may cause problems creating links or rendering the description.
214214

215215
.. _description on PyPI: https://pypi.org/project/sqlalchemy-bigquery
@@ -234,7 +234,7 @@ We support:
234234

235235
Supported versions can be found in our ``noxfile.py`` `config`_.
236236

237-
.. _config: https://github.com/googleapis/python-bigquery-sqlalchemy/blob/master/noxfile.py
237+
.. _config: https://github.com/googleapis/python-bigquery-sqlalchemy/blob/main/noxfile.py
238238

239239

240240
We also explicitly decided to support Python 3 beginning with version 3.6.

‎docs/conf.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
# The encoding of source files.
7777
# source_encoding = 'utf-8-sig'
7878

79-
# The master toctree document.
80-
master_doc = "index"
79+
# The root toctree document.
80+
root_doc = "index"
8181

8282
# General information about the project.
8383
project = "sqlalchemy-bigquery"
@@ -280,7 +280,7 @@
280280
# author, documentclass [howto, manual, or own class]).
281281
latex_documents = [
282282
(
283-
master_doc,
283+
root_doc,
284284
"sqlalchemy-bigquery.tex",
285285
"sqlalchemy-bigquery Documentation",
286286
author,
@@ -314,13 +314,7 @@
314314
# One entry per manual page. List of tuples
315315
# (source start file, name, description, authors, manual section).
316316
man_pages = [
317-
(
318-
master_doc,
319-
"sqlalchemy-bigquery",
320-
"sqlalchemy-bigquery Documentation",
321-
[author],
322-
1,
323-
)
317+
(root_doc, "sqlalchemy-bigquery", "sqlalchemy-bigquery Documentation", [author], 1,)
324318
]
325319

326320
# If true, show URL addresses after external links.
@@ -334,7 +328,7 @@
334328
# dir menu entry, description, category)
335329
texinfo_documents = [
336330
(
337-
master_doc,
331+
root_doc,
338332
"sqlalchemy-bigquery",
339333
"sqlalchemy-bigquery Documentation",
340334
author,

‎owlbot.py

+45-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def compliance(session):
172172

173173

174174
# Add DB config for SQLAlchemy dialect test suite.
175-
# https://github.com/sqlalchemy/sqlalchemy/blob/master/README.dialects.rst
176175
# https://github.com/googleapis/python-bigquery-sqlalchemy/issues/89
177176
s.replace(
178177
["setup.cfg"],
@@ -195,6 +194,51 @@ def compliance(session):
195194

196195
python.py_samples(skip_readmes=True)
197196

197+
# ----------------------------------------------------------------------------
198+
# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged
199+
200+
# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
201+
s.replace(".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main")
202+
203+
# Customize CONTRIBUTING.rst to replace master with main
204+
s.replace(
205+
"CONTRIBUTING.rst",
206+
"fetch and merge changes from upstream into master",
207+
"fetch and merge changes from upstream into main",
208+
)
209+
210+
s.replace(
211+
"CONTRIBUTING.rst",
212+
"git merge upstream/master",
213+
"git merge upstream/main",
214+
)
215+
216+
s.replace(
217+
"CONTRIBUTING.rst",
218+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""",
219+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""",
220+
)
221+
222+
s.replace(
223+
"CONTRIBUTING.rst",
224+
"remote \(``master``\)",
225+
"remote (``main``)",
226+
)
227+
228+
s.replace(
229+
"CONTRIBUTING.rst",
230+
"blob/master/CONTRIBUTING.rst",
231+
"blob/main/CONTRIBUTING.rst",
232+
)
233+
234+
s.replace(
235+
"CONTRIBUTING.rst",
236+
"blob/master/noxfile.py",
237+
"blob/main/noxfile.py",
238+
)
239+
240+
s.replace("docs/conf.py", "master", "root")
241+
198242
# ----------------------------------------------------------------------------
199243
# Final cleanup
200244
# ----------------------------------------------------------------------------

‎release-procedure.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# sqlalchemy-bigquery release procedure
22

3-
* Checkout master branch
3+
* Checkout main branch
44

5-
git fetch upstream master
6-
git checkout master
7-
git rebase -i upstream/master
5+
git fetch upstream main
6+
git checkout main
7+
git rebase -i upstream/main
88

99
* Update version number in `setup.py`
1010

@@ -13,7 +13,7 @@
1313
* Commit and push
1414

1515
git commit -m "Release x.x.x"
16-
git push upstream master
16+
git push upstream main
1717

1818
* Build the package
1919

0 commit comments

Comments
 (0)
Please sign in to comment.