diff --git a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.lock.yaml b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.lock.yaml new file mode 100644 index 000000000000..14240bccaf3a --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.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-cloud-bigquery-reservation/.github/.OwlBot.yaml b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml new file mode 100644 index 000000000000..356fc8c0ef79 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml @@ -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 + diff --git a/packages/google-cloud-bigquery-reservation/.github/header-checker-lint.yml b/packages/google-cloud-bigquery-reservation/.github/header-checker-lint.yml index fc281c05bd55..6fe78aa7987a 100644 --- a/packages/google-cloud-bigquery-reservation/.github/header-checker-lint.yml +++ b/packages/google-cloud-bigquery-reservation/.github/header-checker-lint.yml @@ -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", diff --git a/packages/google-cloud-bigquery-reservation/.kokoro/release.sh b/packages/google-cloud-bigquery-reservation/.kokoro/release.sh index ecd73d18148a..fbbde4a37968 100755 --- a/packages/google-cloud-bigquery-reservation/.kokoro/release.sh +++ b/packages/google-cloud-bigquery-reservation/.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-bigquery-reservation 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-cloud-bigquery-reservation/.kokoro/release/common.cfg b/packages/google-cloud-bigquery-reservation/.kokoro/release/common.cfg index 1af813572215..0354b78c5b1a 100644 --- a/packages/google-cloud-bigquery-reservation/.kokoro/release/common.cfg +++ b/packages/google-cloud-bigquery-reservation/.kokoro/release/common.cfg @@ -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" -} \ 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-cloud-bigquery-reservation/.pre-commit-config.yaml b/packages/google-cloud-bigquery-reservation/.pre-commit-config.yaml index 32302e4883a1..8912e9b5d7d7 100644 --- a/packages/google-cloud-bigquery-reservation/.pre-commit-config.yaml +++ b/packages/google-cloud-bigquery-reservation/.pre-commit-config.yaml @@ -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: diff --git a/packages/google-cloud-bigquery-reservation/docs/_static/custom.css b/packages/google-cloud-bigquery-reservation/docs/_static/custom.css index bcd37bbd3c4a..b0a295464b23 100644 --- a/packages/google-cloud-bigquery-reservation/docs/_static/custom.css +++ b/packages/google-cloud-bigquery-reservation/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-cloud-bigquery-reservation/docs/conf.py b/packages/google-cloud-bigquery-reservation/docs/conf.py index 85347c25816f..caaa940ffcce 100644 --- a/packages/google-cloud-bigquery-reservation/docs/conf.py +++ b/packages/google-cloud-bigquery-reservation/docs/conf.py @@ -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 # diff --git a/packages/google-cloud-bigquery-reservation/synth.py b/packages/google-cloud-bigquery-reservation/owlbot.py similarity index 70% rename from packages/google-cloud-bigquery-reservation/synth.py rename to packages/google-cloud-bigquery-reservation/owlbot.py index 65cbb0a80752..bfa4ef31d3fd 100644 --- a/packages/google-cloud-bigquery-reservation/synth.py +++ b/packages/google-cloud-bigquery-reservation/owlbot.py @@ -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 diff --git a/packages/google-cloud-bigquery-reservation/renovate.json b/packages/google-cloud-bigquery-reservation/renovate.json index f08bc22c9a55..c04895563e69 100644 --- a/packages/google-cloud-bigquery-reservation/renovate.json +++ b/packages/google-cloud-bigquery-reservation/renovate.json @@ -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"] + } } diff --git a/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py b/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py index f2320ea0001c..be1a3f251496 100644 --- a/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py +++ b/packages/google-cloud-bigquery-reservation/samples/snippets/noxfile.py @@ -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()) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata deleted file mode 100644 index 79e336443a8c..000000000000 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ /dev/null @@ -1,44 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "git@github.com:googleapis/python-bigquery-reservation.git", - "sha": "4b3594f05cc5bd11e0a44a5a5f96f6b0a24ccfca" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "56fc6d43fed71188d7e18f3ca003544646c4ab35", - "internalRef": "366346972" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ff39353f34a36e7643b86e97724e4027ab466dc6" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ff39353f34a36e7643b86e97724e4027ab466dc6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "bigquery/reservation", - "apiVersion": "v1", - "language": "python", - "generator": "bazel" - } - } - ] -} \ No newline at end of file