Skip to content

Commit 1db493c

Browse files
authored
chore: migrate default branch to main (#264)
1 parent e3d34d4 commit 1db493c

File tree

9 files changed

+78
-20
lines changed

9 files changed

+78
-20
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
@@ -49,9 +49,9 @@ You'll have to create a development environment using a Git checkout:
4949
# Configure remotes such that you can pull changes from the googleapis/python-api-core
5050
# repository into your local repository.
5151
$ git remote add upstream [email protected]:googleapis/python-api-core.git
52-
# fetch and merge changes from upstream into master
52+
# fetch and merge changes from upstream into main
5353
$ git fetch upstream
54-
$ git merge upstream/master
54+
$ git merge upstream/main
5555

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

111111
export GOOGLE_CLOUD_TESTING_REMOTE="upstream"
112-
export GOOGLE_CLOUD_TESTING_BRANCH="master"
112+
export GOOGLE_CLOUD_TESTING_BRANCH="main"
113113

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

119119
- This repository contains configuration for the
120120
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
@@ -185,7 +185,7 @@ The `description on PyPI`_ for the project comes directly from the
185185
``README``. Due to the reStructuredText (``rst``) parser used by
186186
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
187187
instead of
188-
``https://github.com/googleapis/python-api-core/blob/master/CONTRIBUTING.rst``)
188+
``https://github.com/googleapis/python-api-core/blob/main/CONTRIBUTING.rst``)
189189
may cause problems creating links or rendering the description.
190190

191191
.. _description on PyPI: https://pypi.org/project/google-api-core
@@ -210,7 +210,7 @@ We support:
210210

211211
Supported versions can be found in our ``noxfile.py`` `config`_.
212212

213-
.. _config: https://github.com/googleapis/python-api-core/blob/master/noxfile.py
213+
.. _config: https://github.com/googleapis/python-api-core/blob/main/noxfile.py
214214

215215

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

docs/conf.py

+5-5
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-api-core"
@@ -280,7 +280,7 @@
280280
# author, documentclass [howto, manual, or own class]).
281281
latex_documents = [
282282
(
283-
master_doc,
283+
root_doc,
284284
"google-api-core.tex",
285285
"google-api-core Documentation",
286286
author,
@@ -314,7 +314,7 @@
314314
# One entry per manual page. List of tuples
315315
# (source start file, name, description, authors, manual section).
316316
man_pages = [
317-
(master_doc, "google-api-core", "google-api-core Documentation", [author], 1,)
317+
(root_doc, "google-api-core", "google-api-core Documentation", [author], 1,)
318318
]
319319

320320
# If true, show URL addresses after external links.
@@ -328,7 +328,7 @@
328328
# dir menu entry, description, category)
329329
texinfo_documents = [
330330
(
331-
master_doc,
331+
root_doc,
332332
"google-api-core",
333333
"google-api-core Documentation",
334334
author,

google/api_core/exceptions.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ class Cancelled(ClientError):
293293
"""Exception mapping a :attr:`grpc.StatusCode.CANCELLED` error."""
294294

295295
# This maps to HTTP status code 499. See
296-
# https://github.com/googleapis/googleapis/blob/master/google/rpc\
297-
# /code.proto
296+
# https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
298297
code = 499
299298
grpc_status_code = grpc.StatusCode.CANCELLED if grpc is not None else None
300299

google/api_core/future/async_future.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ class AsyncFuture(base.Future):
4343
The :meth:`done` method should be implemented by subclasses. The polling
4444
behavior will repeatedly call ``done`` until it returns True.
4545
46-
.. note: Privacy here is intended to prevent the final class from
47-
overexposing, not to prevent subclasses from accessing methods.
46+
.. note::
47+
48+
Privacy here is intended to prevent the final class from
49+
overexposing, not to prevent subclasses from accessing methods.
4850
4951
Args:
5052
retry (google.api_core.retry.Retry): The retry configuration used

google/api_core/future/polling.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ class PollingFuture(base.Future):
4545
The :meth:`done` method should be implemented by subclasses. The polling
4646
behavior will repeatedly call ``done`` until it returns True.
4747
48-
.. note: Privacy here is intended to prevent the final class from
49-
overexposing, not to prevent subclasses from accessing methods.
48+
.. note::
49+
50+
Privacy here is intended to prevent the final class from
51+
overexposing, not to prevent subclasses from accessing methods.
5052
5153
Args:
5254
retry (google.api_core.retry.Retry): The retry configuration used

noxfile.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
DEFAULT_PYTHON_VERSION = "3.7"
3030
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
3131

32-
_MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6]
32+
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
33+
nox.options.sessions = [
34+
"unit",
35+
"unit_grpc_gcp",
36+
"cover",
37+
"pytype",
38+
"lint",
39+
"lint_setup_py",
40+
"blacken",
41+
"docs",
42+
]
3343

3444

3545
def _greater_or_equal_than_36(version_string):

owlbot.py

+45
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,49 @@
4444
""",
4545
)
4646

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

0 commit comments

Comments
 (0)