Skip to content

Commit c7aa714

Browse files
chore: migrate default branch from master to main (#153)
* chore: migrate default branch from master to main * Blacken owlbot.py * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 02d02c9 commit c7aa714

File tree

6 files changed

+68
-17
lines changed

6 files changed

+68
-17
lines changed

packages/google-cloud-bigquery-reservation/.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

packages/google-cloud-bigquery-reservation/.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

packages/google-cloud-bigquery-reservation/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/python-bigquery-reservation
5151
# repository into your local repository.
5252
$ git remote add upstream git@github.com:googleapis/python-bigquery-reservation.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-reservation``. 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-reservation/blob/master/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/python-bigquery-reservation/blob/main/CONTRIBUTING.rst``)
213213
may cause problems creating links or rendering the description.
214214

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

239239

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

packages/google-cloud-bigquery-reservation/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-cloud-bigquery-reservation"
@@ -280,7 +280,7 @@
280280
# author, documentclass [howto, manual, or own class]).
281281
latex_documents = [
282282
(
283-
master_doc,
283+
root_doc,
284284
"google-cloud-bigquery-reservation.tex",
285285
"google-cloud-bigquery-reservation 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-cloud-bigquery-reservation",
320320
"google-cloud-bigquery-reservation 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-cloud-bigquery-reservation",
339339
"google-cloud-bigquery-reservation Documentation",
340340
author,

packages/google-cloud-bigquery-reservation/owlbot.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
for library in s.get_staging_dirs(default_version):
3030
s.replace(
3131
[
32-
library / "google/cloud/bigquery_reservation_v1/services/reservation_service/client.py",
33-
library / "google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py",
32+
library
33+
/ "google/cloud/bigquery_reservation_v1/services/reservation_service/client.py",
34+
library
35+
/ "google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py",
3436
],
3537
"assignee=organizations/456``",
3638
"assignee=organizations/456``\n",
@@ -48,6 +50,51 @@
4850
excludes=[".coveragerc"], # the microgenerator has a good coveragerc file
4951
)
5052

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

packages/google-cloud-bigquery-reservation/samples/snippets/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,17 @@ def location_path(project_id: str, location: str) -> str:
4444

4545

4646
@pytest.fixture(scope="session", autouse=True)
47-
def capacity_commitment(location_path: str, reservation_client: reservation_service.ReservationServiceClient) -> reservation_types.CapacityCommitment:
47+
def capacity_commitment(
48+
location_path: str, reservation_client: reservation_service.ReservationServiceClient
49+
) -> reservation_types.CapacityCommitment:
4850
# TODO(b/196082966): If custom names or creation date property are added,
4951
# do pre-test cleanup of past commitments.
5052
commitment = reservation_types.CapacityCommitment()
5153
commitment.slot_count = 100
5254
commitment.plan = reservation_types.CapacityCommitment.CommitmentPlan.FLEX
53-
commitment = reservation_client.create_capacity_commitment(parent=location_path, capacity_commitment=commitment)
55+
commitment = reservation_client.create_capacity_commitment(
56+
parent=location_path, capacity_commitment=commitment
57+
)
5458
yield commitment
5559
# Commitments can only be removed after 1 minute.
5660
now = datetime.datetime.now(datetime.timezone.utc)

0 commit comments

Comments
 (0)