Skip to content

Commit

Permalink
chore: migrate to owl bot (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Apr 22, 2021
1 parent fdeca70 commit 3cb6c05
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 206 deletions.
4 changes: 4 additions & 0 deletions packages/google-cloud-retail/.github/.OwlBot.lock.yaml
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

30 changes: 30 additions & 0 deletions packages/google-cloud-retail/.github/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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/v2alpha
- /owl-bot-staging/v2beta

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

begin-after-commit-hash: f0b479aa18206c41b6abae5660496cc696d843b2

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-retail/.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-retail
python3 setup.py sdist bdist_wheel
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*
14 changes: 2 additions & 12 deletions packages/google-cloud-retail/.kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ env_vars: {
value: "github/python-retail/.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-retail/.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
13 changes: 12 additions & 1 deletion packages/google-cloud-retail/docs/_static/custom.css
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-retail/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-retail documentation build configuration file
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
__all__ = (
"BigQuerySource",
"Catalog",
"CatalogServiceClient",
"CollectUserEventRequest",
"CreateProductRequest",
"CustomAttribute",
Expand Down Expand Up @@ -102,8 +103,7 @@
"UserEventImportSummary",
"UserEventInlineSource",
"UserEventInputConfig",
"UserEventServiceClient",
"UserInfo",
"WriteUserEventRequest",
"CatalogServiceClient",
"UserEventServiceClient",
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,15 @@
import synthtool.gcp as gcp
from synthtool.languages import python

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

# ----------------------------------------------------------------------------
# Generate retail GAPIC layer
# ----------------------------------------------------------------------------
versions = ["v2"]
for version in versions:
library = gapic.py_library(
service="retail",
version=version,
bazel_target=f"//google/cloud/retail/{version}:retail-{version}-py",
)
default_version = "v2"

for library in s.get_staging_dirs(default_version):
s.move(library, excludes=["setup.py", "README.rst", "docs/index.rst"])

s.remove_staging_dirs()

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
Expand All @@ -45,4 +38,4 @@
templated_files, excludes=[".coveragerc"] # the microgenerator has a good coveragerc file
)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
s.shell.run(["nox", "-s", "blacken"], hide_output=False)
5 changes: 4 additions & 1 deletion packages/google-cloud-retail/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"]
}
}
175 changes: 0 additions & 175 deletions packages/google-cloud-retail/synth.metadata

This file was deleted.

0 comments on commit 3cb6c05

Please sign in to comment.