From c8901c7a9c49157d04dfd71dba024dce68de9344 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Jul 2021 19:42:16 +0200 Subject: [PATCH 01/21] chore(deps): update dependency google-cloud-videointelligence to v2.3.2 (#195) --- samples/analyze/requirements.txt | 2 +- samples/labels/requirements.txt | 2 +- samples/quickstart/requirements.txt | 2 +- samples/shotchange/requirements.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/analyze/requirements.txt b/samples/analyze/requirements.txt index f780ac59..28ae6072 100644 --- a/samples/analyze/requirements.txt +++ b/samples/analyze/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-videointelligence==2.3.1 +google-cloud-videointelligence==2.3.2 google-cloud-storage==1.41.1 diff --git a/samples/labels/requirements.txt b/samples/labels/requirements.txt index 57c5e929..f8580b5f 100644 --- a/samples/labels/requirements.txt +++ b/samples/labels/requirements.txt @@ -1 +1 @@ -google-cloud-videointelligence==2.3.1 +google-cloud-videointelligence==2.3.2 diff --git a/samples/quickstart/requirements.txt b/samples/quickstart/requirements.txt index 57c5e929..f8580b5f 100644 --- a/samples/quickstart/requirements.txt +++ b/samples/quickstart/requirements.txt @@ -1 +1 @@ -google-cloud-videointelligence==2.3.1 +google-cloud-videointelligence==2.3.2 diff --git a/samples/shotchange/requirements.txt b/samples/shotchange/requirements.txt index 57c5e929..f8580b5f 100644 --- a/samples/shotchange/requirements.txt +++ b/samples/shotchange/requirements.txt @@ -1 +1 @@ -google-cloud-videointelligence==2.3.1 +google-cloud-videointelligence==2.3.2 From 5bef29a95853c5a9f1a3047e384cd1d5331cf11c Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Mon, 2 Aug 2021 19:20:34 -0600 Subject: [PATCH 02/21] chore: require CODEOWNER review and up to date branches (#197) These two lines bring the rules on this repo in line with the defaults: https://github.com/googleapis/repo-automation-bots/blob/63c858e539e1f4d9bb8ea66e12f9c0a0de5fef55/packages/sync-repo-settings/src/required-checks.json#L40-L50 --- .github/sync-repo-settings.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index af599353..0ddb512d 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -4,6 +4,8 @@ branchProtectionRules: # Identifies the protection rule pattern. Name of the branch to be protected. # Defaults to `master` - pattern: master + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: true requiredStatusCheckContexts: - 'Kokoro' - 'cla/google' From 048e1d7281ff5a3c51b814ec2819e0ba02214e1a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 12 Aug 2021 16:57:27 +0200 Subject: [PATCH 03/21] chore(deps): update dependency google-cloud-storage to v1.42.0 (#200) --- samples/analyze/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/analyze/requirements.txt b/samples/analyze/requirements.txt index 28ae6072..4a296d5b 100644 --- a/samples/analyze/requirements.txt +++ b/samples/analyze/requirements.txt @@ -1,2 +1,2 @@ google-cloud-videointelligence==2.3.2 -google-cloud-storage==1.41.1 +google-cloud-storage==1.42.0 From 64b50f388e2cb4c6b5a67b18034dab3d245cce9b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 12 Aug 2021 16:16:28 +0000 Subject: [PATCH 04/21] chore: fix INSTALL_LIBRARY_FROM_SOURCE in noxfile.py (#198) Source-Link: https://github.com/googleapis/synthtool/commit/6252f2cd074c38f37b44abe5e96d128733eb1b61 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:50e35228649c47b6ca82aa0be3ff9eb2afce51c82b66c4a03fe4afeb5ff6c0fc --- .github/.OwlBot.lock.yaml | 2 +- samples/analyze/noxfile.py | 2 +- samples/labels/noxfile.py | 2 +- samples/quickstart/noxfile.py | 2 +- samples/shotchange/noxfile.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7e..649877dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + digest: sha256:50e35228649c47b6ca82aa0be3ff9eb2afce51c82b66c4a03fe4afeb5ff6c0fc diff --git a/samples/analyze/noxfile.py b/samples/analyze/noxfile.py index 6a8ccdae..125bb619 100644 --- a/samples/analyze/noxfile.py +++ b/samples/analyze/noxfile.py @@ -96,7 +96,7 @@ def get_pytest_env_vars() -> Dict[str, str]: TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") # # Style Checks # diff --git a/samples/labels/noxfile.py b/samples/labels/noxfile.py index 6a8ccdae..125bb619 100644 --- a/samples/labels/noxfile.py +++ b/samples/labels/noxfile.py @@ -96,7 +96,7 @@ def get_pytest_env_vars() -> Dict[str, str]: TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") # # Style Checks # diff --git a/samples/quickstart/noxfile.py b/samples/quickstart/noxfile.py index 6a8ccdae..125bb619 100644 --- a/samples/quickstart/noxfile.py +++ b/samples/quickstart/noxfile.py @@ -96,7 +96,7 @@ def get_pytest_env_vars() -> Dict[str, str]: TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") # # Style Checks # diff --git a/samples/shotchange/noxfile.py b/samples/shotchange/noxfile.py index 6a8ccdae..125bb619 100644 --- a/samples/shotchange/noxfile.py +++ b/samples/shotchange/noxfile.py @@ -96,7 +96,7 @@ def get_pytest_env_vars() -> Dict[str, str]: TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") # # Style Checks # From 82d08b9968bbd28c4b1f9ece996fdc17013ae6e5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 12 Aug 2021 17:30:09 +0000 Subject: [PATCH 05/21] chore(python): avoid `.nox` directories when building docs (#199) Source-Link: https://github.com/googleapis/synthtool/commit/7e1f6da50524b5d98eb67adbf6dd0805df54233d Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 649877dc..b771c37c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:50e35228649c47b6ca82aa0be3ff9eb2afce51c82b66c4a03fe4afeb5ff6c0fc + digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d diff --git a/docs/conf.py b/docs/conf.py index b1f1cf22..a1f45891 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", From fb4994dca8f5d102d13a3a2c2a14f6ab41f14b1f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:56:48 -0400 Subject: [PATCH 06/21] chore: drop mention of Python 2.7 from templates (#202) Source-Link: https://github.com/googleapis/synthtool/commit/facee4cc1ea096cd8bcc008bb85929daa7c414c0 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- noxfile.py | 12 +++++++++--- samples/analyze/noxfile.py | 6 +++--- samples/labels/noxfile.py | 6 +++--- samples/quickstart/noxfile.py | 6 +++--- samples/shotchange/noxfile.py | 6 +++--- scripts/readme-gen/templates/install_deps.tmpl.rst | 2 +- 7 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b771c37c..a9fcd07c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d + digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 diff --git a/noxfile.py b/noxfile.py index 0a9b7b71..6d91ce16 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/samples/analyze/noxfile.py b/samples/analyze/noxfile.py index 125bb619..e73436a1 100644 --- a/samples/analyze/noxfile.py +++ b/samples/analyze/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/samples/labels/noxfile.py b/samples/labels/noxfile.py index 125bb619..e73436a1 100644 --- a/samples/labels/noxfile.py +++ b/samples/labels/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/samples/quickstart/noxfile.py b/samples/quickstart/noxfile.py index 125bb619..e73436a1 100644 --- a/samples/quickstart/noxfile.py +++ b/samples/quickstart/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/samples/shotchange/noxfile.py b/samples/shotchange/noxfile.py index 125bb619..e73436a1 100644 --- a/samples/shotchange/noxfile.py +++ b/samples/shotchange/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406dba..275d6498 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash From 66d456da5741f2ce5a89f38230aa01ef7a4a05cd Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Mon, 30 Aug 2021 16:41:33 +0200 Subject: [PATCH 07/21] chore: migrate default branch from master to main (#206) --- .github/sync-repo-settings.yaml | 8 +++--- .kokoro/build.sh | 2 +- .kokoro/test-samples-impl.sh | 2 +- CONTRIBUTING.rst | 12 ++++----- docs/conf.py | 10 +++---- owlbot.py | 47 +++++++++++++++++++++++++++++++++ 6 files changed, 64 insertions(+), 17 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 0ddb512d..3e98ae70 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,9 +1,9 @@ -# https://github.com/googleapis/repo-automation-bots/tree/master/packages/sync-repo-settings -# Rules for master branch protection +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings +# Rules for main branch protection branchProtectionRules: # Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master +# Defaults to `main` +- pattern: main requiresCodeOwnerReviews: true requiresStrictStatusChecks: true requiredStatusCheckContexts: diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 9d4e94f4..109df9f5 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d54..8a324c9c 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 6dd49348..d4a91ac1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-videointelligence # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-videointelligence.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date version of ``python-videointelligence``. The the suggested remote name ``upstream`` should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + the branch should be the main branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-videointelligence/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-videointelligence/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-videointelligence @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-videointelligence/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-videointelligence/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/docs/conf.py b/docs/conf.py index a1f45891..6dc641a2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,8 +76,8 @@ # The encoding of source files. # source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # General information about the project. project = "google-cloud-videointelligence" @@ -280,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-videointelligence.tex", "google-cloud-videointelligence Documentation", author, @@ -315,7 +315,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ( - master_doc, + root_doc, "google-cloud-videointelligence", "google-cloud-videointelligence Documentation", [author], @@ -334,7 +334,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-videointelligence", "google-cloud-videointelligence Documentation", author, diff --git a/owlbot.py b/owlbot.py index a676586e..93a67a59 100644 --- a/owlbot.py +++ b/owlbot.py @@ -51,4 +51,51 @@ # ---------------------------------------------------------------------------- python.py_samples() +# Remove the replacements below once +# https://github.com/googleapis/synthtool/pull/1188 is merged + +# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files +s.replace( + ".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main" +) + +# Customize CONTRIBUTING.rst to replace master with main +s.replace( + "CONTRIBUTING.rst", + "fetch and merge changes from upstream into master", + "fetch and merge changes from upstream into main", +) + +s.replace( + "CONTRIBUTING.rst", + "git merge upstream/master", + "git merge upstream/main", +) + +s.replace( + "CONTRIBUTING.rst", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", +) + +s.replace( + "CONTRIBUTING.rst", + "remote \(``master``\)", + "remote (``main``)", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/CONTRIBUTING.rst", + "blob/main/CONTRIBUTING.rst", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/noxfile.py", + "blob/main/noxfile.py", +) + +s.replace("docs/conf.py", "master", "root") + s.shell.run(["nox", "-s", "blacken"], hide_output=False) From 7385113bf64a4ff4cd202743a5e8ac86dac8e92e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 31 Aug 2021 00:24:24 +0000 Subject: [PATCH 08/21] chore(python): disable dependency dashboard (#208) --- .github/.OwlBot.lock.yaml | 2 +- renovate.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a9fcd07c..b75186cf 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 + digest: sha256:d6761eec279244e57fe9d21f8343381a01d3632c034811a72f68b83119e58c69 diff --git a/renovate.json b/renovate.json index c0489556..9fa8816f 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,8 @@ { "extends": [ - "config:base", ":preserveSemverRanges" + "config:base", + ":preserveSemverRanges", + ":disableDependencyDashboard" ], "ignorePaths": [".pre-commit-config.yaml"], "pip_requirements": { From 998410f3115dcf2af72d732bd3e34a77ec9fbb29 Mon Sep 17 00:00:00 2001 From: Andrew Ferlitsch Date: Tue, 31 Aug 2021 07:22:24 -0700 Subject: [PATCH 09/21] chore: fix flaky sample track_objects (#211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-videointelligence/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # 🦕 --- samples/analyze/analyze.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/analyze/analyze.py b/samples/analyze/analyze.py index e5e650a8..2af996c8 100644 --- a/samples/analyze/analyze.py +++ b/samples/analyze/analyze.py @@ -425,7 +425,7 @@ def track_objects_gcs(gcs_uri): ) print("\nProcessing video for object annotations.") - result = operation.result(timeout=300) + result = operation.result(timeout=500) print("\nFinished processing.\n") # The first result is retrieved because a single video was processed. @@ -480,7 +480,7 @@ def track_objects(path): ) print("\nProcessing video for object annotations.") - result = operation.result(timeout=300) + result = operation.result(timeout=500) print("\nFinished processing.\n") # The first result is retrieved because a single video was processed. From 1a33c2ce1f9b552f8fdbcd16a91b0efed2692a1e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 Aug 2021 17:08:06 +0200 Subject: [PATCH 10/21] chore(deps): update dependency pytest to v6.2.5 (#209) Co-authored-by: Anthonios Partheniou --- samples/analyze/requirements-test.txt | 2 +- samples/labels/requirements-test.txt | 2 +- samples/quickstart/requirements-test.txt | 2 +- samples/shotchange/requirements-test.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/analyze/requirements-test.txt b/samples/analyze/requirements-test.txt index f5d9e108..29fa8f9f 100644 --- a/samples/analyze/requirements-test.txt +++ b/samples/analyze/requirements-test.txt @@ -1,3 +1,3 @@ backoff==1.11.1 -pytest==6.2.4 +pytest==6.2.5 flaky==3.7.0 diff --git a/samples/labels/requirements-test.txt b/samples/labels/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/labels/requirements-test.txt +++ b/samples/labels/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/quickstart/requirements-test.txt b/samples/quickstart/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/quickstart/requirements-test.txt +++ b/samples/quickstart/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/shotchange/requirements-test.txt b/samples/shotchange/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/shotchange/requirements-test.txt +++ b/samples/shotchange/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 From b9f2bcf7bf0f958fd3f1207eef4fc2e937be0f6a Mon Sep 17 00:00:00 2001 From: Andrew Ferlitsch Date: Wed, 1 Sep 2021 05:16:10 -0700 Subject: [PATCH 11/21] chore(samples): drop obsolete samples (#210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-videointelligence/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #178🦕 --- samples/analyze/beta_snippets.py | 140 -------------------------- samples/analyze/beta_snippets_test.py | 25 ----- 2 files changed, 165 deletions(-) diff --git a/samples/analyze/beta_snippets.py b/samples/analyze/beta_snippets.py index bee74c4d..6a1e5a81 100644 --- a/samples/analyze/beta_snippets.py +++ b/samples/analyze/beta_snippets.py @@ -24,8 +24,6 @@ python beta_snippets.py video-text-gcs \ gs://python-docs-samples-tests/video/googlework_tiny.mp4 - python beta_snippets.py track-objects resources/cat.mp4 - python beta_snippets.py streaming-labels resources/cat.mp4 python beta_snippets.py streaming-shot-change resources/cat.mp4 @@ -212,130 +210,6 @@ def video_detect_text(path): return annotation_result.text_annotations -def track_objects_gcs(gcs_uri): - # [START video_object_tracking_gcs_beta] - """Object Tracking.""" - from google.cloud import videointelligence_v1p2beta1 as videointelligence - - # It is recommended to use location_id as 'us-east1' for the best latency - # due to different types of processors used in this region and others. - video_client = videointelligence.VideoIntelligenceServiceClient() - features = [videointelligence.Feature.OBJECT_TRACKING] - operation = video_client.annotate_video( - request={ - "features": features, - "input_uri": gcs_uri, - "location_id": "us-east1", - } - ) - print("\nProcessing video for object annotations.") - - result = operation.result(timeout=500) - print("\nFinished processing.\n") - - # The first result is retrieved because a single video was processed. - object_annotations = result.annotation_results[0].object_annotations - - # Get only the first annotation for demo purposes. - object_annotation = object_annotations[0] - # description is in Unicode - print(u"Entity description: {}".format(object_annotation.entity.description)) - if object_annotation.entity.entity_id: - print("Entity id: {}".format(object_annotation.entity.entity_id)) - - print( - "Segment: {}s to {}s".format( - object_annotation.segment.start_time_offset.seconds - + object_annotation.segment.start_time_offset.microseconds / 1e6, - object_annotation.segment.end_time_offset.seconds - + object_annotation.segment.end_time_offset.microseconds / 1e6, - ) - ) - - print("Confidence: {}".format(object_annotation.confidence)) - - # Here we print only the bounding box of the first frame in this segment - frame = object_annotation.frames[0] - box = frame.normalized_bounding_box - print( - "Time offset of the first frame: {}s".format( - frame.time_offset.seconds + frame.time_offset.microseconds / 1e6 - ) - ) - print("Bounding box position:") - print("\tleft : {}".format(box.left)) - print("\ttop : {}".format(box.top)) - print("\tright : {}".format(box.right)) - print("\tbottom: {}".format(box.bottom)) - print("\n") - # [END video_object_tracking_gcs_beta] - return object_annotations - - -def track_objects(path): - # [START video_object_tracking_beta] - """Object Tracking.""" - from google.cloud import videointelligence_v1p2beta1 as videointelligence - - video_client = videointelligence.VideoIntelligenceServiceClient() - features = [videointelligence.Feature.OBJECT_TRACKING] - - with io.open(path, "rb") as file: - input_content = file.read() - - # It is recommended to use location_id as 'us-east1' for the best latency - # due to different types of processors used in this region and others. - operation = video_client.annotate_video( - request={ - "features": features, - "input_content": input_content, - "location_id": "us-east1", - } - ) - print("\nProcessing video for object annotations.") - - result = operation.result(timeout=500) - print("\nFinished processing.\n") - - # The first result is retrieved because a single video was processed. - object_annotations = result.annotation_results[0].object_annotations - - # Get only the first annotation for demo purposes. - object_annotation = object_annotations[0] - # description is in Unicode - print(u"Entity description: {}".format(object_annotation.entity.description)) - if object_annotation.entity.entity_id: - print("Entity id: {}".format(object_annotation.entity.entity_id)) - - print( - "Segment: {}s to {}s".format( - object_annotation.segment.start_time_offset.seconds - + object_annotation.segment.start_time_offset.microseconds / 1e6, - object_annotation.segment.end_time_offset.seconds - + object_annotation.segment.end_time_offset.microseconds / 1e6, - ) - ) - - print("Confidence: {}".format(object_annotation.confidence)) - - # Here we print only the bounding box of the first frame in this segment - frame = object_annotation.frames[0] - box = frame.normalized_bounding_box - print( - "Time offset of the first frame: {}s".format( - frame.time_offset.seconds + frame.time_offset.microseconds / 1e6 - ) - ) - print("Bounding box position:") - print("\tleft : {}".format(box.left)) - print("\ttop : {}".format(box.top)) - print("\tright : {}".format(box.right)) - print("\tbottom: {}".format(box.bottom)) - print("\n") - # [END video_object_tracking_beta] - return object_annotations - - def detect_labels_streaming(path): # [START video_streaming_label_detection_beta] from google.cloud import videointelligence_v1p3beta1 as videointelligence @@ -890,16 +764,6 @@ def stream_generator(): ) video_text_parser.add_argument("path") - video_object_tracking_gcs_parser = subparsers.add_parser( - "track-objects-gcs", help=track_objects_gcs.__doc__ - ) - video_object_tracking_gcs_parser.add_argument("gcs_uri") - - video_object_tracking_parser = subparsers.add_parser( - "track-objects", help=track_objects.__doc__ - ) - video_object_tracking_parser.add_argument("path") - video_streaming_labels_parser = subparsers.add_parser( "streaming-labels", help=detect_labels_streaming.__doc__ ) @@ -948,10 +812,6 @@ def stream_generator(): video_detect_text_gcs(args.gcs_uri) elif args.command == "video-text": video_detect_text(args.path) - elif args.command == "track-objects-gcs": - track_objects_gcs(args.gcs_uri) - elif args.command == "track-objects": - track_objects(args.path) elif args.command == "streaming-labels": detect_labels_streaming(args.path) elif args.command == "streaming-shot-change": diff --git a/samples/analyze/beta_snippets_test.py b/samples/analyze/beta_snippets_test.py index 55979e21..43d1319a 100644 --- a/samples/analyze/beta_snippets_test.py +++ b/samples/analyze/beta_snippets_test.py @@ -143,31 +143,6 @@ def test_detect_text_gcs(capsys): assert "Text" in out -# Flaky InvalidArgument -@pytest.mark.flaky(max_runs=3, min_passes=1) -def test_track_objects(capsys): - in_file = "./resources/googlework_tiny.mp4" - beta_snippets.track_objects(in_file) - out, _ = capsys.readouterr() - assert "Entity id" in out - - -# Flaky exceeding designed timeout -@pytest.mark.slow -@pytest.mark.flaky(max_runs=3, min_passes=1) -def test_track_objects_gcs(): - in_file = "gs://cloud-samples-data/video/cat.mp4" - object_annotations = beta_snippets.track_objects_gcs(in_file) - - text_exists = False - for object_annotation in object_annotations: - if "CAT" in object_annotation.entity.description.upper(): - text_exists = True - assert text_exists - assert object_annotations[0].frames[0].normalized_bounding_box.left >= 0.0 - assert object_annotations[0].frames[0].normalized_bounding_box.left <= 1.0 - - # Flaky Gateway @pytest.mark.flaky(max_runs=3, min_passes=1) def test_streaming_automl_classification(capsys, video_path): From 3384d0869931aad8c58fbb384c41b609e10cc78c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:38:22 +0000 Subject: [PATCH 12/21] chore(python): group renovate prs (#212) --- .github/.OwlBot.lock.yaml | 2 +- renovate.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b75186cf..ef3cb34f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:d6761eec279244e57fe9d21f8343381a01d3632c034811a72f68b83119e58c69 + digest: sha256:1456ea2b3b523ccff5e13030acef56d1de28f21249c62aa0f196265880338fa7 diff --git a/renovate.json b/renovate.json index 9fa8816f..c21036d3 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,7 @@ { "extends": [ "config:base", + "group:all", ":preserveSemverRanges", ":disableDependencyDashboard" ], From 000e9bc7c1d1498eff75fa12e9ee4a111ebcf830 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 18:24:35 +0000 Subject: [PATCH 13/21] chore(python): rename default branch to main (#213) --- .github/.OwlBot.lock.yaml | 2 +- CONTRIBUTING.rst | 6 ++--- owlbot.py | 47 --------------------------------------- 3 files changed, 4 insertions(+), 51 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index ef3cb34f..c07f148f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:1456ea2b3b523ccff5e13030acef56d1de28f21249c62aa0f196265880338fa7 + digest: sha256:0ffe3bdd6c7159692df5f7744da74e5ef19966288a6bf76023e8e04e0c424d7d diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d4a91ac1..6ce563a5 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -113,9 +113,9 @@ Coding Style export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-videointelligence``. The the suggested remote name ``upstream`` - should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``main``). + version of ``python-videointelligence``. The + remote name ``upstream`` should point to the official ``googleapis`` + checkout and the branch should be the default branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking diff --git a/owlbot.py b/owlbot.py index 93a67a59..a676586e 100644 --- a/owlbot.py +++ b/owlbot.py @@ -51,51 +51,4 @@ # ---------------------------------------------------------------------------- python.py_samples() -# Remove the replacements below once -# https://github.com/googleapis/synthtool/pull/1188 is merged - -# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files -s.replace( - ".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main" -) - -# Customize CONTRIBUTING.rst to replace master with main -s.replace( - "CONTRIBUTING.rst", - "fetch and merge changes from upstream into master", - "fetch and merge changes from upstream into main", -) - -s.replace( - "CONTRIBUTING.rst", - "git merge upstream/master", - "git merge upstream/main", -) - -s.replace( - "CONTRIBUTING.rst", - """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", - """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", -) - -s.replace( - "CONTRIBUTING.rst", - "remote \(``master``\)", - "remote (``main``)", -) - -s.replace( - "CONTRIBUTING.rst", - "blob/master/CONTRIBUTING.rst", - "blob/main/CONTRIBUTING.rst", -) - -s.replace( - "CONTRIBUTING.rst", - "blob/master/noxfile.py", - "blob/main/noxfile.py", -) - -s.replace("docs/conf.py", "master", "root") - s.shell.run(["nox", "-s", "blacken"], hide_output=False) From 8a33c96a220236623ba78a75fa221fa12479feaa Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 7 Sep 2021 11:50:22 -0600 Subject: [PATCH 14/21] chore: reference main branch of google-cloud-python (#214) --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c60a1037..992b7817 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ relevant information at the video, shot or per frame. - `Product Documentation`_ .. |ga| image:: https://img.shields.io/badge/support-ga-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#ga-support + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#ga-support .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-videointelligence.svg :target: https://pypi.org/project/google-cloud-videointelligence/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-videointelligence.svg From b529e102a9120914d451cbf86d6973da3993bcea Mon Sep 17 00:00:00 2001 From: bingatgoogle <90022620+bingatgoogle@users.noreply.github.com> Date: Thu, 9 Sep 2021 14:12:31 -0700 Subject: [PATCH 15/21] samples: add streaming_automl_action_recognition sample (#215) Add code samples for streaming action recognition inference. --- samples/analyze/beta_snippets.py | 87 +++++++++++++++++++++++++++ samples/analyze/beta_snippets_test.py | 10 +++ 2 files changed, 97 insertions(+) diff --git a/samples/analyze/beta_snippets.py b/samples/analyze/beta_snippets.py index 6a1e5a81..7208d290 100644 --- a/samples/analyze/beta_snippets.py +++ b/samples/analyze/beta_snippets.py @@ -40,6 +40,9 @@ python beta_snippets.py streaming-automl-object-tracking resources/cat.mp4 \ $PROJECT_ID $MODEL_ID + + python beta_snippets.py streaming-automl-action-recognition \ + resources/cat.mp4 $PROJECT_ID $MODEL_ID """ import argparse @@ -743,6 +746,81 @@ def stream_generator(): # [END video_streaming_automl_object_tracking_beta] +def streaming_automl_action_recognition(path, project_id, model_id): + # [START video_streaming_automl_action_recognition_beta] + import io + + from google.cloud import videointelligence_v1p3beta1 as videointelligence + + # path = 'path_to_file' + # project_id = 'project_id' + # model_id = 'automl_action_recognition_model_id' + + client = videointelligence.StreamingVideoIntelligenceServiceClient() + + model_path = "projects/{}/locations/us-central1/models/{}".format( + project_id, model_id + ) + + automl_config = videointelligence.StreamingAutomlActionRecognitionConfig( + model_name=model_path + ) + + video_config = videointelligence.StreamingVideoConfig( + feature=videointelligence.StreamingFeature.STREAMING_AUTOML_ACTION_RECOGNITION, + automl_action_recognition_config=automl_config, + ) + + # config_request should be the first in the stream of requests. + config_request = videointelligence.StreamingAnnotateVideoRequest( + video_config=video_config + ) + + # Set the chunk size to 5MB (recommended less than 10MB). + chunk_size = 5 * 1024 * 1024 + + def stream_generator(): + yield config_request + # Load file content. + # Note: Input videos must have supported video codecs. See + # https://cloud.google.com/video-intelligence/docs/streaming/streaming#supported_video_codecs + # for more details. + with io.open(path, "rb") as video_file: + while True: + data = video_file.read(chunk_size) + if not data: + break + yield videointelligence.StreamingAnnotateVideoRequest( + input_content=data + ) + + requests = stream_generator() + + # streaming_annotate_video returns a generator. + # The default timeout is about 300 seconds. + # To process longer videos it should be set to + # larger than the length (in seconds) of the video. + responses = client.streaming_annotate_video(requests, timeout=900) + + # Each response corresponds to about 1 second of video. + for response in responses: + # Check for errors. + if response.error.message: + print(response.error.message) + break + + for label in response.annotation_results.label_annotations: + for frame in label.frames: + print( + "At {:3d}s segment, {:5.1%} {}".format( + frame.time_offset.seconds, + frame.confidence, + label.entity.entity_id, + ) + ) + # [END video_streaming_automl_action_recognition_beta] + + if __name__ == "__main__": parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter @@ -804,6 +882,13 @@ def stream_generator(): video_streaming_automl_object_tracking_parser.add_argument("project_id") video_streaming_automl_object_tracking_parser.add_argument("model_id") + video_streaming_automl_action_recognition_parser = subparsers.add_parser( + "streaming-automl-action-recognition", help=streaming_automl_action_recognition.__doc__ + ) + video_streaming_automl_action_recognition_parser.add_argument("path") + video_streaming_automl_action_recognition_parser.add_argument("project_id") + video_streaming_automl_action_recognition_parser.add_argument("model_id") + args = parser.parse_args() if args.command == "transcription": @@ -826,3 +911,5 @@ def stream_generator(): streaming_automl_classification(args.path, args.project_id, args.model_id) elif args.command == "streaming-automl-object-tracking": streaming_automl_object_tracking(args.path, args.project_id, args.model_id) + elif args.command == "streaming-automl-action-recognition": + streaming_automl_action_recognition(args.path, args.project_id, args.model_id) diff --git a/samples/analyze/beta_snippets_test.py b/samples/analyze/beta_snippets_test.py index 43d1319a..061b643a 100644 --- a/samples/analyze/beta_snippets_test.py +++ b/samples/analyze/beta_snippets_test.py @@ -161,3 +161,13 @@ def test_streaming_automl_object_tracking(capsys, video_path): beta_snippets.streaming_automl_object_tracking(video_path, project_id, model_id) out, _ = capsys.readouterr() assert "Track Id" in out + + +# Flaky Gateway +@pytest.mark.flaky(max_runs=3, min_passes=1) +def test_streaming_automl_action_recognition(capsys, video_path): + project_id = os.environ["GOOGLE_CLOUD_PROJECT"] + model_id = "2509833202491719680" + beta_snippets.streaming_automl_action_recognition(video_path, project_id, model_id) + out, _ = capsys.readouterr() + assert "segment" in out From cc7d63092833d1aeaaeae27d154c1ec9f259e81f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Sep 2021 16:43:01 +0200 Subject: [PATCH 16/21] chore(deps): update dependency google-cloud-storage to v1.42.1 (#217) --- samples/analyze/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/analyze/requirements.txt b/samples/analyze/requirements.txt index 4a296d5b..0187c8f0 100644 --- a/samples/analyze/requirements.txt +++ b/samples/analyze/requirements.txt @@ -1,2 +1,2 @@ google-cloud-videointelligence==2.3.2 -google-cloud-storage==1.42.0 +google-cloud-storage==1.42.1 From 1d9e36f410e9c9e9b34e1e904bb8cb2f8f2887c9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 15:36:44 +0000 Subject: [PATCH 17/21] chore: blacken samples noxfile template (#218) --- .github/.OwlBot.lock.yaml | 2 +- samples/analyze/noxfile.py | 44 ++++++++++++++++++++--------------- samples/labels/noxfile.py | 44 ++++++++++++++++++++--------------- samples/quickstart/noxfile.py | 44 ++++++++++++++++++++--------------- samples/shotchange/noxfile.py | 44 ++++++++++++++++++++--------------- 5 files changed, 101 insertions(+), 77 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index c07f148f..e2c23777 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:0ffe3bdd6c7159692df5f7744da74e5ef19966288a6bf76023e8e04e0c424d7d + digest: sha256:0ccd9f4d714d36e311f60f407199dd460e43a99a125b5ca64b1d75f6e5f8581b diff --git a/samples/analyze/noxfile.py b/samples/analyze/noxfile.py index e73436a1..b008613f 100644 --- a/samples/analyze/noxfile.py +++ b/samples/analyze/noxfile.py @@ -39,17 +39,15 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': [], - + "ignored_versions": [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - 'enforce_type_hints': False, - + "enforce_type_hints": False, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string # to use your own Cloud project. - 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', # If you need to use a specific version of pip, # change pip_version_override to the string representation @@ -57,13 +55,13 @@ "pip_version_override": None, # A dictionary you want to inject into your test. Don't put any # secrets here. These values will override predefined values. - 'envs': {}, + "envs": {}, } try: # Ensure we can import noxfile_config in the project's directory. - sys.path.append('.') + sys.path.append(".") from noxfile_config import TEST_CONFIG_OVERRIDE except ImportError as e: print("No user noxfile_config found: detail: {}".format(e)) @@ -78,12 +76,12 @@ def get_pytest_env_vars() -> Dict[str, str]: ret = {} # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG['gcloud_project_env'] + env_key = TEST_CONFIG["gcloud_project_env"] # This should error out if not set. - ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] + ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] # Apply user supplied envs. - ret.update(TEST_CONFIG['envs']) + ret.update(TEST_CONFIG["envs"]) return ret @@ -92,11 +90,14 @@ def get_pytest_env_vars() -> Dict[str, str]: ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] +IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) # # Style Checks # @@ -141,7 +142,7 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG['enforce_type_hints']: + if not TEST_CONFIG["enforce_type_hints"]: session.install("flake8", "flake8-import-order") else: session.install("flake8", "flake8-import-order", "flake8-annotations") @@ -150,9 +151,11 @@ def lint(session: nox.sessions.Session) -> None: args = FLAKE8_COMMON_ARGS + [ "--application-import-names", ",".join(local_names), - "." + ".", ] session.run("flake8", *args) + + # # Black # @@ -165,6 +168,7 @@ def blacken(session: nox.sessions.Session) -> None: session.run("black", *python_files) + # # Sample Tests # @@ -173,7 +177,9 @@ def blacken(session: nox.sessions.Session) -> None: PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] -def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: +def _session_tests( + session: nox.sessions.Session, post_install: Callable = None +) -> None: if TEST_CONFIG["pip_version_override"]: pip_version = TEST_CONFIG["pip_version_override"] session.install(f"pip=={pip_version}") @@ -203,7 +209,7 @@ def _session_tests(session: nox.sessions.Session, post_install: Callable = None) # on travis where slow and flaky tests are excluded. # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html success_codes=[0, 5], - env=get_pytest_env_vars() + env=get_pytest_env_vars(), ) @@ -213,9 +219,9 @@ def py(session: nox.sessions.Session) -> None: if session.python in TESTED_VERSIONS: _session_tests(session) else: - session.skip("SKIPPED: {} tests are disabled for this sample.".format( - session.python - )) + session.skip( + "SKIPPED: {} tests are disabled for this sample.".format(session.python) + ) # diff --git a/samples/labels/noxfile.py b/samples/labels/noxfile.py index e73436a1..b008613f 100644 --- a/samples/labels/noxfile.py +++ b/samples/labels/noxfile.py @@ -39,17 +39,15 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': [], - + "ignored_versions": [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - 'enforce_type_hints': False, - + "enforce_type_hints": False, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string # to use your own Cloud project. - 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', # If you need to use a specific version of pip, # change pip_version_override to the string representation @@ -57,13 +55,13 @@ "pip_version_override": None, # A dictionary you want to inject into your test. Don't put any # secrets here. These values will override predefined values. - 'envs': {}, + "envs": {}, } try: # Ensure we can import noxfile_config in the project's directory. - sys.path.append('.') + sys.path.append(".") from noxfile_config import TEST_CONFIG_OVERRIDE except ImportError as e: print("No user noxfile_config found: detail: {}".format(e)) @@ -78,12 +76,12 @@ def get_pytest_env_vars() -> Dict[str, str]: ret = {} # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG['gcloud_project_env'] + env_key = TEST_CONFIG["gcloud_project_env"] # This should error out if not set. - ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] + ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] # Apply user supplied envs. - ret.update(TEST_CONFIG['envs']) + ret.update(TEST_CONFIG["envs"]) return ret @@ -92,11 +90,14 @@ def get_pytest_env_vars() -> Dict[str, str]: ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] +IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) # # Style Checks # @@ -141,7 +142,7 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG['enforce_type_hints']: + if not TEST_CONFIG["enforce_type_hints"]: session.install("flake8", "flake8-import-order") else: session.install("flake8", "flake8-import-order", "flake8-annotations") @@ -150,9 +151,11 @@ def lint(session: nox.sessions.Session) -> None: args = FLAKE8_COMMON_ARGS + [ "--application-import-names", ",".join(local_names), - "." + ".", ] session.run("flake8", *args) + + # # Black # @@ -165,6 +168,7 @@ def blacken(session: nox.sessions.Session) -> None: session.run("black", *python_files) + # # Sample Tests # @@ -173,7 +177,9 @@ def blacken(session: nox.sessions.Session) -> None: PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] -def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: +def _session_tests( + session: nox.sessions.Session, post_install: Callable = None +) -> None: if TEST_CONFIG["pip_version_override"]: pip_version = TEST_CONFIG["pip_version_override"] session.install(f"pip=={pip_version}") @@ -203,7 +209,7 @@ def _session_tests(session: nox.sessions.Session, post_install: Callable = None) # on travis where slow and flaky tests are excluded. # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html success_codes=[0, 5], - env=get_pytest_env_vars() + env=get_pytest_env_vars(), ) @@ -213,9 +219,9 @@ def py(session: nox.sessions.Session) -> None: if session.python in TESTED_VERSIONS: _session_tests(session) else: - session.skip("SKIPPED: {} tests are disabled for this sample.".format( - session.python - )) + session.skip( + "SKIPPED: {} tests are disabled for this sample.".format(session.python) + ) # diff --git a/samples/quickstart/noxfile.py b/samples/quickstart/noxfile.py index e73436a1..b008613f 100644 --- a/samples/quickstart/noxfile.py +++ b/samples/quickstart/noxfile.py @@ -39,17 +39,15 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': [], - + "ignored_versions": [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - 'enforce_type_hints': False, - + "enforce_type_hints": False, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string # to use your own Cloud project. - 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', # If you need to use a specific version of pip, # change pip_version_override to the string representation @@ -57,13 +55,13 @@ "pip_version_override": None, # A dictionary you want to inject into your test. Don't put any # secrets here. These values will override predefined values. - 'envs': {}, + "envs": {}, } try: # Ensure we can import noxfile_config in the project's directory. - sys.path.append('.') + sys.path.append(".") from noxfile_config import TEST_CONFIG_OVERRIDE except ImportError as e: print("No user noxfile_config found: detail: {}".format(e)) @@ -78,12 +76,12 @@ def get_pytest_env_vars() -> Dict[str, str]: ret = {} # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG['gcloud_project_env'] + env_key = TEST_CONFIG["gcloud_project_env"] # This should error out if not set. - ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] + ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] # Apply user supplied envs. - ret.update(TEST_CONFIG['envs']) + ret.update(TEST_CONFIG["envs"]) return ret @@ -92,11 +90,14 @@ def get_pytest_env_vars() -> Dict[str, str]: ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] +IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) # # Style Checks # @@ -141,7 +142,7 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG['enforce_type_hints']: + if not TEST_CONFIG["enforce_type_hints"]: session.install("flake8", "flake8-import-order") else: session.install("flake8", "flake8-import-order", "flake8-annotations") @@ -150,9 +151,11 @@ def lint(session: nox.sessions.Session) -> None: args = FLAKE8_COMMON_ARGS + [ "--application-import-names", ",".join(local_names), - "." + ".", ] session.run("flake8", *args) + + # # Black # @@ -165,6 +168,7 @@ def blacken(session: nox.sessions.Session) -> None: session.run("black", *python_files) + # # Sample Tests # @@ -173,7 +177,9 @@ def blacken(session: nox.sessions.Session) -> None: PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] -def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: +def _session_tests( + session: nox.sessions.Session, post_install: Callable = None +) -> None: if TEST_CONFIG["pip_version_override"]: pip_version = TEST_CONFIG["pip_version_override"] session.install(f"pip=={pip_version}") @@ -203,7 +209,7 @@ def _session_tests(session: nox.sessions.Session, post_install: Callable = None) # on travis where slow and flaky tests are excluded. # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html success_codes=[0, 5], - env=get_pytest_env_vars() + env=get_pytest_env_vars(), ) @@ -213,9 +219,9 @@ def py(session: nox.sessions.Session) -> None: if session.python in TESTED_VERSIONS: _session_tests(session) else: - session.skip("SKIPPED: {} tests are disabled for this sample.".format( - session.python - )) + session.skip( + "SKIPPED: {} tests are disabled for this sample.".format(session.python) + ) # diff --git a/samples/shotchange/noxfile.py b/samples/shotchange/noxfile.py index e73436a1..b008613f 100644 --- a/samples/shotchange/noxfile.py +++ b/samples/shotchange/noxfile.py @@ -39,17 +39,15 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': [], - + "ignored_versions": [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - 'enforce_type_hints': False, - + "enforce_type_hints": False, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string # to use your own Cloud project. - 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', # If you need to use a specific version of pip, # change pip_version_override to the string representation @@ -57,13 +55,13 @@ "pip_version_override": None, # A dictionary you want to inject into your test. Don't put any # secrets here. These values will override predefined values. - 'envs': {}, + "envs": {}, } try: # Ensure we can import noxfile_config in the project's directory. - sys.path.append('.') + sys.path.append(".") from noxfile_config import TEST_CONFIG_OVERRIDE except ImportError as e: print("No user noxfile_config found: detail: {}".format(e)) @@ -78,12 +76,12 @@ def get_pytest_env_vars() -> Dict[str, str]: ret = {} # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG['gcloud_project_env'] + env_key = TEST_CONFIG["gcloud_project_env"] # This should error out if not set. - ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] + ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] # Apply user supplied envs. - ret.update(TEST_CONFIG['envs']) + ret.update(TEST_CONFIG["envs"]) return ret @@ -92,11 +90,14 @@ def get_pytest_env_vars() -> Dict[str, str]: ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] +IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) # # Style Checks # @@ -141,7 +142,7 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG['enforce_type_hints']: + if not TEST_CONFIG["enforce_type_hints"]: session.install("flake8", "flake8-import-order") else: session.install("flake8", "flake8-import-order", "flake8-annotations") @@ -150,9 +151,11 @@ def lint(session: nox.sessions.Session) -> None: args = FLAKE8_COMMON_ARGS + [ "--application-import-names", ",".join(local_names), - "." + ".", ] session.run("flake8", *args) + + # # Black # @@ -165,6 +168,7 @@ def blacken(session: nox.sessions.Session) -> None: session.run("black", *python_files) + # # Sample Tests # @@ -173,7 +177,9 @@ def blacken(session: nox.sessions.Session) -> None: PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] -def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: +def _session_tests( + session: nox.sessions.Session, post_install: Callable = None +) -> None: if TEST_CONFIG["pip_version_override"]: pip_version = TEST_CONFIG["pip_version_override"] session.install(f"pip=={pip_version}") @@ -203,7 +209,7 @@ def _session_tests(session: nox.sessions.Session, post_install: Callable = None) # on travis where slow and flaky tests are excluded. # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html success_codes=[0, 5], - env=get_pytest_env_vars() + env=get_pytest_env_vars(), ) @@ -213,9 +219,9 @@ def py(session: nox.sessions.Session) -> None: if session.python in TESTED_VERSIONS: _session_tests(session) else: - session.skip("SKIPPED: {} tests are disabled for this sample.".format( - session.python - )) + session.skip( + "SKIPPED: {} tests are disabled for this sample.".format(session.python) + ) # From 64ed84e1fe88fc74c1599d37992f76b4d736d4e8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 20 Sep 2021 21:04:12 +0200 Subject: [PATCH 18/21] chore(deps): update dependency google-cloud-storage to v1.42.2 (#219) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-storage](https://togithub.com/googleapis/python-storage) | `==1.42.1` -> `==1.42.2` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.42.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.42.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.42.2/compatibility-slim/1.42.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.42.2/confidence-slim/1.42.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/python-storage ### [`v1.42.2`](https://togithub.com/googleapis/python-storage/blob/master/CHANGELOG.md#​1422-httpswwwgithubcomgoogleapispython-storagecomparev1421v1422-2021-09-16) [Compare Source](https://togithub.com/googleapis/python-storage/compare/v1.42.1...v1.42.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **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/python-videointelligence). --- samples/analyze/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/analyze/requirements.txt b/samples/analyze/requirements.txt index 0187c8f0..f17f33cb 100644 --- a/samples/analyze/requirements.txt +++ b/samples/analyze/requirements.txt @@ -1,2 +1,2 @@ google-cloud-videointelligence==2.3.2 -google-cloud-storage==1.42.1 +google-cloud-storage==1.42.2 From bfc0d5967f078a02e27526e11269b2042cf3dc67 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 12:36:36 -0700 Subject: [PATCH 19/21] chore: relocate owl bot post processor (#221) chore: relocate owl bot post processor --- .github/.OwlBot.lock.yaml | 4 ++-- .github/.OwlBot.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index e2c23777..2567653c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: - image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:0ccd9f4d714d36e311f60f407199dd460e43a99a125b5ca64b1d75f6e5f8581b + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest + digest: sha256:87eee22d276554e4e52863ec9b1cb6a7245815dfae20439712bf644348215a5a diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index dc653e78..3afddebc 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -13,7 +13,7 @@ # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-python:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest deep-remove-regex: - /owl-bot-staging From ec86dc6211a2b5be69c2b74dd65ea4968f89f244 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 16:12:10 +0000 Subject: [PATCH 20/21] chore: use gapic-generator-python 0.51.2 (#222) - [ ] Regenerate this pull request now. fix: add 'dict' annotation type to 'request' Committer: @busunkim96 PiperOrigin-RevId: 398509016 Source-Link: https://github.com/googleapis/googleapis/commit/b224dfa52642a733ea64849d4e06d15c274bc08f Source-Link: https://github.com/googleapis/googleapis-gen/commit/63a1db7a38d74b9639592f521ed1daaf7299ad9a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjNhMWRiN2EzOGQ3NGI5NjM5NTkyZjUyMWVkMWRhYWY3Mjk5YWQ5YSJ9 --- .../services/video_intelligence_service/client.py | 6 +++--- .../video_intelligence_service/transports/base.py | 2 +- .../video_intelligence_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../services/video_intelligence_service/client.py | 6 +++--- .../video_intelligence_service/transports/base.py | 2 +- .../video_intelligence_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../services/video_intelligence_service/client.py | 6 +++--- .../video_intelligence_service/transports/base.py | 2 +- .../video_intelligence_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../services/video_intelligence_service/client.py | 6 +++--- .../video_intelligence_service/transports/base.py | 2 +- .../video_intelligence_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../streaming_video_intelligence_service/client.py | 12 +----------- .../transports/base.py | 2 +- .../transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- .../services/video_intelligence_service/client.py | 6 +++--- .../video_intelligence_service/transports/base.py | 2 +- .../video_intelligence_service/transports/grpc.py | 6 +++--- .../transports/grpc_asyncio.py | 6 +++--- scripts/fixup_videointelligence_v1_keywords.py | 4 ++-- scripts/fixup_videointelligence_v1beta2_keywords.py | 4 ++-- .../fixup_videointelligence_v1p1beta1_keywords.py | 4 ++-- .../fixup_videointelligence_v1p2beta1_keywords.py | 4 ++-- .../fixup_videointelligence_v1p3beta1_keywords.py | 6 +++--- 29 files changed, 69 insertions(+), 79 deletions(-) diff --git a/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py index 2dc34a1b..6261b9a5 100644 --- a/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -339,7 +339,7 @@ def __init__( def annotate_video( self, - request: video_intelligence.AnnotateVideoRequest = None, + request: Union[video_intelligence.AnnotateVideoRequest, dict] = None, *, input_uri: str = None, features: Sequence[video_intelligence.Feature] = None, @@ -354,7 +354,7 @@ def annotate_video( contains ``AnnotateVideoResponse`` (results). Args: - request (google.cloud.videointelligence_v1.types.AnnotateVideoRequest): + request (Union[google.cloud.videointelligence_v1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. input_uri (str): Input video location. Currently, only `Cloud diff --git a/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py b/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py index f6298a70..0138e4a0 100644 --- a/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py +++ b/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/base.py @@ -119,7 +119,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc.py b/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc.py index 0e0cd3a3..ab9f9c5c 100644 --- a/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc.py +++ b/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc.py @@ -82,16 +82,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc_asyncio.py b/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc_asyncio.py index b907977e..18771166 100644 --- a/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc_asyncio.py +++ b/google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc_asyncio.py @@ -129,16 +129,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py index 27e1d835..c4cfc802 100644 --- a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -339,7 +339,7 @@ def __init__( def annotate_video( self, - request: video_intelligence.AnnotateVideoRequest = None, + request: Union[video_intelligence.AnnotateVideoRequest, dict] = None, *, input_uri: str = None, features: Sequence[video_intelligence.Feature] = None, @@ -354,7 +354,7 @@ def annotate_video( contains ``AnnotateVideoResponse`` (results). Args: - request (google.cloud.videointelligence_v1beta2.types.AnnotateVideoRequest): + request (Union[google.cloud.videointelligence_v1beta2.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. input_uri (str): Input video location. Currently, only `Google Cloud diff --git a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/base.py b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/base.py index 10da0850..a49bd4fe 100644 --- a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/base.py +++ b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/base.py @@ -119,7 +119,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc.py b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc.py index 47a60651..9ecf5e82 100644 --- a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc.py +++ b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc.py @@ -82,16 +82,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc_asyncio.py b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc_asyncio.py index 5c731506..ddef810d 100644 --- a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc_asyncio.py +++ b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc_asyncio.py @@ -129,16 +129,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py index ac9bb435..726abf60 100644 --- a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -339,7 +339,7 @@ def __init__( def annotate_video( self, - request: video_intelligence.AnnotateVideoRequest = None, + request: Union[video_intelligence.AnnotateVideoRequest, dict] = None, *, input_uri: str = None, features: Sequence[video_intelligence.Feature] = None, @@ -354,7 +354,7 @@ def annotate_video( contains ``AnnotateVideoResponse`` (results). Args: - request (google.cloud.videointelligence_v1p1beta1.types.AnnotateVideoRequest): + request (Union[google.cloud.videointelligence_v1p1beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. input_uri (str): Input video location. Currently, only `Google Cloud diff --git a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/base.py b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/base.py index d5ebc7e0..e817294f 100644 --- a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/base.py +++ b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/base.py @@ -119,7 +119,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc.py b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc.py index 787a87d0..d94be04b 100644 --- a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc.py +++ b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc.py @@ -82,16 +82,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc_asyncio.py b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc_asyncio.py index 90b0c269..f039e75f 100644 --- a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc_asyncio.py +++ b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc_asyncio.py @@ -129,16 +129,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py index 43ac4d2c..9fce56e7 100644 --- a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -339,7 +339,7 @@ def __init__( def annotate_video( self, - request: video_intelligence.AnnotateVideoRequest = None, + request: Union[video_intelligence.AnnotateVideoRequest, dict] = None, *, input_uri: str = None, features: Sequence[video_intelligence.Feature] = None, @@ -354,7 +354,7 @@ def annotate_video( contains ``AnnotateVideoResponse`` (results). Args: - request (google.cloud.videointelligence_v1p2beta1.types.AnnotateVideoRequest): + request (Union[google.cloud.videointelligence_v1p2beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. input_uri (str): Input video location. Currently, only `Google Cloud diff --git a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/base.py b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/base.py index 783f791c..486e90ba 100644 --- a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/base.py +++ b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/base.py @@ -119,7 +119,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc.py b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc.py index 991dc91d..0e1f0166 100644 --- a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc.py +++ b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc.py @@ -82,16 +82,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc_asyncio.py b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc_asyncio.py index f6b9dd93..61775ef4 100644 --- a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc_asyncio.py +++ b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/transports/grpc_asyncio.py @@ -129,16 +129,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py index 8fcce4d8..430b8a91 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore diff --git a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/base.py b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/base.py index 10041f45..a7693b16 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/base.py +++ b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc.py b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc.py index 50536600..2380e158 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc.py +++ b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc.py @@ -82,16 +82,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc_asyncio.py b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc_asyncio.py index 3d1c21fe..4de007f2 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc_asyncio.py +++ b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/transports/grpc_asyncio.py @@ -129,16 +129,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py index ea4aab92..cae9d972 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -339,7 +339,7 @@ def __init__( def annotate_video( self, - request: video_intelligence.AnnotateVideoRequest = None, + request: Union[video_intelligence.AnnotateVideoRequest, dict] = None, *, input_uri: str = None, features: Sequence[video_intelligence.Feature] = None, @@ -354,7 +354,7 @@ def annotate_video( contains ``AnnotateVideoResponse`` (results). Args: - request (google.cloud.videointelligence_v1p3beta1.types.AnnotateVideoRequest): + request (Union[google.cloud.videointelligence_v1p3beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. input_uri (str): Input video location. Currently, only `Cloud diff --git a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/base.py b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/base.py index fc9b14d3..64fa95a0 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/base.py +++ b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/base.py @@ -119,7 +119,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc.py b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc.py index 715bd80b..5b686dda 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc.py +++ b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc.py @@ -82,16 +82,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc_asyncio.py b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc_asyncio.py index 8f0d7226..8f0c5638 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc_asyncio.py +++ b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/transports/grpc_asyncio.py @@ -129,16 +129,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/scripts/fixup_videointelligence_v1_keywords.py b/scripts/fixup_videointelligence_v1_keywords.py index 1f1ca2dd..7c1a29e9 100644 --- a/scripts/fixup_videointelligence_v1_keywords.py +++ b/scripts/fixup_videointelligence_v1_keywords.py @@ -39,7 +39,7 @@ def partition( class videointelligenceCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), + 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -58,7 +58,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/fixup_videointelligence_v1beta2_keywords.py b/scripts/fixup_videointelligence_v1beta2_keywords.py index 1f1ca2dd..7c1a29e9 100644 --- a/scripts/fixup_videointelligence_v1beta2_keywords.py +++ b/scripts/fixup_videointelligence_v1beta2_keywords.py @@ -39,7 +39,7 @@ def partition( class videointelligenceCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), + 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -58,7 +58,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/fixup_videointelligence_v1p1beta1_keywords.py b/scripts/fixup_videointelligence_v1p1beta1_keywords.py index 1f1ca2dd..7c1a29e9 100644 --- a/scripts/fixup_videointelligence_v1p1beta1_keywords.py +++ b/scripts/fixup_videointelligence_v1p1beta1_keywords.py @@ -39,7 +39,7 @@ def partition( class videointelligenceCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), + 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -58,7 +58,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/fixup_videointelligence_v1p2beta1_keywords.py b/scripts/fixup_videointelligence_v1p2beta1_keywords.py index 1f1ca2dd..7c1a29e9 100644 --- a/scripts/fixup_videointelligence_v1p2beta1_keywords.py +++ b/scripts/fixup_videointelligence_v1p2beta1_keywords.py @@ -39,7 +39,7 @@ def partition( class videointelligenceCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), + 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -58,7 +58,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/fixup_videointelligence_v1p3beta1_keywords.py b/scripts/fixup_videointelligence_v1p3beta1_keywords.py index b8e257f0..e172e7e2 100644 --- a/scripts/fixup_videointelligence_v1p3beta1_keywords.py +++ b/scripts/fixup_videointelligence_v1p3beta1_keywords.py @@ -39,8 +39,8 @@ def partition( class videointelligenceCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), - 'streaming_annotate_video': ('video_config', 'input_content', ), + 'annotate_video': ('features', 'input_uri', 'input_content', 'video_context', 'output_uri', 'location_id', ), + 'streaming_annotate_video': ('video_config', 'input_content', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -59,7 +59,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) From 531abaecf91f9ea3e20a4f88ee11945d9a193c52 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 15:34:12 +0000 Subject: [PATCH 21/21] chore: release 2.3.3 (#223) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.3](https://www.github.com/googleapis/python-videointelligence/compare/v2.3.2...v2.3.3) (2021-09-24) ### Bug Fixes * add 'dict' annotation type to 'request' ([ec86dc6](https://www.github.com/googleapis/python-videointelligence/commit/ec86dc6211a2b5be69c2b74dd65ea4968f89f244)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ee5a2fe..7bab190e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-videointelligence/#history +### [2.3.3](https://www.github.com/googleapis/python-videointelligence/compare/v2.3.2...v2.3.3) (2021-09-24) + + +### Bug Fixes + +* add 'dict' annotation type to 'request' ([ec86dc6](https://www.github.com/googleapis/python-videointelligence/commit/ec86dc6211a2b5be69c2b74dd65ea4968f89f244)) + ### [2.3.2](https://www.github.com/googleapis/python-videointelligence/compare/v2.3.1...v2.3.2) (2021-07-26) diff --git a/setup.py b/setup.py index 9cd0aa8e..0c2c21b2 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-videointelligence" description = "Google Cloud Video Intelligence API client library" -version = "2.3.2" +version = "2.3.3" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta'