Skip to content

Commit c012a11

Browse files
authored
chore: migrate default branch from master to main (#148)
1 parent c338733 commit c012a11

File tree

8 files changed

+74
-23
lines changed

8 files changed

+74
-23
lines changed

.kokoro/build.sh

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 6 deletions
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/google-auth-library-python-oauthlib
5151
# repository into your local repository.
5252
$ git remote add upstream [email protected]:googleapis/google-auth-library-python-oauthlib.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 ``google-auth-library-python-oauthlib``. 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/google-auth-library-python-oauthlib/blob/master/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/google-auth-library-python-oauthlib/blob/main/CONTRIBUTING.rst``)
213213
may cause problems creating links or rendering the description.
214214

215215
.. _description on PyPI: https://pypi.org/project/google-auth-oauthlib
@@ -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/google-auth-library-python-oauthlib/blob/master/noxfile.py
237+
.. _config: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/main/noxfile.py
238238

239239

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

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ oauthlib integration for Google Auth
55

66
This library provides `oauthlib`_ integration with `google-auth`_.
77

8-
.. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=master
8+
.. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=main
99
:target: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib
1010
.. |docs| image:: https://readthedocs.org/projects/google-auth-oauthlib/badge/?version=latest
1111
:target: https://google-auth-oauthlib.readthedocs.io/en/latest/
@@ -49,4 +49,4 @@ License
4949

5050
Apache 2.0 - See `the LICENSE`_ for more information.
5151

52-
.. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/master/LICENSE
52+
.. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/main/LICENSE

docs/conf.py

Lines changed: 5 additions & 5 deletions
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 = "google-auth-oauthlib"
@@ -280,7 +280,7 @@
280280
# author, documentclass [howto, manual, or own class]).
281281
latex_documents = [
282282
(
283-
master_doc,
283+
root_doc,
284284
"google-auth-oauthlib.tex",
285285
"google-auth-oauthlib Documentation",
286286
author,
@@ -315,7 +315,7 @@
315315
# (source start file, name, description, authors, manual section).
316316
man_pages = [
317317
(
318-
master_doc,
318+
root_doc,
319319
"google-auth-oauthlib",
320320
"google-auth-oauthlib Documentation",
321321
[author],
@@ -334,7 +334,7 @@
334334
# dir menu entry, description, category)
335335
texinfo_documents = [
336336
(
337-
master_doc,
337+
root_doc,
338338
"google-auth-oauthlib",
339339
"google-auth-oauthlib Documentation",
340340
author,

google_auth_oauthlib/flow.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(
119119
code_verifier.
120120
.. _client secrets:
121121
https://github.com/googleapis/google-api-python-client/blob
122-
/master/docs/client-secrets.md
122+
/main/docs/client-secrets.md
123123
"""
124124
self.client_type = client_type
125125
"""str: The client type, either ``'web'`` or ``'installed'``"""
@@ -152,8 +152,7 @@ def from_client_config(cls, client_config, scopes, **kwargs):
152152
format.
153153
154154
.. _client secrets:
155-
https://github.com/googleapis/google-api-python-client/blob/
156-
master/docs/client-secrets.md
155+
https://github.com/googleapis/google-api-python-client/blob/main/docs/client-secrets.md
157156
"""
158157
if "web" in client_config:
159158
client_type = "web"
@@ -356,7 +355,7 @@ class InstalledAppFlow(Flow):
356355
response, such as using an embedded web view.
357356
358357
.. _Installed Application Authorization Flow:
359-
https://github.com/googleapis/google-api-python-client/blob/master/docs/oauth-installed.md
358+
https://github.com/googleapis/google-api-python-client/blob/main/docs/oauth-installed.md
360359
"""
361360

362361
_OOB_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob"

google_auth_oauthlib/helpers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def session_from_client_config(client_config, scopes, **kwargs):
5151
oauthlib session and the validated client configuration.
5252
5353
.. _client secrets:
54-
https://github.com/googleapis/google-api-python-client/blob/master/
55-
docs/client-secrets.md
54+
https://github.com/googleapis/google-api-python-client/blob/main/docs/client-secrets.md
5655
"""
5756

5857
if "web" in client_config:
@@ -89,8 +88,7 @@ def session_from_client_secrets_file(client_secrets_file, scopes, **kwargs):
8988
oauthlib session and the validated client configuration.
9089
9190
.. _client secrets:
92-
https://github.com/googleapis/google-api-python-client/blob/master/
93-
docs/client-secrets.md
91+
https://github.com/googleapis/google-api-python-client/blob/main/docs/client-secrets.md
9492
"""
9593
with open(client_secrets_file, "r") as json_file:
9694
client_config = json.load(json_file)

owlbot.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,58 @@
4343
r'value: "docs-staging-v2-staging"'
4444
)
4545

46+
# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged
47+
48+
# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
49+
s.replace(".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main")
50+
51+
# Customize CONTRIBUTING.rst to replace master with main
52+
s.replace(
53+
"CONTRIBUTING.rst",
54+
"fetch and merge changes from upstream into master",
55+
"fetch and merge changes from upstream into main",
56+
)
57+
58+
s.replace(
59+
"CONTRIBUTING.rst",
60+
"git merge upstream/master",
61+
"git merge upstream/main",
62+
)
63+
64+
s.replace(
65+
"CONTRIBUTING.rst",
66+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""",
67+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""",
68+
)
69+
70+
s.replace(
71+
"CONTRIBUTING.rst",
72+
"remote \(``master``\)",
73+
"remote (``main``)",
74+
)
75+
76+
s.replace(
77+
"CONTRIBUTING.rst",
78+
"blob/master/CONTRIBUTING.rst",
79+
"blob/main/CONTRIBUTING.rst",
80+
)
81+
82+
s.replace(
83+
"CONTRIBUTING.rst",
84+
"blob/master/noxfile.py",
85+
"blob/main/noxfile.py",
86+
)
87+
88+
s.replace(
89+
"docs/conf.py",
90+
"master_doc",
91+
"root_doc",
92+
)
93+
94+
s.replace(
95+
"docs/conf.py",
96+
"# The master toctree document.",
97+
"# The root toctree document.",
98+
)
99+
46100
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 commit comments

Comments
 (0)