diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7e..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:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest + digest: sha256:87eee22d276554e4e52863ec9b1cb6a7245815dfae20439712bf644348215a5a diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index 4628ccc9..30b98729 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 diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index af599353..3e98ae70 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,9 +1,11 @@ -# 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: - 'Kokoro' - 'cla/google' diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ca2d1d18..e52a01da 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/CHANGELOG.md b/CHANGELOG.md index 7934c45c..0cc849ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-vision/#history +### [2.4.3](https://www.github.com/googleapis/python-vision/compare/v2.4.2...v2.4.3) (2021-09-27) + + +### Bug Fixes + +* add 'dict' annotation type to 'request' ([87ad0ea](https://www.github.com/googleapis/python-vision/commit/87ad0eabbba08754320fd836c5e76fba48222b5c)) + ### [2.4.2](https://www.github.com/googleapis/python-vision/compare/v2.4.1...v2.4.2) (2021-07-29) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index aded9b82..8af446ff 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-vision # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-vision.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-vision``. 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``). + version of ``python-vision``. 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 @@ -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-vision/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-vision/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-vision @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-vision/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-vision/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/README.rst b/README.rst index 524e0f13..6173c1ab 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ Storage. - `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#general-availability + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-vision.svg :target: https://pypi.org/project/google-cloud-vision/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-vision.svg @@ -111,7 +111,7 @@ Example Usage Next Steps ~~~~~~~~~~ -- Read the `Client Library Documentation`_ for Google Cloud Vision API +- Read the `Client Library Documentation`_ for Google Cloud Vision API to see other available methods on the client. - Read the `Product documentation`_ to learn more about the product and see How-to Guides. diff --git a/UPGRADING.md b/UPGRADING.md index c3c1cd93..8e313d5a 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -151,7 +151,7 @@ request = vision_v1.GetProductSetRequest(name="name") ## Location Path Helper Method -Loation path helper method has been removed. Please construct +Location path helper method has been removed. Please construct the path manually. ```py diff --git a/docs/conf.py b/docs/conf.py index 6b1d9697..107afc35 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-vision" @@ -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", @@ -279,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-vision.tex", "google-cloud-vision Documentation", author, @@ -313,13 +314,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ( - master_doc, - "google-cloud-vision", - "google-cloud-vision Documentation", - [author], - 1, - ) + (root_doc, "google-cloud-vision", "google-cloud-vision Documentation", [author], 1,) ] # If true, show URL addresses after external links. @@ -333,7 +328,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-vision", "google-cloud-vision Documentation", author, diff --git a/google/cloud/vision_v1/services/image_annotator/client.py b/google/cloud/vision_v1/services/image_annotator/client.py index 64e81bdd..122c1ed4 100644 --- a/google/cloud/vision_v1/services/image_annotator/client.py +++ b/google/cloud/vision_v1/services/image_annotator/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 @@ -373,7 +373,7 @@ def __init__( def batch_annotate_images( self, - request: image_annotator.BatchAnnotateImagesRequest = None, + request: Union[image_annotator.BatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -384,7 +384,7 @@ def batch_annotate_images( images. Args: - request (google.cloud.vision_v1.types.BatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1.types.BatchAnnotateImagesRequest, dict]): The request object. Multiple image annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1.types.AnnotateImageRequest]): @@ -442,7 +442,7 @@ def batch_annotate_images( def batch_annotate_files( self, - request: image_annotator.BatchAnnotateFilesRequest = None, + request: Union[image_annotator.BatchAnnotateFilesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateFileRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -459,7 +459,7 @@ def batch_annotate_files( extracted. Args: - request (google.cloud.vision_v1.types.BatchAnnotateFilesRequest): + request (Union[google.cloud.vision_v1.types.BatchAnnotateFilesRequest, dict]): The request object. A list of requests to annotate files using the BatchAnnotateFiles API. requests (Sequence[google.cloud.vision_v1.types.AnnotateFileRequest]): @@ -517,7 +517,7 @@ def batch_annotate_files( def async_batch_annotate_images( self, - request: image_annotator.AsyncBatchAnnotateImagesRequest = None, + request: Union[image_annotator.AsyncBatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, output_config: image_annotator.OutputConfig = None, @@ -539,7 +539,7 @@ def async_batch_annotate_images( BatchAnnotateImagesResponse proto. Args: - request (google.cloud.vision_v1.types.AsyncBatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1.types.AsyncBatchAnnotateImagesRequest, dict]): The request object. Request for async image annotation for a list of images. requests (Sequence[google.cloud.vision_v1.types.AnnotateImageRequest]): @@ -619,7 +619,7 @@ def async_batch_annotate_images( def async_batch_annotate_files( self, - request: image_annotator.AsyncBatchAnnotateFilesRequest = None, + request: Union[image_annotator.AsyncBatchAnnotateFilesRequest, dict] = None, *, requests: Sequence[image_annotator.AsyncAnnotateFileRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -635,7 +635,7 @@ def async_batch_annotate_files( ``AsyncBatchAnnotateFilesResponse`` (results). Args: - request (google.cloud.vision_v1.types.AsyncBatchAnnotateFilesRequest): + request (Union[google.cloud.vision_v1.types.AsyncBatchAnnotateFilesRequest, dict]): The request object. Multiple async file annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1.types.AsyncAnnotateFileRequest]): diff --git a/google/cloud/vision_v1/services/image_annotator/transports/base.py b/google/cloud/vision_v1/services/image_annotator/transports/base.py index 9020aa3b..bf88d098 100644 --- a/google/cloud/vision_v1/services/image_annotator/transports/base.py +++ b/google/cloud/vision_v1/services/image_annotator/transports/base.py @@ -120,7 +120,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/vision_v1/services/image_annotator/transports/grpc.py b/google/cloud/vision_v1/services/image_annotator/transports/grpc.py index 1a06531e..666c5d3c 100644 --- a/google/cloud/vision_v1/services/image_annotator/transports/grpc.py +++ b/google/cloud/vision_v1/services/image_annotator/transports/grpc.py @@ -85,16 +85,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/vision_v1/services/image_annotator/transports/grpc_asyncio.py b/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py index d714755a..930bb66f 100644 --- a/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py @@ -132,16 +132,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/vision_v1/services/product_search/client.py b/google/cloud/vision_v1/services/product_search/client.py index 4deda3c1..ece2329b 100644 --- a/google/cloud/vision_v1/services/product_search/client.py +++ b/google/cloud/vision_v1/services/product_search/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 @@ -412,7 +412,7 @@ def __init__( def create_product_set( self, - request: product_search_service.CreateProductSetRequest = None, + request: Union[product_search_service.CreateProductSetRequest, dict] = None, *, parent: str = None, product_set: product_search_service.ProductSet = None, @@ -429,7 +429,7 @@ def create_product_set( longer than 4096 characters. Args: - request (google.cloud.vision_v1.types.CreateProductSetRequest): + request (Union[google.cloud.vision_v1.types.CreateProductSetRequest, dict]): The request object. Request message for the `CreateProductSet` method. parent (str): @@ -514,7 +514,7 @@ def create_product_set( def list_product_sets( self, - request: product_search_service.ListProductSetsRequest = None, + request: Union[product_search_service.ListProductSetsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -529,7 +529,7 @@ def list_product_sets( less than 1. Args: - request (google.cloud.vision_v1.types.ListProductSetsRequest): + request (Union[google.cloud.vision_v1.types.ListProductSetsRequest, dict]): The request object. Request message for the `ListProductSets` method. parent (str): @@ -600,7 +600,7 @@ def list_product_sets( def get_product_set( self, - request: product_search_service.GetProductSetRequest = None, + request: Union[product_search_service.GetProductSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -614,7 +614,7 @@ def get_product_set( - Returns NOT_FOUND if the ProductSet does not exist. Args: - request (google.cloud.vision_v1.types.GetProductSetRequest): + request (Union[google.cloud.vision_v1.types.GetProductSetRequest, dict]): The request object. Request message for the `GetProductSet` method. name (str): @@ -680,7 +680,7 @@ def get_product_set( def update_product_set( self, - request: product_search_service.UpdateProductSetRequest = None, + request: Union[product_search_service.UpdateProductSetRequest, dict] = None, *, product_set: product_search_service.ProductSet = None, update_mask: field_mask_pb2.FieldMask = None, @@ -699,7 +699,7 @@ def update_product_set( characters. Args: - request (google.cloud.vision_v1.types.UpdateProductSetRequest): + request (Union[google.cloud.vision_v1.types.UpdateProductSetRequest, dict]): The request object. Request message for the `UpdateProductSet` method. product_set (google.cloud.vision_v1.types.ProductSet): @@ -776,7 +776,7 @@ def update_product_set( def delete_product_set( self, - request: product_search_service.DeleteProductSetRequest = None, + request: Union[product_search_service.DeleteProductSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -789,7 +789,7 @@ def delete_product_set( Storage. Args: - request (google.cloud.vision_v1.types.DeleteProductSetRequest): + request (Union[google.cloud.vision_v1.types.DeleteProductSetRequest, dict]): The request object. Request message for the `DeleteProductSet` method. name (str): @@ -845,7 +845,7 @@ def delete_product_set( def create_product( self, - request: product_search_service.CreateProductRequest = None, + request: Union[product_search_service.CreateProductRequest, dict] = None, *, parent: str = None, product: product_search_service.Product = None, @@ -866,7 +866,7 @@ def create_product( invalid. Args: - request (google.cloud.vision_v1.types.CreateProductRequest): + request (Union[google.cloud.vision_v1.types.CreateProductRequest, dict]): The request object. Request message for the `CreateProduct` method. parent (str): @@ -946,7 +946,7 @@ def create_product( def list_products( self, - request: product_search_service.ListProductsRequest = None, + request: Union[product_search_service.ListProductsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -961,7 +961,7 @@ def list_products( less than 1. Args: - request (google.cloud.vision_v1.types.ListProductsRequest): + request (Union[google.cloud.vision_v1.types.ListProductsRequest, dict]): The request object. Request message for the `ListProducts` method. parent (str): @@ -1032,7 +1032,7 @@ def list_products( def get_product( self, - request: product_search_service.GetProductRequest = None, + request: Union[product_search_service.GetProductRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1046,7 +1046,7 @@ def get_product( - Returns NOT_FOUND if the Product does not exist. Args: - request (google.cloud.vision_v1.types.GetProductRequest): + request (Union[google.cloud.vision_v1.types.GetProductRequest, dict]): The request object. Request message for the `GetProduct` method. name (str): @@ -1107,7 +1107,7 @@ def get_product( def update_product( self, - request: product_search_service.UpdateProductRequest = None, + request: Union[product_search_service.UpdateProductRequest, dict] = None, *, product: product_search_service.Product = None, update_mask: field_mask_pb2.FieldMask = None, @@ -1133,7 +1133,7 @@ def update_product( update_mask. Args: - request (google.cloud.vision_v1.types.UpdateProductRequest): + request (Union[google.cloud.vision_v1.types.UpdateProductRequest, dict]): The request object. Request message for the `UpdateProduct` method. product (google.cloud.vision_v1.types.Product): @@ -1207,7 +1207,7 @@ def update_product( def delete_product( self, - request: product_search_service.DeleteProductRequest = None, + request: Union[product_search_service.DeleteProductRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1222,7 +1222,7 @@ def delete_product( all related caches are refreshed. Args: - request (google.cloud.vision_v1.types.DeleteProductRequest): + request (Union[google.cloud.vision_v1.types.DeleteProductRequest, dict]): The request object. Request message for the `DeleteProduct` method. name (str): @@ -1278,7 +1278,7 @@ def delete_product( def create_reference_image( self, - request: product_search_service.CreateReferenceImageRequest = None, + request: Union[product_search_service.CreateReferenceImageRequest, dict] = None, *, parent: str = None, reference_image: product_search_service.ReferenceImage = None, @@ -1311,7 +1311,7 @@ def create_reference_image( 10 polygons. Args: - request (google.cloud.vision_v1.types.CreateReferenceImageRequest): + request (Union[google.cloud.vision_v1.types.CreateReferenceImageRequest, dict]): The request object. Request message for the `CreateReferenceImage` method. parent (str): @@ -1397,7 +1397,7 @@ def create_reference_image( def delete_reference_image( self, - request: product_search_service.DeleteReferenceImageRequest = None, + request: Union[product_search_service.DeleteReferenceImageRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1413,7 +1413,7 @@ def delete_reference_image( Storage. Args: - request (google.cloud.vision_v1.types.DeleteReferenceImageRequest): + request (Union[google.cloud.vision_v1.types.DeleteReferenceImageRequest, dict]): The request object. Request message for the `DeleteReferenceImage` method. name (str): @@ -1470,7 +1470,7 @@ def delete_reference_image( def list_reference_images( self, - request: product_search_service.ListReferenceImagesRequest = None, + request: Union[product_search_service.ListReferenceImagesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1486,7 +1486,7 @@ def list_reference_images( 100, or less than 1. Args: - request (google.cloud.vision_v1.types.ListReferenceImagesRequest): + request (Union[google.cloud.vision_v1.types.ListReferenceImagesRequest, dict]): The request object. Request message for the `ListReferenceImages` method. parent (str): @@ -1558,7 +1558,7 @@ def list_reference_images( def get_reference_image( self, - request: product_search_service.GetReferenceImageRequest = None, + request: Union[product_search_service.GetReferenceImageRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1572,7 +1572,7 @@ def get_reference_image( - Returns NOT_FOUND if the specified image does not exist. Args: - request (google.cloud.vision_v1.types.GetReferenceImageRequest): + request (Union[google.cloud.vision_v1.types.GetReferenceImageRequest, dict]): The request object. Request message for the `GetReferenceImage` method. name (str): @@ -1636,7 +1636,9 @@ def get_reference_image( def add_product_to_product_set( self, - request: product_search_service.AddProductToProductSetRequest = None, + request: Union[ + product_search_service.AddProductToProductSetRequest, dict + ] = None, *, name: str = None, product: str = None, @@ -1655,7 +1657,7 @@ def add_product_to_product_set( exist. Args: - request (google.cloud.vision_v1.types.AddProductToProductSetRequest): + request (Union[google.cloud.vision_v1.types.AddProductToProductSetRequest, dict]): The request object. Request message for the `AddProductToProductSet` method. name (str): @@ -1728,7 +1730,9 @@ def add_product_to_product_set( def remove_product_from_product_set( self, - request: product_search_service.RemoveProductFromProductSetRequest = None, + request: Union[ + product_search_service.RemoveProductFromProductSetRequest, dict + ] = None, *, name: str = None, product: str = None, @@ -1739,7 +1743,7 @@ def remove_product_from_product_set( r"""Removes a Product from the specified ProductSet. Args: - request (google.cloud.vision_v1.types.RemoveProductFromProductSetRequest): + request (Union[google.cloud.vision_v1.types.RemoveProductFromProductSetRequest, dict]): The request object. Request message for the `RemoveProductFromProductSet` method. name (str): @@ -1812,7 +1816,9 @@ def remove_product_from_product_set( def list_products_in_product_set( self, - request: product_search_service.ListProductsInProductSetRequest = None, + request: Union[ + product_search_service.ListProductsInProductSetRequest, dict + ] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1829,7 +1835,7 @@ def list_products_in_product_set( less than 1. Args: - request (google.cloud.vision_v1.types.ListProductsInProductSetRequest): + request (Union[google.cloud.vision_v1.types.ListProductsInProductSetRequest, dict]): The request object. Request message for the `ListProductsInProductSet` method. name (str): @@ -1906,7 +1912,7 @@ def list_products_in_product_set( def import_product_sets( self, - request: product_search_service.ImportProductSetsRequest = None, + request: Union[product_search_service.ImportProductSetsRequest, dict] = None, *, parent: str = None, input_config: product_search_service.ImportProductSetsInputConfig = None, @@ -1928,7 +1934,7 @@ def import_product_sets( [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]. Args: - request (google.cloud.vision_v1.types.ImportProductSetsRequest): + request (Union[google.cloud.vision_v1.types.ImportProductSetsRequest, dict]): The request object. Request message for the `ImportProductSets` method. parent (str): @@ -2017,7 +2023,7 @@ def import_product_sets( def purge_products( self, - request: product_search_service.PurgeProductsRequest = None, + request: Union[product_search_service.PurgeProductsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -2053,7 +2059,7 @@ def purge_products( ``BatchOperationMetadata``. (progress) Args: - request (google.cloud.vision_v1.types.PurgeProductsRequest): + request (Union[google.cloud.vision_v1.types.PurgeProductsRequest, dict]): The request object. Request message for the `PurgeProducts` method. parent (str): diff --git a/google/cloud/vision_v1/services/product_search/transports/base.py b/google/cloud/vision_v1/services/product_search/transports/base.py index 54fd1e03..a6ae5112 100644 --- a/google/cloud/vision_v1/services/product_search/transports/base.py +++ b/google/cloud/vision_v1/services/product_search/transports/base.py @@ -121,7 +121,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/vision_v1/services/product_search/transports/grpc.py b/google/cloud/vision_v1/services/product_search/transports/grpc.py index d7e03961..df926905 100644 --- a/google/cloud/vision_v1/services/product_search/transports/grpc.py +++ b/google/cloud/vision_v1/services/product_search/transports/grpc.py @@ -100,16 +100,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/vision_v1/services/product_search/transports/grpc_asyncio.py b/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py index 21a2ffec..95dcc826 100644 --- a/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py @@ -147,16 +147,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/vision_v1p1beta1/services/image_annotator/client.py b/google/cloud/vision_v1p1beta1/services/image_annotator/client.py index 5ba847a3..04025123 100644 --- a/google/cloud/vision_v1p1beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p1beta1/services/image_annotator/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 batch_annotate_images( self, - request: image_annotator.BatchAnnotateImagesRequest = None, + request: Union[image_annotator.BatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -350,7 +350,7 @@ def batch_annotate_images( images. Args: - request (google.cloud.vision_v1p1beta1.types.BatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1p1beta1.types.BatchAnnotateImagesRequest, dict]): The request object. Multiple image annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p1beta1.types.AnnotateImageRequest]): diff --git a/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py b/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py index 8350d48a..ddf9be8f 100644 --- a/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py +++ b/google/cloud/vision_v1p1beta1/services/image_annotator/transports/base.py @@ -118,7 +118,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/vision_v1p1beta1/services/image_annotator/transports/grpc.py b/google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc.py index cc29933e..564c52c2 100644 --- a/google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc.py +++ b/google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc.py @@ -83,16 +83,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/vision_v1p1beta1/services/image_annotator/transports/grpc_asyncio.py b/google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc_asyncio.py index d589e73f..f8b7c01b 100644 --- a/google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc_asyncio.py @@ -130,16 +130,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/vision_v1p2beta1/services/image_annotator/client.py b/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index d506f2d4..15ad8646 100644 --- a/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p2beta1/services/image_annotator/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 @@ -341,7 +341,7 @@ def __init__( def batch_annotate_images( self, - request: image_annotator.BatchAnnotateImagesRequest = None, + request: Union[image_annotator.BatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -352,7 +352,7 @@ def batch_annotate_images( images. Args: - request (google.cloud.vision_v1p2beta1.types.BatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1p2beta1.types.BatchAnnotateImagesRequest, dict]): The request object. Multiple image annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p2beta1.types.AnnotateImageRequest]): @@ -410,7 +410,7 @@ def batch_annotate_images( def async_batch_annotate_files( self, - request: image_annotator.AsyncBatchAnnotateFilesRequest = None, + request: Union[image_annotator.AsyncBatchAnnotateFilesRequest, dict] = None, *, requests: Sequence[image_annotator.AsyncAnnotateFileRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -426,7 +426,7 @@ def async_batch_annotate_files( ``AsyncBatchAnnotateFilesResponse`` (results). Args: - request (google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesRequest): + request (Union[google.cloud.vision_v1p2beta1.types.AsyncBatchAnnotateFilesRequest, dict]): The request object. Multiple async file annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p2beta1.types.AsyncAnnotateFileRequest]): diff --git a/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py b/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py index dae3630f..1b035ec6 100644 --- a/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py +++ b/google/cloud/vision_v1p2beta1/services/image_annotator/transports/base.py @@ -120,7 +120,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/vision_v1p2beta1/services/image_annotator/transports/grpc.py b/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py index 1d424381..f734a3c3 100644 --- a/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py +++ b/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py @@ -85,16 +85,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/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py b/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py index 4498dc31..c7de2e83 100644 --- a/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py @@ -132,16 +132,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/vision_v1p3beta1/services/image_annotator/client.py b/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index 06ac9041..1ac9894b 100644 --- a/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p3beta1/services/image_annotator/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 @@ -373,7 +373,7 @@ def __init__( def batch_annotate_images( self, - request: image_annotator.BatchAnnotateImagesRequest = None, + request: Union[image_annotator.BatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -384,7 +384,7 @@ def batch_annotate_images( images. Args: - request (google.cloud.vision_v1p3beta1.types.BatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1p3beta1.types.BatchAnnotateImagesRequest, dict]): The request object. Multiple image annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p3beta1.types.AnnotateImageRequest]): @@ -442,7 +442,7 @@ def batch_annotate_images( def async_batch_annotate_files( self, - request: image_annotator.AsyncBatchAnnotateFilesRequest = None, + request: Union[image_annotator.AsyncBatchAnnotateFilesRequest, dict] = None, *, requests: Sequence[image_annotator.AsyncAnnotateFileRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -458,7 +458,7 @@ def async_batch_annotate_files( ``AsyncBatchAnnotateFilesResponse`` (results). Args: - request (google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesRequest): + request (Union[google.cloud.vision_v1p3beta1.types.AsyncBatchAnnotateFilesRequest, dict]): The request object. Multiple async file annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p3beta1.types.AsyncAnnotateFileRequest]): diff --git a/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py b/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py index 175adb50..2d9866fc 100644 --- a/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py +++ b/google/cloud/vision_v1p3beta1/services/image_annotator/transports/base.py @@ -120,7 +120,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/vision_v1p3beta1/services/image_annotator/transports/grpc.py b/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py index fd9096b8..f017059c 100644 --- a/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py +++ b/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py @@ -85,16 +85,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/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py b/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py index 46e94b91..ad423c81 100644 --- a/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py @@ -132,16 +132,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/vision_v1p3beta1/services/product_search/client.py b/google/cloud/vision_v1p3beta1/services/product_search/client.py index 988f3a71..0e9e3a23 100644 --- a/google/cloud/vision_v1p3beta1/services/product_search/client.py +++ b/google/cloud/vision_v1p3beta1/services/product_search/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 @@ -413,7 +413,7 @@ def __init__( def create_product_set( self, - request: product_search_service.CreateProductSetRequest = None, + request: Union[product_search_service.CreateProductSetRequest, dict] = None, *, parent: str = None, product_set: product_search_service.ProductSet = None, @@ -430,7 +430,7 @@ def create_product_set( longer than 4096 characters. Args: - request (google.cloud.vision_v1p3beta1.types.CreateProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.CreateProductSetRequest, dict]): The request object. Request message for the `CreateProductSet` method. parent (str): @@ -515,7 +515,7 @@ def create_product_set( def list_product_sets( self, - request: product_search_service.ListProductSetsRequest = None, + request: Union[product_search_service.ListProductSetsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -530,7 +530,7 @@ def list_product_sets( less than 1. Args: - request (google.cloud.vision_v1p3beta1.types.ListProductSetsRequest): + request (Union[google.cloud.vision_v1p3beta1.types.ListProductSetsRequest, dict]): The request object. Request message for the `ListProductSets` method. parent (str): @@ -601,7 +601,7 @@ def list_product_sets( def get_product_set( self, - request: product_search_service.GetProductSetRequest = None, + request: Union[product_search_service.GetProductSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -615,7 +615,7 @@ def get_product_set( - Returns NOT_FOUND if the ProductSet does not exist. Args: - request (google.cloud.vision_v1p3beta1.types.GetProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.GetProductSetRequest, dict]): The request object. Request message for the `GetProductSet` method. name (str): @@ -681,7 +681,7 @@ def get_product_set( def update_product_set( self, - request: product_search_service.UpdateProductSetRequest = None, + request: Union[product_search_service.UpdateProductSetRequest, dict] = None, *, product_set: product_search_service.ProductSet = None, update_mask: field_mask_pb2.FieldMask = None, @@ -700,7 +700,7 @@ def update_product_set( characters. Args: - request (google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductSetRequest, dict]): The request object. Request message for the `UpdateProductSet` method. product_set (google.cloud.vision_v1p3beta1.types.ProductSet): @@ -777,7 +777,7 @@ def update_product_set( def delete_product_set( self, - request: product_search_service.DeleteProductSetRequest = None, + request: Union[product_search_service.DeleteProductSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -795,7 +795,7 @@ def delete_product_set( - Returns NOT_FOUND if the ProductSet does not exist. Args: - request (google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductSetRequest, dict]): The request object. Request message for the `DeleteProductSet` method. name (str): @@ -851,7 +851,7 @@ def delete_product_set( def create_product( self, - request: product_search_service.CreateProductRequest = None, + request: Union[product_search_service.CreateProductRequest, dict] = None, *, parent: str = None, product: product_search_service.Product = None, @@ -872,7 +872,7 @@ def create_product( invalid. Args: - request (google.cloud.vision_v1p3beta1.types.CreateProductRequest): + request (Union[google.cloud.vision_v1p3beta1.types.CreateProductRequest, dict]): The request object. Request message for the `CreateProduct` method. parent (str): @@ -952,7 +952,7 @@ def create_product( def list_products( self, - request: product_search_service.ListProductsRequest = None, + request: Union[product_search_service.ListProductsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -967,7 +967,7 @@ def list_products( less than 1. Args: - request (google.cloud.vision_v1p3beta1.types.ListProductsRequest): + request (Union[google.cloud.vision_v1p3beta1.types.ListProductsRequest, dict]): The request object. Request message for the `ListProducts` method. parent (str): @@ -1038,7 +1038,7 @@ def list_products( def get_product( self, - request: product_search_service.GetProductRequest = None, + request: Union[product_search_service.GetProductRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1052,7 +1052,7 @@ def get_product( - Returns NOT_FOUND if the Product does not exist. Args: - request (google.cloud.vision_v1p3beta1.types.GetProductRequest): + request (Union[google.cloud.vision_v1p3beta1.types.GetProductRequest, dict]): The request object. Request message for the `GetProduct` method. name (str): @@ -1113,7 +1113,7 @@ def get_product( def update_product( self, - request: product_search_service.UpdateProductRequest = None, + request: Union[product_search_service.UpdateProductRequest, dict] = None, *, product: product_search_service.Product = None, update_mask: field_mask_pb2.FieldMask = None, @@ -1139,7 +1139,7 @@ def update_product( update_mask. Args: - request (google.cloud.vision_v1p3beta1.types.UpdateProductRequest): + request (Union[google.cloud.vision_v1p3beta1.types.UpdateProductRequest, dict]): The request object. Request message for the `UpdateProduct` method. product (google.cloud.vision_v1p3beta1.types.Product): @@ -1213,7 +1213,7 @@ def update_product( def delete_product( self, - request: product_search_service.DeleteProductRequest = None, + request: Union[product_search_service.DeleteProductRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1231,7 +1231,7 @@ def delete_product( - Returns NOT_FOUND if the product does not exist. Args: - request (google.cloud.vision_v1p3beta1.types.DeleteProductRequest): + request (Union[google.cloud.vision_v1p3beta1.types.DeleteProductRequest, dict]): The request object. Request message for the `DeleteProduct` method. name (str): @@ -1287,7 +1287,7 @@ def delete_product( def create_reference_image( self, - request: product_search_service.CreateReferenceImageRequest = None, + request: Union[product_search_service.CreateReferenceImageRequest, dict] = None, *, parent: str = None, reference_image: product_search_service.ReferenceImage = None, @@ -1320,7 +1320,7 @@ def create_reference_image( 10 polygons. Args: - request (google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest): + request (Union[google.cloud.vision_v1p3beta1.types.CreateReferenceImageRequest, dict]): The request object. Request message for the `CreateReferenceImage` method. parent (str): @@ -1406,7 +1406,7 @@ def create_reference_image( def delete_reference_image( self, - request: product_search_service.DeleteReferenceImageRequest = None, + request: Union[product_search_service.DeleteReferenceImageRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1427,7 +1427,7 @@ def delete_reference_image( - Returns NOT_FOUND if the reference image does not exist. Args: - request (google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest): + request (Union[google.cloud.vision_v1p3beta1.types.DeleteReferenceImageRequest, dict]): The request object. Request message for the `DeleteReferenceImage` method. name (str): @@ -1485,7 +1485,7 @@ def delete_reference_image( def list_reference_images( self, - request: product_search_service.ListReferenceImagesRequest = None, + request: Union[product_search_service.ListReferenceImagesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1501,7 +1501,7 @@ def list_reference_images( 100, or less than 1. Args: - request (google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest): + request (Union[google.cloud.vision_v1p3beta1.types.ListReferenceImagesRequest, dict]): The request object. Request message for the `ListReferenceImages` method. parent (str): @@ -1573,7 +1573,7 @@ def list_reference_images( def get_reference_image( self, - request: product_search_service.GetReferenceImageRequest = None, + request: Union[product_search_service.GetReferenceImageRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1587,7 +1587,7 @@ def get_reference_image( - Returns NOT_FOUND if the specified image does not exist. Args: - request (google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest): + request (Union[google.cloud.vision_v1p3beta1.types.GetReferenceImageRequest, dict]): The request object. Request message for the `GetReferenceImage` method. name (str): @@ -1652,7 +1652,9 @@ def get_reference_image( def add_product_to_product_set( self, - request: product_search_service.AddProductToProductSetRequest = None, + request: Union[ + product_search_service.AddProductToProductSetRequest, dict + ] = None, *, name: str = None, product: str = None, @@ -1671,7 +1673,7 @@ def add_product_to_product_set( exist. Args: - request (google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.AddProductToProductSetRequest, dict]): The request object. Request message for the `AddProductToProductSet` method. name (str): @@ -1744,7 +1746,9 @@ def add_product_to_product_set( def remove_product_from_product_set( self, - request: product_search_service.RemoveProductFromProductSetRequest = None, + request: Union[ + product_search_service.RemoveProductFromProductSetRequest, dict + ] = None, *, name: str = None, product: str = None, @@ -1760,7 +1764,7 @@ def remove_product_from_product_set( ProductSet. Args: - request (google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.RemoveProductFromProductSetRequest, dict]): The request object. Request message for the `RemoveProductFromProductSet` method. name (str): @@ -1833,7 +1837,9 @@ def remove_product_from_product_set( def list_products_in_product_set( self, - request: product_search_service.ListProductsInProductSetRequest = None, + request: Union[ + product_search_service.ListProductsInProductSetRequest, dict + ] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1850,7 +1856,7 @@ def list_products_in_product_set( less than 1. Args: - request (google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest): + request (Union[google.cloud.vision_v1p3beta1.types.ListProductsInProductSetRequest, dict]): The request object. Request message for the `ListProductsInProductSet` method. name (str): @@ -1927,7 +1933,7 @@ def list_products_in_product_set( def import_product_sets( self, - request: product_search_service.ImportProductSetsRequest = None, + request: Union[product_search_service.ImportProductSetsRequest, dict] = None, *, parent: str = None, input_config: product_search_service.ImportProductSetsInputConfig = None, @@ -1949,7 +1955,7 @@ def import_product_sets( [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. Args: - request (google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest): + request (Union[google.cloud.vision_v1p3beta1.types.ImportProductSetsRequest, dict]): The request object. Request message for the `ImportProductSets` method. parent (str): diff --git a/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py b/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py index 27236a26..3a408858 100644 --- a/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py +++ b/google/cloud/vision_v1p3beta1/services/product_search/transports/base.py @@ -121,7 +121,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/vision_v1p3beta1/services/product_search/transports/grpc.py b/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py index 7e939f28..a048c268 100644 --- a/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py +++ b/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py @@ -102,16 +102,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/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py b/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py index 73d7d750..cd9326a6 100644 --- a/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py @@ -149,16 +149,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/vision_v1p4beta1/services/image_annotator/client.py b/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index e6ea5cf0..c55a79e6 100644 --- a/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p4beta1/services/image_annotator/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 @@ -373,7 +373,7 @@ def __init__( def batch_annotate_images( self, - request: image_annotator.BatchAnnotateImagesRequest = None, + request: Union[image_annotator.BatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -384,7 +384,7 @@ def batch_annotate_images( images. Args: - request (google.cloud.vision_v1p4beta1.types.BatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1p4beta1.types.BatchAnnotateImagesRequest, dict]): The request object. Multiple image annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p4beta1.types.AnnotateImageRequest]): @@ -442,7 +442,7 @@ def batch_annotate_images( def batch_annotate_files( self, - request: image_annotator.BatchAnnotateFilesRequest = None, + request: Union[image_annotator.BatchAnnotateFilesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateFileRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -459,7 +459,7 @@ def batch_annotate_files( extracted. Args: - request (google.cloud.vision_v1p4beta1.types.BatchAnnotateFilesRequest): + request (Union[google.cloud.vision_v1p4beta1.types.BatchAnnotateFilesRequest, dict]): The request object. A list of requests to annotate files using the BatchAnnotateFiles API. requests (Sequence[google.cloud.vision_v1p4beta1.types.AnnotateFileRequest]): @@ -517,7 +517,7 @@ def batch_annotate_files( def async_batch_annotate_images( self, - request: image_annotator.AsyncBatchAnnotateImagesRequest = None, + request: Union[image_annotator.AsyncBatchAnnotateImagesRequest, dict] = None, *, requests: Sequence[image_annotator.AnnotateImageRequest] = None, output_config: image_annotator.OutputConfig = None, @@ -539,7 +539,7 @@ def async_batch_annotate_images( BatchAnnotateImagesResponse proto. Args: - request (google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesRequest): + request (Union[google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateImagesRequest, dict]): The request object. Request for async image annotation for a list of images. requests (Sequence[google.cloud.vision_v1p4beta1.types.AnnotateImageRequest]): @@ -619,7 +619,7 @@ def async_batch_annotate_images( def async_batch_annotate_files( self, - request: image_annotator.AsyncBatchAnnotateFilesRequest = None, + request: Union[image_annotator.AsyncBatchAnnotateFilesRequest, dict] = None, *, requests: Sequence[image_annotator.AsyncAnnotateFileRequest] = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -635,7 +635,7 @@ def async_batch_annotate_files( ``AsyncBatchAnnotateFilesResponse`` (results). Args: - request (google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesRequest): + request (Union[google.cloud.vision_v1p4beta1.types.AsyncBatchAnnotateFilesRequest, dict]): The request object. Multiple async file annotation requests are batched into a single service call. requests (Sequence[google.cloud.vision_v1p4beta1.types.AsyncAnnotateFileRequest]): diff --git a/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py b/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py index 7856f3a7..77795b1e 100644 --- a/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py +++ b/google/cloud/vision_v1p4beta1/services/image_annotator/transports/base.py @@ -120,7 +120,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/vision_v1p4beta1/services/image_annotator/transports/grpc.py b/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py index 50705cfe..2552c528 100644 --- a/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py +++ b/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py @@ -85,16 +85,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/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py b/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py index b36093d2..e9a08482 100644 --- a/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py @@ -132,16 +132,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/vision_v1p4beta1/services/product_search/client.py b/google/cloud/vision_v1p4beta1/services/product_search/client.py index 81373163..d49f5449 100644 --- a/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/google/cloud/vision_v1p4beta1/services/product_search/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 @@ -414,7 +414,7 @@ def __init__( def create_product_set( self, - request: product_search_service.CreateProductSetRequest = None, + request: Union[product_search_service.CreateProductSetRequest, dict] = None, *, parent: str = None, product_set: product_search_service.ProductSet = None, @@ -431,7 +431,7 @@ def create_product_set( longer than 4096 characters. Args: - request (google.cloud.vision_v1p4beta1.types.CreateProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.CreateProductSetRequest, dict]): The request object. Request message for the `CreateProductSet` method. parent (str): @@ -516,7 +516,7 @@ def create_product_set( def list_product_sets( self, - request: product_search_service.ListProductSetsRequest = None, + request: Union[product_search_service.ListProductSetsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -531,7 +531,7 @@ def list_product_sets( less than 1. Args: - request (google.cloud.vision_v1p4beta1.types.ListProductSetsRequest): + request (Union[google.cloud.vision_v1p4beta1.types.ListProductSetsRequest, dict]): The request object. Request message for the `ListProductSets` method. parent (str): @@ -602,7 +602,7 @@ def list_product_sets( def get_product_set( self, - request: product_search_service.GetProductSetRequest = None, + request: Union[product_search_service.GetProductSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -616,7 +616,7 @@ def get_product_set( - Returns NOT_FOUND if the ProductSet does not exist. Args: - request (google.cloud.vision_v1p4beta1.types.GetProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.GetProductSetRequest, dict]): The request object. Request message for the `GetProductSet` method. name (str): @@ -682,7 +682,7 @@ def get_product_set( def update_product_set( self, - request: product_search_service.UpdateProductSetRequest = None, + request: Union[product_search_service.UpdateProductSetRequest, dict] = None, *, product_set: product_search_service.ProductSet = None, update_mask: field_mask_pb2.FieldMask = None, @@ -701,7 +701,7 @@ def update_product_set( characters. Args: - request (google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductSetRequest, dict]): The request object. Request message for the `UpdateProductSet` method. product_set (google.cloud.vision_v1p4beta1.types.ProductSet): @@ -778,7 +778,7 @@ def update_product_set( def delete_product_set( self, - request: product_search_service.DeleteProductSetRequest = None, + request: Union[product_search_service.DeleteProductSetRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -791,7 +791,7 @@ def delete_product_set( Storage. Args: - request (google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductSetRequest, dict]): The request object. Request message for the `DeleteProductSet` method. name (str): @@ -847,7 +847,7 @@ def delete_product_set( def create_product( self, - request: product_search_service.CreateProductRequest = None, + request: Union[product_search_service.CreateProductRequest, dict] = None, *, parent: str = None, product: product_search_service.Product = None, @@ -868,7 +868,7 @@ def create_product( invalid. Args: - request (google.cloud.vision_v1p4beta1.types.CreateProductRequest): + request (Union[google.cloud.vision_v1p4beta1.types.CreateProductRequest, dict]): The request object. Request message for the `CreateProduct` method. parent (str): @@ -948,7 +948,7 @@ def create_product( def list_products( self, - request: product_search_service.ListProductsRequest = None, + request: Union[product_search_service.ListProductsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -963,7 +963,7 @@ def list_products( less than 1. Args: - request (google.cloud.vision_v1p4beta1.types.ListProductsRequest): + request (Union[google.cloud.vision_v1p4beta1.types.ListProductsRequest, dict]): The request object. Request message for the `ListProducts` method. parent (str): @@ -1034,7 +1034,7 @@ def list_products( def get_product( self, - request: product_search_service.GetProductRequest = None, + request: Union[product_search_service.GetProductRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1048,7 +1048,7 @@ def get_product( - Returns NOT_FOUND if the Product does not exist. Args: - request (google.cloud.vision_v1p4beta1.types.GetProductRequest): + request (Union[google.cloud.vision_v1p4beta1.types.GetProductRequest, dict]): The request object. Request message for the `GetProduct` method. name (str): @@ -1109,7 +1109,7 @@ def get_product( def update_product( self, - request: product_search_service.UpdateProductRequest = None, + request: Union[product_search_service.UpdateProductRequest, dict] = None, *, product: product_search_service.Product = None, update_mask: field_mask_pb2.FieldMask = None, @@ -1135,7 +1135,7 @@ def update_product( update_mask. Args: - request (google.cloud.vision_v1p4beta1.types.UpdateProductRequest): + request (Union[google.cloud.vision_v1p4beta1.types.UpdateProductRequest, dict]): The request object. Request message for the `UpdateProduct` method. product (google.cloud.vision_v1p4beta1.types.Product): @@ -1209,7 +1209,7 @@ def update_product( def delete_product( self, - request: product_search_service.DeleteProductRequest = None, + request: Union[product_search_service.DeleteProductRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1224,7 +1224,7 @@ def delete_product( all related caches are refreshed. Args: - request (google.cloud.vision_v1p4beta1.types.DeleteProductRequest): + request (Union[google.cloud.vision_v1p4beta1.types.DeleteProductRequest, dict]): The request object. Request message for the `DeleteProduct` method. name (str): @@ -1280,7 +1280,7 @@ def delete_product( def create_reference_image( self, - request: product_search_service.CreateReferenceImageRequest = None, + request: Union[product_search_service.CreateReferenceImageRequest, dict] = None, *, parent: str = None, reference_image: product_search_service.ReferenceImage = None, @@ -1313,7 +1313,7 @@ def create_reference_image( 10 polygons. Args: - request (google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest): + request (Union[google.cloud.vision_v1p4beta1.types.CreateReferenceImageRequest, dict]): The request object. Request message for the `CreateReferenceImage` method. parent (str): @@ -1399,7 +1399,7 @@ def create_reference_image( def delete_reference_image( self, - request: product_search_service.DeleteReferenceImageRequest = None, + request: Union[product_search_service.DeleteReferenceImageRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1415,7 +1415,7 @@ def delete_reference_image( Storage. Args: - request (google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest): + request (Union[google.cloud.vision_v1p4beta1.types.DeleteReferenceImageRequest, dict]): The request object. Request message for the `DeleteReferenceImage` method. name (str): @@ -1473,7 +1473,7 @@ def delete_reference_image( def list_reference_images( self, - request: product_search_service.ListReferenceImagesRequest = None, + request: Union[product_search_service.ListReferenceImagesRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1489,7 +1489,7 @@ def list_reference_images( 100, or less than 1. Args: - request (google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest): + request (Union[google.cloud.vision_v1p4beta1.types.ListReferenceImagesRequest, dict]): The request object. Request message for the `ListReferenceImages` method. parent (str): @@ -1561,7 +1561,7 @@ def list_reference_images( def get_reference_image( self, - request: product_search_service.GetReferenceImageRequest = None, + request: Union[product_search_service.GetReferenceImageRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1575,7 +1575,7 @@ def get_reference_image( - Returns NOT_FOUND if the specified image does not exist. Args: - request (google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest): + request (Union[google.cloud.vision_v1p4beta1.types.GetReferenceImageRequest, dict]): The request object. Request message for the `GetReferenceImage` method. name (str): @@ -1640,7 +1640,9 @@ def get_reference_image( def add_product_to_product_set( self, - request: product_search_service.AddProductToProductSetRequest = None, + request: Union[ + product_search_service.AddProductToProductSetRequest, dict + ] = None, *, name: str = None, product: str = None, @@ -1659,7 +1661,7 @@ def add_product_to_product_set( exist. Args: - request (google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.AddProductToProductSetRequest, dict]): The request object. Request message for the `AddProductToProductSet` method. name (str): @@ -1732,7 +1734,9 @@ def add_product_to_product_set( def remove_product_from_product_set( self, - request: product_search_service.RemoveProductFromProductSetRequest = None, + request: Union[ + product_search_service.RemoveProductFromProductSetRequest, dict + ] = None, *, name: str = None, product: str = None, @@ -1743,7 +1747,7 @@ def remove_product_from_product_set( r"""Removes a Product from the specified ProductSet. Args: - request (google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.RemoveProductFromProductSetRequest, dict]): The request object. Request message for the `RemoveProductFromProductSet` method. name (str): @@ -1816,7 +1820,9 @@ def remove_product_from_product_set( def list_products_in_product_set( self, - request: product_search_service.ListProductsInProductSetRequest = None, + request: Union[ + product_search_service.ListProductsInProductSetRequest, dict + ] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1833,7 +1839,7 @@ def list_products_in_product_set( less than 1. Args: - request (google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest): + request (Union[google.cloud.vision_v1p4beta1.types.ListProductsInProductSetRequest, dict]): The request object. Request message for the `ListProductsInProductSet` method. name (str): @@ -1910,7 +1916,7 @@ def list_products_in_product_set( def import_product_sets( self, - request: product_search_service.ImportProductSetsRequest = None, + request: Union[product_search_service.ImportProductSetsRequest, dict] = None, *, parent: str = None, input_config: product_search_service.ImportProductSetsInputConfig = None, @@ -1932,7 +1938,7 @@ def import_product_sets( [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. Args: - request (google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest): + request (Union[google.cloud.vision_v1p4beta1.types.ImportProductSetsRequest, dict]): The request object. Request message for the `ImportProductSets` method. parent (str): @@ -2021,7 +2027,7 @@ def import_product_sets( def purge_products( self, - request: product_search_service.PurgeProductsRequest = None, + request: Union[product_search_service.PurgeProductsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -2057,7 +2063,7 @@ def purge_products( ``BatchOperationMetadata``. (progress) Args: - request (google.cloud.vision_v1p4beta1.types.PurgeProductsRequest): + request (Union[google.cloud.vision_v1p4beta1.types.PurgeProductsRequest, dict]): The request object. Request message for the `PurgeProducts` method. parent (str): diff --git a/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py b/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py index ca8b67fc..306075e1 100644 --- a/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py +++ b/google/cloud/vision_v1p4beta1/services/product_search/transports/base.py @@ -121,7 +121,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/vision_v1p4beta1/services/product_search/transports/grpc.py b/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py index 53faa56c..2d593894 100644 --- a/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py +++ b/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py @@ -102,16 +102,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/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py b/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py index 53ec0340..78cb7f81 100644 --- a/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py +++ b/google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py @@ -149,16 +149,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/noxfile.py b/noxfile.py index 7d7db4ef..710271bb 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/renovate.json b/renovate.json index c0489556..c21036d3 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,9 @@ { "extends": [ - "config:base", ":preserveSemverRanges" + "config:base", + "group:all", + ":preserveSemverRanges", + ":disableDependencyDashboard" ], "ignorePaths": [".pre-commit-config.yaml"], "pip_requirements": { diff --git a/samples/snippets/crop_hints/noxfile.py b/samples/snippets/crop_hints/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/crop_hints/noxfile.py +++ b/samples/snippets/crop_hints/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/crop_hints/requirements-test.txt b/samples/snippets/crop_hints/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/snippets/crop_hints/requirements-test.txt +++ b/samples/snippets/crop_hints/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/snippets/crop_hints/requirements.txt b/samples/snippets/crop_hints/requirements.txt index 225430b7..465cb09b 100644 --- a/samples/snippets/crop_hints/requirements.txt +++ b/samples/snippets/crop_hints/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.4.1 -pillow==8.3.1 +google-cloud-vision==2.4.2 +pillow==8.3.2 diff --git a/samples/snippets/detect/noxfile.py b/samples/snippets/detect/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/detect/noxfile.py +++ b/samples/snippets/detect/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/detect/requirements-test.txt b/samples/snippets/detect/requirements-test.txt index f5d9e108..29fa8f9f 100644 --- a/samples/snippets/detect/requirements-test.txt +++ b/samples/snippets/detect/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/snippets/detect/requirements.txt b/samples/snippets/detect/requirements.txt index 4260d73b..aaa62d77 100644 --- a/samples/snippets/detect/requirements.txt +++ b/samples/snippets/detect/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.4.1 -google-cloud-storage==1.41.1 +google-cloud-vision==2.4.2 +google-cloud-storage==1.42.2 diff --git a/samples/snippets/document_text/noxfile.py b/samples/snippets/document_text/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/document_text/noxfile.py +++ b/samples/snippets/document_text/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/document_text/requirements-test.txt b/samples/snippets/document_text/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/snippets/document_text/requirements-test.txt +++ b/samples/snippets/document_text/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/snippets/document_text/requirements.txt b/samples/snippets/document_text/requirements.txt index 225430b7..465cb09b 100644 --- a/samples/snippets/document_text/requirements.txt +++ b/samples/snippets/document_text/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.4.1 -pillow==8.3.1 +google-cloud-vision==2.4.2 +pillow==8.3.2 diff --git a/samples/snippets/face_detection/noxfile.py b/samples/snippets/face_detection/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/face_detection/noxfile.py +++ b/samples/snippets/face_detection/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/face_detection/requirements-test.txt b/samples/snippets/face_detection/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/snippets/face_detection/requirements-test.txt +++ b/samples/snippets/face_detection/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/snippets/face_detection/requirements.txt b/samples/snippets/face_detection/requirements.txt index 225430b7..465cb09b 100644 --- a/samples/snippets/face_detection/requirements.txt +++ b/samples/snippets/face_detection/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.4.1 -pillow==8.3.1 +google-cloud-vision==2.4.2 +pillow==8.3.2 diff --git a/samples/snippets/product_search/noxfile.py b/samples/snippets/product_search/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/product_search/noxfile.py +++ b/samples/snippets/product_search/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/product_search/requirements-test.txt b/samples/snippets/product_search/requirements-test.txt index eb03b265..627baf98 100644 --- a/samples/snippets/product_search/requirements-test.txt +++ b/samples/snippets/product_search/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==6.2.4 +pytest==6.2.5 flaky==3.7.0 \ No newline at end of file diff --git a/samples/snippets/product_search/requirements.txt b/samples/snippets/product_search/requirements.txt index 4260d73b..aaa62d77 100644 --- a/samples/snippets/product_search/requirements.txt +++ b/samples/snippets/product_search/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.4.1 -google-cloud-storage==1.41.1 +google-cloud-vision==2.4.2 +google-cloud-storage==1.42.2 diff --git a/samples/snippets/quickstart/noxfile.py b/samples/snippets/quickstart/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/quickstart/noxfile.py +++ b/samples/snippets/quickstart/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/quickstart/requirements-test.txt b/samples/snippets/quickstart/requirements-test.txt index 95ea1e6a..92709451 100644 --- a/samples/snippets/quickstart/requirements-test.txt +++ b/samples/snippets/quickstart/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/snippets/quickstart/requirements.txt b/samples/snippets/quickstart/requirements.txt index 95ca9c47..794bfb61 100644 --- a/samples/snippets/quickstart/requirements.txt +++ b/samples/snippets/quickstart/requirements.txt @@ -1 +1 @@ -google-cloud-vision==2.4.1 +google-cloud-vision==2.4.2 diff --git a/samples/snippets/web/noxfile.py b/samples/snippets/web/noxfile.py index 6a8ccdae..b008613f 100644 --- a/samples/snippets/web/noxfile.py +++ b/samples/snippets/web/noxfile.py @@ -39,17 +39,15 @@ 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 - '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,25 +76,28 @@ 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 # 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'] +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 = 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 # @@ -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/snippets/web/requirements-test.txt b/samples/snippets/web/requirements-test.txt index 6efe8ab4..4b863b85 100644 --- a/samples/snippets/web/requirements-test.txt +++ b/samples/snippets/web/requirements-test.txt @@ -1,2 +1,2 @@ flaky==3.7.0 -pytest==6.2.4 +pytest==6.2.5 diff --git a/samples/snippets/web/requirements.txt b/samples/snippets/web/requirements.txt index 95ca9c47..794bfb61 100644 --- a/samples/snippets/web/requirements.txt +++ b/samples/snippets/web/requirements.txt @@ -1 +1 @@ -google-cloud-vision==2.4.1 +google-cloud-vision==2.4.2 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 diff --git a/setup.py b/setup.py index 78c8653d..eb3e2a87 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ name = "google-cloud-vision" description = "Cloud Vision API API client library" -version = "2.4.2" +version = "2.4.3" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ # NOTE: Maintainers, please do not require google-api-core>=2.x.x