From 434c09fcb716d60b0854e260d5d1f396e3fbc775 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 25 Mar 2021 15:19:03 -0700 Subject: [PATCH 1/6] test: check minimum dependency versions (#122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update precommit hook pycqa/flake8 to v3.9.0 [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [pycqa/flake8](https://gitlab.com/pycqa/flake8) | repository | minor | `3.8.4` -> `3.9.0` | --- ### Release Notes
pycqa/flake8 ### [`v3.9.0`](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0) [Compare Source](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/synthtool). Source-Author: WhiteSource Renovate Source-Date: Tue Mar 23 17:38:03 2021 +0100 Source-Repo: googleapis/synthtool Source-Sha: f5c5904fb0c6aa3b3730eadf4e5a4485afc65726 Source-Link: https://github.com/googleapis/synthtool/commit/f5c5904fb0c6aa3b3730eadf4e5a4485afc65726 * test(python): use constraints files to check dependency lower bounds Use a constraints file when installing dependencies for system and unit tests nox sessions. https://pip.pypa.io/en/stable/user_guide/#constraints-files > Constraints files are requirements files that **only control which version of a requirement is installed, not whether it is installed or not**. Their syntax and contents is nearly identical to Requirements Files. There is one key difference: Including a package in a constraints file does not trigger installation of the package. ``` testing ├── constraints-3.10.txt ├── constraints-3.11.txt ├── constraints-3.6.txt ├── constraints-3.7.txt ├── constraints-3.8.txt └── constraints-3.9.txt ``` Going forward, one constraints file (currently 3.6) will be populated with every library requirement and extra listed in the `setup.py`. The constraints file will pin each requirement to the lower bound. This ensures that library maintainers will see test failures if they forget to update a lower bound on a dependency. See https://github.com/googleapis/python-bigquery/pull/263 for an example Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Tue Mar 23 10:52:02 2021 -0600 Source-Repo: googleapis/synthtool Source-Sha: 86ed43d4f56e6404d068e62e497029018879c771 Source-Link: https://github.com/googleapis/synthtool/commit/86ed43d4f56e6404d068e62e497029018879c771 --- .pre-commit-config.yaml | 2 +- noxfile.py | 22 ++++++++++++++-------- synth.metadata | 6 +++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9024b15..32302e48 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,6 @@ repos: hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.0 hooks: - id: flake8 diff --git a/noxfile.py b/noxfile.py index d6d974c5..ae8392be 100644 --- a/noxfile.py +++ b/noxfile.py @@ -18,6 +18,7 @@ from __future__ import absolute_import import os +import pathlib import shutil import nox @@ -30,6 +31,8 @@ SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + # 'docfx' is excluded since it only needs to run in 'docs-presubmit' nox.options.sessions = [ "unit", @@ -84,13 +87,15 @@ def lint_setup_py(session): def default(session): # Install all test dependencies, then install this package in-place. - session.install("asyncmock", "pytest-asyncio") - session.install( - "mock", "pytest", "pytest-cov", + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) + session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - session.install("-e", ".") + session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + + session.install("-e", ".", "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -117,6 +122,9 @@ def unit(session): @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" + ) system_test_path = os.path.join("tests", "system.py") system_test_folder_path = os.path.join("tests", "system") @@ -141,10 +149,8 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. - session.install( - "mock", "pytest", "google-cloud-testutils", - ) - session.install("-e", ".") + session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) + session.install("-e", ".", "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: diff --git a/synth.metadata b/synth.metadata index aa91c107..8ae9dfad 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-bigquery-datatransfer.git", - "sha": "2e73f935dc1a5d96728ab379780271a4b1b02989" + "sha": "ea6e2855a311d3c0b67483074d231e3dd5d40d4b" } }, { @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" + "sha": "86ed43d4f56e6404d068e62e497029018879c771" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" + "sha": "86ed43d4f56e6404d068e62e497029018879c771" } } ], From a0a0964d3d993216711906faec06a4620b1cd94a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 31 Mar 2021 07:14:54 -0700 Subject: [PATCH 2/6] build(python): update docfx job to use new plugin (#123) Source-Author: Dan Lee <71398022+dandhlee@users.noreply.github.com> Source-Date: Tue Mar 30 19:36:37 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 4501974ad08b5d693311457e2ea4ce845676e329 Source-Link: https://github.com/googleapis/synthtool/commit/4501974ad08b5d693311457e2ea4ce845676e329 --- noxfile.py | 4 +--- synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/noxfile.py b/noxfile.py index ae8392be..af50a606 100644 --- a/noxfile.py +++ b/noxfile.py @@ -211,9 +211,7 @@ def docfx(session): """Build the docfx yaml files for this library.""" session.install("-e", ".") - # sphinx-docfx-yaml supports up to sphinx version 1.5.5. - # https://github.com/docascode/sphinx-docfx-yaml/issues/97 - session.install("sphinx==1.5.5", "alabaster", "recommonmark", "sphinx-docfx-yaml") + session.install("sphinx", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( diff --git a/synth.metadata b/synth.metadata index 8ae9dfad..56d0969b 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-bigquery-datatransfer.git", - "sha": "ea6e2855a311d3c0b67483074d231e3dd5d40d4b" + "sha": "434c09fcb716d60b0854e260d5d1f396e3fbc775" } }, { @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "86ed43d4f56e6404d068e62e497029018879c771" + "sha": "4501974ad08b5d693311457e2ea4ce845676e329" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "86ed43d4f56e6404d068e62e497029018879c771" + "sha": "4501974ad08b5d693311457e2ea4ce845676e329" } } ], From 5e359a0fa72f5d53bb4de6e4d7833000a4be0239 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Wed, 7 Apr 2021 08:36:34 -0700 Subject: [PATCH 3/6] chore: migrate to owl-bot (#124) * chore: migrate to owl bot * chore: copy files from googleapis-gen ad5147b2c3694044935301527f68b951c2e1f419 * chore: run the post processor * fix: proper quotes owlbot.py Co-authored-by: Anthonios Partheniou Co-authored-by: Anthonios Partheniou --- .github/.OwlBot.lock.yaml | 4 ++ .github/.OwlBot.yaml | 26 +++++++ synth.py => owlbot.py | 39 ++++------ synth.metadata | 145 -------------------------------------- 4 files changed, 45 insertions(+), 169 deletions(-) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml rename synth.py => owlbot.py (66%) delete mode 100644 synth.metadata diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..9bdafee7 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,4 @@ +docker: + digest: sha256:612842ba5ccf62b4e3983fe6dc453cf66883c74bc168aa62da7acaed1e2fdc93 + image: gcr.io/repo-automation-bots/owlbot-python:latest + diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..99839dbe --- /dev/null +++ b/.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/cloud/bigquery/datatransfer/(v.*)/.*-py/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: ad5147b2c3694044935301527f68b951c2e1f419 + diff --git a/synth.py b/owlbot.py similarity index 66% rename from synth.py rename to owlbot.py index f5e03032..87e7c517 100644 --- a/synth.py +++ b/owlbot.py @@ -20,25 +20,29 @@ from synthtool.languages import python -gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() -versions = ["v1"] # ---------------------------------------------------------------------------- # Generate bigquery_datatransfer GAPIC layer # ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library( - service="bigquery_datatransfer", - version=version, - bazel_target=( - f"//google/cloud/bigquery/datatransfer/{version}:" - "bigquery-datatransfer-v1-py" - ), - include_protos=True, +for library in s.get_staging_dirs("v1"): + # Fix missing async client in datatransfer_v1 + # https://github.com/googleapis/gapic-generator-python/issues/815 + s.replace( + library / "google/cloud/bigquery_datatransfer_v1/__init__.py", + r"from \.services\.data_transfer_service import DataTransferServiceClient", + "\\g<0>\nfrom .services.data_transfer_service import DataTransferServiceAsyncClient", ) + s.replace( + library / "google/cloud/bigquery_datatransfer_v1/__init__.py", + r"'DataTransferServiceClient',", + '\\g<0>\n "DataTransferServiceAsyncClient"', + ) + s.move(library, excludes=["*.tar.gz", "docs/index.rst", "README.rst", "setup.py"]) +s.remove_staging_dirs() + # ---------------------------------------------------------------------------- # Add templated files @@ -52,17 +56,4 @@ python.py_samples(skip_readmes=True) -# Fix missing async client in datatransfer_v1 -# https://github.com/googleapis/gapic-generator-python/issues/815 -s.replace( - "google/cloud/bigquery_datatransfer_v1/__init__.py", - r"from \.services\.data_transfer_service import DataTransferServiceClient", - "\\g<0>\nfrom .services.data_transfer_service import DataTransferServiceAsyncClient", -) -s.replace( - "google/cloud/bigquery_datatransfer_v1/__init__.py", - r"'DataTransferServiceClient',", - '\\g<0>\n "DataTransferServiceAsyncClient"', -) - s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/synth.metadata b/synth.metadata deleted file mode 100644 index 56d0969b..00000000 --- a/synth.metadata +++ /dev/null @@ -1,145 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/python-bigquery-datatransfer.git", - "sha": "434c09fcb716d60b0854e260d5d1f396e3fbc775" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c13fb8cb376bb666de80ed33e11550955b4357af", - "internalRef": "363304304" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "4501974ad08b5d693311457e2ea4ce845676e329" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "4501974ad08b5d693311457e2ea4ce845676e329" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "bigquery_datatransfer", - "apiVersion": "v1", - "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/bigquery_datatransfer_v1/data_transfer_service.rst", - "docs/bigquery_datatransfer_v1/services.rst", - "docs/bigquery_datatransfer_v1/types.rst", - "docs/conf.py", - "docs/multiprocessing.rst", - "google/cloud/bigquery_datatransfer/__init__.py", - "google/cloud/bigquery_datatransfer/py.typed", - "google/cloud/bigquery_datatransfer_v1/__init__.py", - "google/cloud/bigquery_datatransfer_v1/proto/datatransfer.proto", - "google/cloud/bigquery_datatransfer_v1/proto/transfer.proto", - "google/cloud/bigquery_datatransfer_v1/py.typed", - "google/cloud/bigquery_datatransfer_v1/services/__init__.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/__init__.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/pagers.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/__init__.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/base.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py", - "google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py", - "google/cloud/bigquery_datatransfer_v1/types/__init__.py", - "google/cloud/bigquery_datatransfer_v1/types/datatransfer.py", - "google/cloud/bigquery_datatransfer_v1/types/transfer.py", - "mypy.ini", - "noxfile.py", - "renovate.json", - "samples/AUTHORING_GUIDE.md", - "samples/CONTRIBUTING.md", - "samples/snippets/noxfile.py", - "scripts/decrypt-secrets.sh", - "scripts/fixup_bigquery_datatransfer_v1_keywords.py", - "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/bigquery_datatransfer_v1/__init__.py", - "tests/unit/gapic/bigquery_datatransfer_v1/test_data_transfer_service.py" - ] -} \ No newline at end of file From cf5b1a14410226d97eba13cb2c5daa0cde53d394 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 7 Apr 2021 17:43:28 +0200 Subject: [PATCH 4/6] chore(deps): update dependency google-cloud-bigquery-datatransfer to v3.1.0 (#120) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 93a5405d..e7fe546c 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-bigquery-datatransfer==3.0.1 +google-cloud-bigquery-datatransfer==3.1.0 From 91910f1ea01c5324fa63a7d85a034d08aeaae3f9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 7 Apr 2021 08:46:05 -0700 Subject: [PATCH 5/6] fix: use correct retry deadline (#121) fix: require proto-plus>=1.15.0 --- UPGRADING.md | 4 +- .../data_transfer_service/async_client.py | 10 ++ .../data_transfer_service/transports/base.py | 28 +++-- .../data_transfer_service/transports/grpc.py | 101 ++++++---------- .../transports/grpc_asyncio.py | 109 +++++++----------- .../types/transfer.py | 1 + setup.py | 5 +- testing/constraints-3.6.txt | 4 +- 8 files changed, 114 insertions(+), 148 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 0bac7ed1..b9e04ba1 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,4 +1,4 @@ -