Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-google-cloud-speech for openSUSE:Factory checked in at 2022-09-13 15:10:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-google-cloud-speech (Old) and /work/SRC/openSUSE:Factory/.python-google-cloud-speech.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-google-cloud-speech" Tue Sep 13 15:10:04 2022 rev:9 rq:1003292 version:2.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-google-cloud-speech/python-google-cloud-speech.changes 2022-06-10 15:57:55.136848559 +0200 +++ /work/SRC/openSUSE:Factory/.python-google-cloud-speech.new.2083/python-google-cloud-speech.changes 2022-09-13 15:11:30.056999340 +0200 @@ -1,0 +2,12 @@ +Tue Sep 13 09:29:35 UTC 2022 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to 2.15.1 + * **deps:** allow protobuf < 5.0.0 (#425) + * **deps:** require proto-plus >= 1.22.0 (1ad5df9) +- from version 2.15.0 + * add audience parameter (068f8e8) + * **deps:** require google-api-core>=1.32.0,>=2.8.0 (#416) + * require python 3.7+ (#414) +- Update BuildRequires and Requires from setup.py + +------------------------------------------------------------------- Old: ---- google-cloud-speech-2.14.1.tar.gz New: ---- google-cloud-speech-2.15.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-google-cloud-speech.spec ++++++ --- /var/tmp/diff_new_pack.eXQlGS/_old 2022-09-13 15:11:30.429000387 +0200 +++ /var/tmp/diff_new_pack.eXQlGS/_new 2022-09-13 15:11:30.433000398 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-google-cloud-speech -Version: 2.14.1 +Version: 2.15.1 Release: 0 Summary: Google Cloud Speech API client library License: Apache-2.0 @@ -27,15 +27,17 @@ Source: https://files.pythonhosted.org/packages/source/g/google-cloud-speech/google-cloud-speech-%{version}.tar.gz # https://github.com/googleapis/python-speech/issues/406 Patch0: python-google-cloud-speech-no-mock.patch -BuildRequires: %{python_module google-api-core >= 1.31.5} -BuildRequires: %{python_module proto-plus >= 1.15.0} +BuildRequires: %{python_module google-api-core >= 1.32.0} +BuildRequires: %{python_module proto-plus >= 1.22.0} +BuildRequires: %{python_module protobuf >= 3.19.0} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-google-api-core >= 1.31.5 -Requires: python-proto-plus >= 1.15.0 +Requires: python-google-api-core >= 1.32.0 +Requires: python-proto-plus >= 1.22.0 +Requires: python-protobuf >= 3.19.0 BuildArch: noarch %python_subpackages ++++++ google-cloud-speech-2.14.1.tar.gz -> google-cloud-speech-2.15.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/PKG-INFO new/google-cloud-speech-2.15.1/PKG-INFO --- old/google-cloud-speech-2.14.1/PKG-INFO 2022-06-07 13:14:21.544543000 +0200 +++ new/google-cloud-speech-2.15.1/PKG-INFO 2022-08-15 16:28:43.003444000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-cloud-speech -Version: 2.14.1 +Version: 2.15.1 Summary: Google Cloud Speech API client library Home-page: https://github.com/googleapis/python-speech Author: Google LLC @@ -12,39 +12,35 @@ Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Operating System :: OS Independent Classifier: Topic :: Internet -Requires-Python: >=3.6 +Requires-Python: >=3.7 Provides-Extra: libcst License-File: LICENSE Python Client for Cloud Speech API ================================== +|stable| |pypi| |versions| -|GA| |pypi| |versions| - -The `Cloud Speech API`_ enables developers to convert audio to text by applying -powerful neural network models. The API recognizes over 80 languages and -variants, to support your global user base. +`Cloud Speech API`_: enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service. - `Client Library Documentation`_ - `Product Documentation`_ -.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability +.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-speech.svg :target: https://pypi.org/project/google-cloud-speech/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-speech.svg :target: https://pypi.org/project/google-cloud-speech/ -.. _Cloud Speech API: https://cloud.google.com/speech +.. _Cloud Speech API: https://cloud.google.com/speech-to-text/docs/ .. _Client Library Documentation: https://cloud.google.com/python/docs/reference/speech/latest -.. _Product Documentation: https://cloud.google.com/speech +.. _Product Documentation: https://cloud.google.com/speech-to-text/docs/ Quick Start ----------- @@ -58,7 +54,7 @@ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Speech API.: https://cloud.google.com/speech +.. _Enable the Cloud Speech API.: https://cloud.google.com/speech-to-text/docs/ .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -75,14 +71,30 @@ .. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ +Code samples and snippets +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Code samples and snippets live in the `samples/` folder. + + Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches +Unsupported Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Python <= 3.6 + +If you are using an `end-of-life`_ +version of Python, we recommend that you update as soon as possible to an actively supported version. + +.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches Mac/Linux ^^^^^^^^^ @@ -105,12 +117,15 @@ <your-env>\Scripts\activate <your-env>\Scripts\pip.exe install google-cloud-speech - Next Steps ~~~~~~~~~~ - Read the `Client Library Documentation`_ for Cloud Speech API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn + to see other available methods on the client. +- Read the `Cloud Speech API Product documentation`_ to learn more about the product and see How-to Guides. +- View this `README`_ to see the full list of Cloud APIs that we cover. + +.. _Cloud Speech API Product documentation: https://cloud.google.com/speech-to-text/docs/ +.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/README.rst new/google-cloud-speech-2.15.1/README.rst --- old/google-cloud-speech-2.14.1/README.rst 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/README.rst 2022-08-15 16:25:59.000000000 +0200 @@ -1,25 +1,22 @@ Python Client for Cloud Speech API ================================== +|stable| |pypi| |versions| -|GA| |pypi| |versions| - -The `Cloud Speech API`_ enables developers to convert audio to text by applying -powerful neural network models. The API recognizes over 80 languages and -variants, to support your global user base. +`Cloud Speech API`_: enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service. - `Client Library Documentation`_ - `Product Documentation`_ -.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability +.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-speech.svg :target: https://pypi.org/project/google-cloud-speech/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-speech.svg :target: https://pypi.org/project/google-cloud-speech/ -.. _Cloud Speech API: https://cloud.google.com/speech +.. _Cloud Speech API: https://cloud.google.com/speech-to-text/docs/ .. _Client Library Documentation: https://cloud.google.com/python/docs/reference/speech/latest -.. _Product Documentation: https://cloud.google.com/speech +.. _Product Documentation: https://cloud.google.com/speech-to-text/docs/ Quick Start ----------- @@ -33,7 +30,7 @@ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Speech API.: https://cloud.google.com/speech +.. _Enable the Cloud Speech API.: https://cloud.google.com/speech-to-text/docs/ .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -50,14 +47,30 @@ .. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ +Code samples and snippets +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Code samples and snippets live in the `samples/` folder. + + Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches +Unsupported Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Python <= 3.6 + +If you are using an `end-of-life`_ +version of Python, we recommend that you update as soon as possible to an actively supported version. + +.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches Mac/Linux ^^^^^^^^^ @@ -80,12 +93,15 @@ <your-env>\Scripts\activate <your-env>\Scripts\pip.exe install google-cloud-speech - Next Steps ~~~~~~~~~~ - Read the `Client Library Documentation`_ for Cloud Speech API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn + to see other available methods on the client. +- Read the `Cloud Speech API Product documentation`_ to learn more about the product and see How-to Guides. +- View this `README`_ to see the full list of Cloud APIs that we cover. + +.. _Cloud Speech API Product documentation: https://cloud.google.com/speech-to-text/docs/ +.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/client.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/client.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/client.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/client.py 2022-08-15 16:25:59.000000000 +0200 @@ -446,6 +446,7 @@ quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def create_phrase_set( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/transports/base.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/transports/base.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/transports/base.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/transports/base.py 2022-08-15 16:25:59.000000000 +0200 @@ -56,6 +56,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -83,11 +84,6 @@ be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -108,6 +104,11 @@ credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -120,6 +121,11 @@ # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/transports/grpc.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/transports/grpc.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/transports/grpc.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/transports/grpc.py 2022-08-15 16:25:59.000000000 +0200 @@ -60,6 +60,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -155,6 +156,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/transports/grpc_asyncio.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/transports/grpc_asyncio.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/adaptation/transports/grpc_asyncio.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/adaptation/transports/grpc_asyncio.py 2022-08-15 16:25:59.000000000 +0200 @@ -105,6 +105,7 @@ quota_project_id=None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -200,6 +201,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/client.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/client.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/client.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/client.py 2022-08-15 16:25:59.000000000 +0200 @@ -457,6 +457,7 @@ quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def recognize( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/transports/base.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/transports/base.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/transports/base.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/transports/base.py 2022-08-15 16:25:59.000000000 +0200 @@ -56,6 +56,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -83,11 +84,6 @@ be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -108,6 +104,11 @@ credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -120,6 +121,11 @@ # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/transports/grpc.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/transports/grpc.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/transports/grpc.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/transports/grpc.py 2022-08-15 16:25:59.000000000 +0200 @@ -60,6 +60,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -156,6 +157,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py 2022-08-15 16:25:59.000000000 +0200 @@ -105,6 +105,7 @@ quota_project_id=None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -201,6 +202,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/client.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/client.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/client.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/client.py 2022-08-15 16:25:59.000000000 +0200 @@ -446,6 +446,7 @@ quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def create_phrase_set( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py 2022-08-15 16:25:59.000000000 +0200 @@ -56,6 +56,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -83,11 +84,6 @@ be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -108,6 +104,11 @@ credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -120,6 +121,11 @@ # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py 2022-08-15 16:25:59.000000000 +0200 @@ -60,6 +60,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -155,6 +156,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc_asyncio.py 2022-08-15 16:25:59.000000000 +0200 @@ -105,6 +105,7 @@ quota_project_id=None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -200,6 +201,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/client.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/client.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/client.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/client.py 2022-08-15 16:25:59.000000000 +0200 @@ -457,6 +457,7 @@ quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def recognize( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/transports/base.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/transports/base.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/transports/base.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/transports/base.py 2022-08-15 16:25:59.000000000 +0200 @@ -56,6 +56,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -83,11 +84,6 @@ be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -108,6 +104,11 @@ credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -120,6 +121,11 @@ # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc.py 2022-08-15 16:25:59.000000000 +0200 @@ -60,6 +60,7 @@ quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -156,6 +157,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py --- old/google-cloud-speech-2.14.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google/cloud/speech_v1p1beta1/services/speech/transports/grpc_asyncio.py 2022-08-15 16:25:59.000000000 +0200 @@ -105,6 +105,7 @@ quota_project_id=None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -201,6 +202,7 @@ quota_project_id=quota_project_id, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) if not self._grpc_channel: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google_cloud_speech.egg-info/PKG-INFO new/google-cloud-speech-2.15.1/google_cloud_speech.egg-info/PKG-INFO --- old/google-cloud-speech-2.14.1/google_cloud_speech.egg-info/PKG-INFO 2022-06-07 13:14:20.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google_cloud_speech.egg-info/PKG-INFO 2022-08-15 16:28:42.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-cloud-speech -Version: 2.14.1 +Version: 2.15.1 Summary: Google Cloud Speech API client library Home-page: https://github.com/googleapis/python-speech Author: Google LLC @@ -12,39 +12,35 @@ Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Operating System :: OS Independent Classifier: Topic :: Internet -Requires-Python: >=3.6 +Requires-Python: >=3.7 Provides-Extra: libcst License-File: LICENSE Python Client for Cloud Speech API ================================== +|stable| |pypi| |versions| -|GA| |pypi| |versions| - -The `Cloud Speech API`_ enables developers to convert audio to text by applying -powerful neural network models. The API recognizes over 80 languages and -variants, to support your global user base. +`Cloud Speech API`_: enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service. - `Client Library Documentation`_ - `Product Documentation`_ -.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability +.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-speech.svg :target: https://pypi.org/project/google-cloud-speech/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-speech.svg :target: https://pypi.org/project/google-cloud-speech/ -.. _Cloud Speech API: https://cloud.google.com/speech +.. _Cloud Speech API: https://cloud.google.com/speech-to-text/docs/ .. _Client Library Documentation: https://cloud.google.com/python/docs/reference/speech/latest -.. _Product Documentation: https://cloud.google.com/speech +.. _Product Documentation: https://cloud.google.com/speech-to-text/docs/ Quick Start ----------- @@ -58,7 +54,7 @@ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Speech API.: https://cloud.google.com/speech +.. _Enable the Cloud Speech API.: https://cloud.google.com/speech-to-text/docs/ .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -75,14 +71,30 @@ .. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ +Code samples and snippets +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Code samples and snippets live in the `samples/` folder. + + Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches +Unsupported Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Python <= 3.6 + +If you are using an `end-of-life`_ +version of Python, we recommend that you update as soon as possible to an actively supported version. + +.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches Mac/Linux ^^^^^^^^^ @@ -105,12 +117,15 @@ <your-env>\Scripts\activate <your-env>\Scripts\pip.exe install google-cloud-speech - Next Steps ~~~~~~~~~~ - Read the `Client Library Documentation`_ for Cloud Speech API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn + to see other available methods on the client. +- Read the `Cloud Speech API Product documentation`_ to learn more about the product and see How-to Guides. +- View this `README`_ to see the full list of Cloud APIs that we cover. + +.. _Cloud Speech API Product documentation: https://cloud.google.com/speech-to-text/docs/ +.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/google_cloud_speech.egg-info/requires.txt new/google-cloud-speech-2.15.1/google_cloud_speech.egg-info/requires.txt --- old/google-cloud-speech-2.14.1/google_cloud_speech.egg-info/requires.txt 2022-06-07 13:14:21.000000000 +0200 +++ new/google-cloud-speech-2.15.1/google_cloud_speech.egg-info/requires.txt 2022-08-15 16:28:42.000000000 +0200 @@ -1,6 +1,6 @@ -google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5 -proto-plus<2.0.0dev,>=1.15.0 -protobuf<4.0.0dev,>=3.19.0 +google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,<3.0.0dev,>=1.32.0 +proto-plus<2.0.0dev,>=1.22.0 +protobuf<5.0.0dev,>=3.19.0 [libcst] libcst>=0.2.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/setup.py new/google-cloud-speech-2.15.1/setup.py --- old/google-cloud-speech-2.14.1/setup.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/setup.py 2022-08-15 16:25:59.000000000 +0200 @@ -22,19 +22,16 @@ name = "google-cloud-speech" description = "Google Cloud Speech API client library" -version = "2.14.1" +version = "2.15.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - # NOTE: Maintainers, please do not require google-api-core>=2.x.x - # Until this issue is closed - # https://github.com/googleapis/google-cloud-python/issues/10566 - "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "proto-plus >= 1.15.0, <2.0.0dev", - "protobuf >= 3.19.0, <4.0.0dev", + "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "protobuf >= 3.19.0, <5.0.0dev", ] extras = {"libcst": "libcst >= 0.2.5"} @@ -76,7 +73,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -89,7 +85,7 @@ namespace_packages=namespaces, install_requires=dependencies, extras_require=extras, - python_requires=">=3.6", + python_requires=">=3.7", scripts=[ "scripts/fixup_speech_v1_keywords.py", "scripts/fixup_speech_v1p1beta1_keywords.py", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1/test_adaptation.py new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1/test_adaptation.py --- old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1/test_adaptation.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1/test_adaptation.py 2022-08-15 16:25:59.000000000 +0200 @@ -221,6 +221,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -238,6 +239,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -255,6 +257,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -284,6 +287,25 @@ quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", ) @@ -349,6 +371,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -383,6 +406,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -405,6 +429,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -515,6 +540,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -548,6 +574,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -566,6 +593,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -599,6 +627,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # test that the credentials from file are saved and used as the credentials. @@ -3719,6 +3748,28 @@ @pytest.mark.parametrize( + "transport_class", + [ + transports.AdaptationGrpcTransport, + transports.AdaptationGrpcAsyncIOTransport, + ], +) +def test_adaptation_transport_auth_gdch_credentials(transport_class): + host = "https://language.com" + api_audience_tests = [None, "https://language2.com"] + api_audience_expect = [host, "https://language2.com"] + for t, e in zip(api_audience_tests, api_audience_expect): + with mock.patch.object(google.auth, "default", autospec=True) as adc: + gdch_mock = mock.MagicMock() + type(gdch_mock).with_gdch_audience = mock.PropertyMock( + return_value=gdch_mock + ) + adc.return_value = (gdch_mock, None) + transport_class(host=host, api_audience=t) + gdch_mock.with_gdch_audience.assert_called_once_with(e) + + +@pytest.mark.parametrize( "transport_class,grpc_helpers", [ (transports.AdaptationGrpcTransport, grpc_helpers), @@ -4203,4 +4254,5 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1/test_speech.py new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1/test_speech.py --- old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1/test_speech.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1/test_speech.py 2022-08-15 16:25:59.000000000 +0200 @@ -214,6 +214,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -231,6 +232,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -248,6 +250,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -277,6 +280,25 @@ quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", ) @@ -340,6 +362,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -374,6 +397,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -396,6 +420,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -500,6 +525,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -533,6 +559,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -551,6 +578,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -584,6 +612,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # test that the credentials from file are saved and used as the credentials. @@ -1303,6 +1332,28 @@ @pytest.mark.parametrize( + "transport_class", + [ + transports.SpeechGrpcTransport, + transports.SpeechGrpcAsyncIOTransport, + ], +) +def test_speech_transport_auth_gdch_credentials(transport_class): + host = "https://language.com" + api_audience_tests = [None, "https://language2.com"] + api_audience_expect = [host, "https://language2.com"] + for t, e in zip(api_audience_tests, api_audience_expect): + with mock.patch.object(google.auth, "default", autospec=True) as adc: + gdch_mock = mock.MagicMock() + type(gdch_mock).with_gdch_audience = mock.PropertyMock( + return_value=gdch_mock + ) + adc.return_value = (gdch_mock, None) + transport_class(host=host, api_audience=t) + gdch_mock.with_gdch_audience.assert_called_once_with(e) + + +@pytest.mark.parametrize( "transport_class,grpc_helpers", [ (transports.SpeechGrpcTransport, grpc_helpers), @@ -1821,4 +1872,5 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1p1beta1/test_adaptation.py new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1p1beta1/test_adaptation.py --- old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1p1beta1/test_adaptation.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1p1beta1/test_adaptation.py 2022-08-15 16:25:59.000000000 +0200 @@ -221,6 +221,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -238,6 +239,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -255,6 +257,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -284,6 +287,25 @@ quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", ) @@ -349,6 +371,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -383,6 +406,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -405,6 +429,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -515,6 +540,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -548,6 +574,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -566,6 +593,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -599,6 +627,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # test that the credentials from file are saved and used as the credentials. @@ -3719,6 +3748,28 @@ @pytest.mark.parametrize( + "transport_class", + [ + transports.AdaptationGrpcTransport, + transports.AdaptationGrpcAsyncIOTransport, + ], +) +def test_adaptation_transport_auth_gdch_credentials(transport_class): + host = "https://language.com" + api_audience_tests = [None, "https://language2.com"] + api_audience_expect = [host, "https://language2.com"] + for t, e in zip(api_audience_tests, api_audience_expect): + with mock.patch.object(google.auth, "default", autospec=True) as adc: + gdch_mock = mock.MagicMock() + type(gdch_mock).with_gdch_audience = mock.PropertyMock( + return_value=gdch_mock + ) + adc.return_value = (gdch_mock, None) + transport_class(host=host, api_audience=t) + gdch_mock.with_gdch_audience.assert_called_once_with(e) + + +@pytest.mark.parametrize( "transport_class,grpc_helpers", [ (transports.AdaptationGrpcTransport, grpc_helpers), @@ -4203,4 +4254,5 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1p1beta1/test_speech.py new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1p1beta1/test_speech.py --- old/google-cloud-speech-2.14.1/tests/unit/gapic/speech_v1p1beta1/test_speech.py 2022-06-07 13:11:44.000000000 +0200 +++ new/google-cloud-speech-2.15.1/tests/unit/gapic/speech_v1p1beta1/test_speech.py 2022-08-15 16:25:59.000000000 +0200 @@ -214,6 +214,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -231,6 +232,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -248,6 +250,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -277,6 +280,25 @@ quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", ) @@ -340,6 +362,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -374,6 +397,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -396,6 +420,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -500,6 +525,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -533,6 +559,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -551,6 +578,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -584,6 +612,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # test that the credentials from file are saved and used as the credentials. @@ -1303,6 +1332,28 @@ @pytest.mark.parametrize( + "transport_class", + [ + transports.SpeechGrpcTransport, + transports.SpeechGrpcAsyncIOTransport, + ], +) +def test_speech_transport_auth_gdch_credentials(transport_class): + host = "https://language.com" + api_audience_tests = [None, "https://language2.com"] + api_audience_expect = [host, "https://language2.com"] + for t, e in zip(api_audience_tests, api_audience_expect): + with mock.patch.object(google.auth, "default", autospec=True) as adc: + gdch_mock = mock.MagicMock() + type(gdch_mock).with_gdch_audience = mock.PropertyMock( + return_value=gdch_mock + ) + adc.return_value = (gdch_mock, None) + transport_class(host=host, api_audience=t) + gdch_mock.with_gdch_audience.assert_called_once_with(e) + + +@pytest.mark.parametrize( "transport_class,grpc_helpers", [ (transports.SpeechGrpcTransport, grpc_helpers), @@ -1821,4 +1872,5 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, )