Skip to content

Commit

Permalink
chore: migrate to owl bot (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea authored Apr 21, 2021
1 parent dc6726f commit c01ff67
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 81 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker:
digest: sha256:cfc0e802701262c211703c468874d767f65dabe6a1a71d0e07bfc8a3d5175f32
image: gcr.io/repo-automation-bots/owlbot-python:latest

29 changes: 29 additions & 0 deletions packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

docker:
image: gcr.io/repo-automation-bots/owlbot-python:latest

deep-remove-regex:
- /owl-bot-staging

deep-preserve-regex:
- /owl-bot-staging/v1beta1

deep-copy-regex:
- source: /google/cloud/bigquery/reservation/(v.*)/.*-py/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: 6a5da3f1274b088752f074da5bc9e30bd1beb27e

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-bigquery-reservation/.kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools
export PYTHONUNBUFFERED=1

# Move into the package, build the distribution and upload.
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password")
TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token")
cd github/python-bigquery-reservation
python3 setup.py sdist bdist_wheel
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ env_vars: {
value: "github/python-bigquery-reservation/.kokoro/release.sh"
}

# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Tokens needed to report release status back to GitHub
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token"
}
14 changes: 14 additions & 0 deletions packages/google-cloud-bigquery-reservation/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}

/* Insert space between methods for readability */
dl.method {
padding-top: 10px;
padding-bottom: 10px
}

/* Insert empty space between classes */
dl.class {
padding-bottom: 50px
}
13 changes: 13 additions & 0 deletions packages/google-cloud-bigquery-reservation/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# google-cloud-bigquery-reservation documentation build configuration file
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,22 @@

REPO_ROOT = pathlib.Path(__file__).parent.absolute()

gapic = gcp.GAPICBazel()
common = gcp.CommonTemplates()

# ----------------------------------------------------------------------------
# Generate access approval GAPIC layer
# ----------------------------------------------------------------------------
library = gapic.py_library(
service="bigquery/reservation",
version="v1",
bazel_target=f"//google/cloud/bigquery/reservation/v1:bigquery-reservation-v1-py",
)
default_version = "v1"

s.move(library, excludes=["nox.py", "setup.py", "README.rst", "docs/index.rst"])
for library in s.get_staging_dirs(default_version):
s.replace(
[
library / "google/cloud/bigquery_reservation_v1/services/reservation_service/client.py",
library / "google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py",
],
"assignee=organizations/456``",
"assignee=organizations/456``\n",
)
s.move(library, excludes=["nox.py", "setup.py", "README.rst", "docs/index.rst"])

s.replace(
[
"google/cloud/bigquery_reservation_v1/services/reservation_service/client.py",
"google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py",
],
"assignee=organizations/456``",
"assignee=organizations/456``\n",
)
s.remove_staging_dirs()

# ----------------------------------------------------------------------------
# Add templated files
Expand Down
5 changes: 4 additions & 1 deletion packages/google-cloud-bigquery-reservation/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"extends": [
"config:base", ":preserveSemverRanges"
],
"ignorePaths": [".pre-commit-config.yaml"]
"ignorePaths": [".pre-commit-config.yaml"],
"pip_requirements": {
"fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,16 @@ def _session_tests(
) -> None:
"""Runs py.test for a particular project."""
if os.path.exists("requirements.txt"):
session.install("-r", "requirements.txt")
if os.path.exists("constraints.txt"):
session.install("-r", "requirements.txt", "-c", "constraints.txt")
else:
session.install("-r", "requirements.txt")

if os.path.exists("requirements-test.txt"):
session.install("-r", "requirements-test.txt")
if os.path.exists("constraints-test.txt"):
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
else:
session.install("-r", "requirements-test.txt")

if INSTALL_LIBRARY_FROM_SOURCE:
session.install("-e", _get_repo_root())
Expand Down
44 changes: 0 additions & 44 deletions packages/google-cloud-bigquery-reservation/synth.metadata

This file was deleted.

0 comments on commit c01ff67

Please sign in to comment.