From 2bb034cd1708fc0152aa1e26f0168f78532f97c8 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 23 Apr 2021 11:18:03 -0400 Subject: [PATCH] chore: migrate to owl bot (#33) --- .../.github/.OwlBot.lock.yaml | 4 + .../.github/.OwlBot.yaml | 26 ++++ .../google-area120-tables/.kokoro/release.sh | 4 +- .../.kokoro/release/common.cfg | 14 +- .../docs/_static/custom.css | 13 +- .../{synth.py => owlbot.py} | 31 ++-- packages/google-area120-tables/synth.metadata | 138 ------------------ 7 files changed, 59 insertions(+), 171 deletions(-) create mode 100644 packages/google-area120-tables/.github/.OwlBot.lock.yaml create mode 100644 packages/google-area120-tables/.github/.OwlBot.yaml rename packages/google-area120-tables/{synth.py => owlbot.py} (70%) delete mode 100644 packages/google-area120-tables/synth.metadata diff --git a/packages/google-area120-tables/.github/.OwlBot.lock.yaml b/packages/google-area120-tables/.github/.OwlBot.lock.yaml new file mode 100644 index 000000000000..29084e8a33af --- /dev/null +++ b/packages/google-area120-tables/.github/.OwlBot.lock.yaml @@ -0,0 +1,4 @@ +docker: + digest: sha256:cfc0e802701262c211703c468874d767f65dabe6a1a71d0e07bfc8a3d5175f32 + image: gcr.io/repo-automation-bots/owlbot-python:latest + diff --git a/packages/google-area120-tables/.github/.OwlBot.yaml b/packages/google-area120-tables/.github/.OwlBot.yaml new file mode 100644 index 000000000000..cff3b3f08195 --- /dev/null +++ b/packages/google-area120-tables/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# 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-copy-regex: + - source: /google/area120/tables/(v.*)/.*-py/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: ee56c3493ec6aeb237ff515ecea949710944a20f + diff --git a/packages/google-area120-tables/.kokoro/release.sh b/packages/google-area120-tables/.kokoro/release.sh index a6a16a4eda7d..5bc1113cfdaa 100755 --- a/packages/google-area120-tables/.kokoro/release.sh +++ b/packages/google-area120-tables/.kokoro/release.sh @@ -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-area120-tables python3 setup.py sdist bdist_wheel -twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/packages/google-area120-tables/.kokoro/release/common.cfg b/packages/google-area120-tables/.kokoro/release/common.cfg index 8a5fefab4a6f..5e16dabaabd2 100644 --- a/packages/google-area120-tables/.kokoro/release/common.cfg +++ b/packages/google-area120-tables/.kokoro/release/common.cfg @@ -23,18 +23,8 @@ env_vars: { value: "github/python-area120-tables/.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" -} \ No newline at end of file + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" +} diff --git a/packages/google-area120-tables/docs/_static/custom.css b/packages/google-area120-tables/docs/_static/custom.css index bcd37bbd3c4a..b0a295464b23 100644 --- a/packages/google-area120-tables/docs/_static/custom.css +++ b/packages/google-area120-tables/docs/_static/custom.css @@ -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 +} diff --git a/packages/google-area120-tables/synth.py b/packages/google-area120-tables/owlbot.py similarity index 70% rename from packages/google-area120-tables/synth.py rename to packages/google-area120-tables/owlbot.py index c9ae019fa81b..eca0795734a0 100644 --- a/packages/google-area120-tables/synth.py +++ b/packages/google-area120-tables/owlbot.py @@ -19,27 +19,22 @@ import synthtool.gcp as gcp from synthtool.languages import python -gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() -# ---------------------------------------------------------------------------- -# Generate area120 tables GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - service="tables", - version="v1alpha1", - bazel_target="//google/area120/tables/v1alpha1:area120-tables-v1alpha1-py", -) +default_version = "v1alpha1" -s.move( - library, - excludes=[ - "setup.py", - "README.rst", - "docs/index.rst", - "scripts/fixup_tables_v1alpha1_keywords.py", - ], -) +for library in s.get_staging_dirs(default_version): + s.move( + library, + excludes=[ + "setup.py", + "README.rst", + "docs/index.rst", + "scripts/fixup_tables_v1alpha1_keywords.py", + ], + ) + +s.remove_staging_dirs() # ---------------------------------------------------------------------------- # Add templated files diff --git a/packages/google-area120-tables/synth.metadata b/packages/google-area120-tables/synth.metadata deleted file mode 100644 index 147527892297..000000000000 --- a/packages/google-area120-tables/synth.metadata +++ /dev/null @@ -1,138 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/python-area120-tables.git", - "sha": "6e06d330c920c08e4dd7325de23e2c254840a998" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8ff7d794576311d3d68d4df2ac6da93bbfcd7476", - "internalRef": "366472163" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0a071b3460344886297a304253bf924aa68ddb7e" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0a071b3460344886297a304253bf924aa68ddb7e" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "tables", - "apiVersion": "v1alpha1", - "language": "python", - "generator": "bazel" - } - } - ], - "generatedFiles": [ - ".coveragerc", - ".flake8", - ".github/CONTRIBUTING.md", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/header-checker-lint.yml", - ".github/release-please.yml", - ".github/snippet-bot.yml", - ".gitignore", - ".kokoro/build.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/continuous.cfg", - ".kokoro/docker/docs/Dockerfile", - ".kokoro/docker/docs/fetch_gpg_keys.sh", - ".kokoro/docs/common.cfg", - ".kokoro/docs/docs-presubmit.cfg", - ".kokoro/docs/docs.cfg", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/presubmit.cfg", - ".kokoro/publish-docs.sh", - ".kokoro/release.sh", - ".kokoro/release/common.cfg", - ".kokoro/release/release.cfg", - ".kokoro/samples/lint/common.cfg", - ".kokoro/samples/lint/continuous.cfg", - ".kokoro/samples/lint/periodic.cfg", - ".kokoro/samples/lint/presubmit.cfg", - ".kokoro/samples/python3.6/common.cfg", - ".kokoro/samples/python3.6/continuous.cfg", - ".kokoro/samples/python3.6/periodic-head.cfg", - ".kokoro/samples/python3.6/periodic.cfg", - ".kokoro/samples/python3.6/presubmit.cfg", - ".kokoro/samples/python3.7/common.cfg", - ".kokoro/samples/python3.7/continuous.cfg", - ".kokoro/samples/python3.7/periodic-head.cfg", - ".kokoro/samples/python3.7/periodic.cfg", - ".kokoro/samples/python3.7/presubmit.cfg", - ".kokoro/samples/python3.8/common.cfg", - ".kokoro/samples/python3.8/continuous.cfg", - ".kokoro/samples/python3.8/periodic-head.cfg", - ".kokoro/samples/python3.8/periodic.cfg", - ".kokoro/samples/python3.8/presubmit.cfg", - ".kokoro/test-samples-against-head.sh", - ".kokoro/test-samples-impl.sh", - ".kokoro/test-samples.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".pre-commit-config.yaml", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.rst", - "LICENSE", - "MANIFEST.in", - "docs/_static/custom.css", - "docs/_templates/layout.html", - "docs/conf.py", - "docs/multiprocessing.rst", - "docs/tables_v1alpha1/services.rst", - "docs/tables_v1alpha1/tables_service.rst", - "docs/tables_v1alpha1/types.rst", - "google/area120/tables/__init__.py", - "google/area120/tables/py.typed", - "google/area120/tables_v1alpha1/__init__.py", - "google/area120/tables_v1alpha1/py.typed", - "google/area120/tables_v1alpha1/services/__init__.py", - "google/area120/tables_v1alpha1/services/tables_service/__init__.py", - "google/area120/tables_v1alpha1/services/tables_service/async_client.py", - "google/area120/tables_v1alpha1/services/tables_service/client.py", - "google/area120/tables_v1alpha1/services/tables_service/pagers.py", - "google/area120/tables_v1alpha1/services/tables_service/transports/__init__.py", - "google/area120/tables_v1alpha1/services/tables_service/transports/base.py", - "google/area120/tables_v1alpha1/services/tables_service/transports/grpc.py", - "google/area120/tables_v1alpha1/services/tables_service/transports/grpc_asyncio.py", - "google/area120/tables_v1alpha1/types/__init__.py", - "google/area120/tables_v1alpha1/types/tables.py", - "mypy.ini", - "noxfile.py", - "renovate.json", - "scripts/decrypt-secrets.sh", - "scripts/readme-gen/readme_gen.py", - "scripts/readme-gen/templates/README.tmpl.rst", - "scripts/readme-gen/templates/auth.tmpl.rst", - "scripts/readme-gen/templates/auth_api_key.tmpl.rst", - "scripts/readme-gen/templates/install_deps.tmpl.rst", - "scripts/readme-gen/templates/install_portaudio.tmpl.rst", - "setup.cfg", - "testing/.gitignore", - "tests/unit/gapic/tables_v1alpha1/__init__.py", - "tests/unit/gapic/tables_v1alpha1/test_tables_service.py" - ] -} \ No newline at end of file