Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-google-cloud-translate for openSUSE:Factory checked in at 2022-09-13 15:09:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-google-cloud-translate (Old) and /work/SRC/openSUSE:Factory/.python-google-cloud-translate.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-google-cloud-translate" Tue Sep 13 15:09:49 2022 rev:5 rq:1003116 version:3.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-google-cloud-translate/python-google-cloud-translate.changes 2022-06-10 15:57:57.628851579 +0200 +++ /work/SRC/openSUSE:Factory/.python-google-cloud-translate.new.2083/python-google-cloud-translate.changes 2022-09-13 15:11:17.148962999 +0200 @@ -1,0 +2,16 @@ +Mon Sep 12 16:02:14 UTC 2022 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to version 3.8.2 + * **samples:** Fixing file saving for local documents translation (#419) +- from version 3.8.1 + * **deps:** allow protobuf < 5.0.0 (#425) + * **deps:** require proto-plus >= 1.22.0 (ba884c6) +- from version 3.8.0 + * add audience parameter (b665051) + * **deps:** require google-api-core>=1.32.0,>=2.8.0 (#409) + * require python 3.7+ (#411) +- Drop patches for issues fixed upstream + * python-google-cloud-translate-no-mock.patch +- Update BuildRequires and Requires from setup.py + +------------------------------------------------------------------- Old: ---- google-cloud-translate-3.7.4.tar.gz python-google-cloud-translate-no-mock.patch New: ---- google-cloud-translate-3.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-google-cloud-translate.spec ++++++ --- /var/tmp/diff_new_pack.eR1JrX/_old 2022-09-13 15:11:17.544964114 +0200 +++ /var/tmp/diff_new_pack.eR1JrX/_new 2022-09-13 15:11:17.552964136 +0200 @@ -19,17 +19,16 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-google-cloud-translate -Version: 3.7.4 +Version: 3.8.2 Release: 0 Summary: Google Cloud Translation API client library License: Apache-2.0 URL: https://github.com/googleapis/python-translate Source: https://files.pythonhosted.org/packages/source/g/google-cloud-translate/google-cloud-translate-%{version}.tar.gz -# https://github.com/googleapis/python-translate/issues/403 -Patch0: python-google-cloud-translate-no-mock.patch -BuildRequires: %{python_module google-api-core >= 1.31.5} +BuildRequires: %{python_module google-api-core >= 1.32.0} BuildRequires: %{python_module google-cloud-core >= 1.3.0} -BuildRequires: %{python_module proto-plus >= 1.15.0} +BuildRequires: %{python_module proto-plus >= 1.22.0} +BuildRequires: %{python_module protobuf >= 3.19.0} BuildRequires: %{python_module setuptools} # START TESTING SECTION BuildRequires: %{python_module pytest-asyncio} @@ -37,9 +36,10 @@ # END TESTING SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-google-api-core >= 1.31.5 +Requires: python-google-api-core >= 1.32.0 Requires: python-google-cloud-core >= 1.3.0 -Requires: python-proto-plus >= 1.15.0 +Requires: python-proto-plus >= 1.22.0 +Requires: python-protobuf >= 3.19.0 Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch ++++++ google-cloud-translate-3.7.4.tar.gz -> google-cloud-translate-3.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-translate-3.7.4/PKG-INFO new/google-cloud-translate-3.8.2/PKG-INFO --- old/google-cloud-translate-3.7.4/PKG-INFO 2022-06-07 00:09:50.565686000 +0200 +++ new/google-cloud-translate-3.8.2/PKG-INFO 2022-09-06 19:59:56.247054800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-cloud-translate -Version: 3.7.4 +Version: 3.8.2 Summary: Google Cloud Translation API client library Home-page: https://github.com/googleapis/python-translate Author: Google LLC @@ -12,41 +12,34 @@ 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 License-File: LICENSE -Python Client for Google Cloud Translation -========================================== +Python Client for Cloud Translation API +======================================= -|GA| |pypi| |versions| +|stable| |pypi| |versions| -With `Google Cloud Translation`_, you can dynamically translate text between -thousands of language pairs. The Google Cloud Translation API lets websites -and programs integrate with Google Cloud Translation programmatically. Google -Cloud Translation is available as a paid service. See the `Pricing`_ and -`FAQ`_ pages for details. +`Cloud Translation API`_: can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation 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-translate.svg :target: https://pypi.org/project/google-cloud-translate/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-translate.svg :target: https://pypi.org/project/google-cloud-translate/ -.. _Google Cloud Translation: https://cloud.google.com/translate/ -.. _Pricing: https://cloud.google.com/translate/pricing -.. _FAQ: https://cloud.google.com/translate/faq -.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/translation/latest -.. _Product Documentation: https://cloud.google.com/translate/docs +.. _Cloud Translation API: https://cloud.google.com/translate/docs/ +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/translate/latest +.. _Product Documentation: https://cloud.google.com/translate/docs/ Quick Start ----------- @@ -55,12 +48,12 @@ 1. `Select or create a Cloud Platform project.`_ 2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Translate API.`_ +3. `Enable the Cloud Translation API.`_ 4. `Setup Authentication.`_ .. _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 Google Cloud Translate API.: https://cloud.google.com/translate +.. _Enable the Cloud Translation API.: https://cloud.google.com/translate/docs/ .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -77,15 +70,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.6 +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 + +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. -The last version of this library compatible with Python 2.7 is google-cloud-translate==2.0.1. +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 ^^^^^^^^^ @@ -108,23 +116,15 @@ <your-env>\Scripts\activate <your-env>\Scripts\pip.exe install google-cloud-translate -Samples ------------ - -The `samples folder`_ contains all of the Cloud Translation API code snippets -found in `its documentation`_ as well as complete sample apps: - -- `Mini Google Translate "MVP"`_ app +Next Steps +~~~~~~~~~~ - - Shows how to use the API in a Python/Flask web app - - Deployable locally or any on-prem or cloud host supporting Flask apps - - Also deployable to `Google Cloud serverless hosting platforms`_ (`App Engine`_, `Cloud Functions`_, or `Cloud Run`_) with only minor configuration changes - -.. _samples folder: samples -.. _its documentation: https://cloud.google.com/translate/docs -.. _Mini Google Translate "MVP": https://github.com/googlecodelabs/cloud-nebulous-serverless-python -.. _Google Cloud serverless hosting platforms: https://cloud.google.com/serverless#serverless-products -.. _App Engine: https://cloud.google.com/appengine -.. _Cloud Functions: https://cloud.google.com/functions -.. _Cloud Run: https://cloud.google.com/run +- Read the `Client Library Documentation`_ for Cloud Translation API + to see other available methods on the client. +- Read the `Cloud Translation 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 Translation API Product documentation: https://cloud.google.com/translate/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-translate-3.7.4/README.rst new/google-cloud-translate-3.8.2/README.rst --- old/google-cloud-translate-3.7.4/README.rst 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/README.rst 2022-09-06 19:57:18.000000000 +0200 @@ -1,28 +1,22 @@ -Python Client for Google Cloud Translation -========================================== +Python Client for Cloud Translation API +======================================= -|GA| |pypi| |versions| +|stable| |pypi| |versions| -With `Google Cloud Translation`_, you can dynamically translate text between -thousands of language pairs. The Google Cloud Translation API lets websites -and programs integrate with Google Cloud Translation programmatically. Google -Cloud Translation is available as a paid service. See the `Pricing`_ and -`FAQ`_ pages for details. +`Cloud Translation API`_: can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation 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-translate.svg :target: https://pypi.org/project/google-cloud-translate/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-translate.svg :target: https://pypi.org/project/google-cloud-translate/ -.. _Google Cloud Translation: https://cloud.google.com/translate/ -.. _Pricing: https://cloud.google.com/translate/pricing -.. _FAQ: https://cloud.google.com/translate/faq -.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/translation/latest -.. _Product Documentation: https://cloud.google.com/translate/docs +.. _Cloud Translation API: https://cloud.google.com/translate/docs/ +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/translate/latest +.. _Product Documentation: https://cloud.google.com/translate/docs/ Quick Start ----------- @@ -31,12 +25,12 @@ 1. `Select or create a Cloud Platform project.`_ 2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Translate API.`_ +3. `Enable the Cloud Translation API.`_ 4. `Setup Authentication.`_ .. _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 Google Cloud Translate API.: https://cloud.google.com/translate +.. _Enable the Cloud Translation API.: https://cloud.google.com/translate/docs/ .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -53,15 +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.6 +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 + +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. -The last version of this library compatible with Python 2.7 is google-cloud-translate==2.0.1. +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 ^^^^^^^^^ @@ -84,23 +93,15 @@ <your-env>\Scripts\activate <your-env>\Scripts\pip.exe install google-cloud-translate -Samples ------------ - -The `samples folder`_ contains all of the Cloud Translation API code snippets -found in `its documentation`_ as well as complete sample apps: - -- `Mini Google Translate "MVP"`_ app +Next Steps +~~~~~~~~~~ - - Shows how to use the API in a Python/Flask web app - - Deployable locally or any on-prem or cloud host supporting Flask apps - - Also deployable to `Google Cloud serverless hosting platforms`_ (`App Engine`_, `Cloud Functions`_, or `Cloud Run`_) with only minor configuration changes - -.. _samples folder: samples -.. _its documentation: https://cloud.google.com/translate/docs -.. _Mini Google Translate "MVP": https://github.com/googlecodelabs/cloud-nebulous-serverless-python -.. _Google Cloud serverless hosting platforms: https://cloud.google.com/serverless#serverless-products -.. _App Engine: https://cloud.google.com/appengine -.. _Cloud Functions: https://cloud.google.com/functions -.. _Cloud Run: https://cloud.google.com/run +- Read the `Client Library Documentation`_ for Cloud Translation API + to see other available methods on the client. +- Read the `Cloud Translation 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 Translation API Product documentation: https://cloud.google.com/translate/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-translate-3.7.4/google/cloud/translate_v3/services/translation_service/client.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/client.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3/services/translation_service/client.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/client.py 2022-09-06 19:57:18.000000000 +0200 @@ -427,6 +427,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 translate_text( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-translate-3.7.4/google/cloud/translate_v3/services/translation_service/transports/base.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/transports/base.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3/services/translation_service/transports/base.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/transports/base.py 2022-09-06 19:57:18.000000000 +0200 @@ -59,6 +59,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. @@ -86,11 +87,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. @@ -111,6 +107,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 ( @@ -123,6 +124,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-translate-3.7.4/google/cloud/translate_v3/services/translation_service/transports/grpc.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/transports/grpc.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3/services/translation_service/transports/grpc.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/transports/grpc.py 2022-09-06 19:57:18.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-translate-3.7.4/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py 2022-09-06 19:57:18.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-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/client.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/client.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/client.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/client.py 2022-09-06 19:57:18.000000000 +0200 @@ -427,6 +427,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 translate_text( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/transports/base.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/transports/base.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/transports/base.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/transports/base.py 2022-09-06 19:57:18.000000000 +0200 @@ -59,6 +59,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. @@ -86,11 +87,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. @@ -111,6 +107,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 ( @@ -123,6 +124,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-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py 2022-09-06 19:57:18.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-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py --- old/google-cloud-translate-3.7.4/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py 2022-09-06 19:57:18.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-translate-3.7.4/google_cloud_translate.egg-info/PKG-INFO new/google-cloud-translate-3.8.2/google_cloud_translate.egg-info/PKG-INFO --- old/google-cloud-translate-3.7.4/google_cloud_translate.egg-info/PKG-INFO 2022-06-07 00:09:49.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google_cloud_translate.egg-info/PKG-INFO 2022-09-06 19:59:56.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-cloud-translate -Version: 3.7.4 +Version: 3.8.2 Summary: Google Cloud Translation API client library Home-page: https://github.com/googleapis/python-translate Author: Google LLC @@ -12,41 +12,34 @@ 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 License-File: LICENSE -Python Client for Google Cloud Translation -========================================== +Python Client for Cloud Translation API +======================================= -|GA| |pypi| |versions| +|stable| |pypi| |versions| -With `Google Cloud Translation`_, you can dynamically translate text between -thousands of language pairs. The Google Cloud Translation API lets websites -and programs integrate with Google Cloud Translation programmatically. Google -Cloud Translation is available as a paid service. See the `Pricing`_ and -`FAQ`_ pages for details. +`Cloud Translation API`_: can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation 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-translate.svg :target: https://pypi.org/project/google-cloud-translate/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-translate.svg :target: https://pypi.org/project/google-cloud-translate/ -.. _Google Cloud Translation: https://cloud.google.com/translate/ -.. _Pricing: https://cloud.google.com/translate/pricing -.. _FAQ: https://cloud.google.com/translate/faq -.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/translation/latest -.. _Product Documentation: https://cloud.google.com/translate/docs +.. _Cloud Translation API: https://cloud.google.com/translate/docs/ +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/translate/latest +.. _Product Documentation: https://cloud.google.com/translate/docs/ Quick Start ----------- @@ -55,12 +48,12 @@ 1. `Select or create a Cloud Platform project.`_ 2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Translate API.`_ +3. `Enable the Cloud Translation API.`_ 4. `Setup Authentication.`_ .. _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 Google Cloud Translate API.: https://cloud.google.com/translate +.. _Enable the Cloud Translation API.: https://cloud.google.com/translate/docs/ .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -77,15 +70,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.6 +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 + +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. -The last version of this library compatible with Python 2.7 is google-cloud-translate==2.0.1. +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 ^^^^^^^^^ @@ -108,23 +116,15 @@ <your-env>\Scripts\activate <your-env>\Scripts\pip.exe install google-cloud-translate -Samples ------------ - -The `samples folder`_ contains all of the Cloud Translation API code snippets -found in `its documentation`_ as well as complete sample apps: - -- `Mini Google Translate "MVP"`_ app +Next Steps +~~~~~~~~~~ - - Shows how to use the API in a Python/Flask web app - - Deployable locally or any on-prem or cloud host supporting Flask apps - - Also deployable to `Google Cloud serverless hosting platforms`_ (`App Engine`_, `Cloud Functions`_, or `Cloud Run`_) with only minor configuration changes - -.. _samples folder: samples -.. _its documentation: https://cloud.google.com/translate/docs -.. _Mini Google Translate "MVP": https://github.com/googlecodelabs/cloud-nebulous-serverless-python -.. _Google Cloud serverless hosting platforms: https://cloud.google.com/serverless#serverless-products -.. _App Engine: https://cloud.google.com/appengine -.. _Cloud Functions: https://cloud.google.com/functions -.. _Cloud Run: https://cloud.google.com/run +- Read the `Client Library Documentation`_ for Cloud Translation API + to see other available methods on the client. +- Read the `Cloud Translation 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 Translation API Product documentation: https://cloud.google.com/translate/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-translate-3.7.4/google_cloud_translate.egg-info/requires.txt new/google-cloud-translate-3.8.2/google_cloud_translate.egg-info/requires.txt --- old/google-cloud-translate-3.7.4/google_cloud_translate.egg-info/requires.txt 2022-06-07 00:09:50.000000000 +0200 +++ new/google-cloud-translate-3.8.2/google_cloud_translate.egg-info/requires.txt 2022-09-06 19:59:56.000000000 +0200 @@ -1,4 +1,4 @@ -google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5 +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 google-cloud-core<3.0.0dev,>=1.3.0 -proto-plus<2.0.0dev,>=1.15.0 -protobuf<4.0.0dev,>=3.19.0 +proto-plus<2.0.0dev,>=1.22.0 +protobuf<5.0.0dev,>=3.19.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-translate-3.7.4/setup.py new/google-cloud-translate-3.8.2/setup.py --- old/google-cloud-translate-3.7.4/setup.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/setup.py 2022-09-06 19:57:18.000000000 +0200 @@ -22,23 +22,17 @@ name = "google-cloud-translate" description = "Google Cloud Translation API client library" -version = "3.7.4" +version = "3.8.2" # 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", - # 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.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", "google-cloud-core >= 1.3.0, <3.0.0dev", - "proto-plus >= 1.15.0, <2.0.0dev", - "protobuf >= 3.19.0, <4.0.0dev", + "proto-plus >= 1.22.0, <2.0.0dev", + "protobuf >= 3.19.0, <5.0.0dev", ] extras = {} @@ -80,7 +74,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", @@ -97,7 +90,7 @@ namespace_packages=namespaces, install_requires=dependencies, extras_require=extras, - python_requires=">=3.6", + python_requires=">=3.7", include_package_data=True, zip_safe=False, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-translate-3.7.4/tests/system.py new/google-cloud-translate-3.8.2/tests/system.py --- old/google-cloud-translate-3.7.4/tests/system.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/tests/system.py 2022-09-06 19:57:18.000000000 +0200 @@ -66,7 +66,7 @@ values = ["takoy", "s'il vous plait"] detections = Config.CLIENT_V2.detect_language(values) self.assertEqual(len(values), len(detections)) - self.assertEqual(detections[0]["language"], "ru") + self.assertEqual(detections[0]["language"], "ru-Latn") self.assertEqual(detections[1]["language"], "fr") @skip_for_mtls diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-cloud-translate-3.7.4/tests/unit/gapic/translate_v3/test_translation_service.py new/google-cloud-translate-3.8.2/tests/unit/gapic/translate_v3/test_translation_service.py --- old/google-cloud-translate-3.7.4/tests/unit/gapic/translate_v3/test_translation_service.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/tests/unit/gapic/translate_v3/test_translation_service.py 2022-09-06 19:57:18.000000000 +0200 @@ -239,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 @@ -256,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 is @@ -273,6 +275,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 @@ -302,6 +305,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", ) @@ -379,6 +401,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 @@ -413,6 +436,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. @@ -435,6 +459,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -549,6 +574,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -587,6 +613,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -607,6 +634,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -645,6 +673,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. @@ -3490,6 +3519,28 @@ @pytest.mark.parametrize( + "transport_class", + [ + transports.TranslationServiceGrpcTransport, + transports.TranslationServiceGrpcAsyncIOTransport, + ], +) +def test_translation_service_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.TranslationServiceGrpcTransport, grpc_helpers), @@ -3999,4 +4050,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-translate-3.7.4/tests/unit/gapic/translate_v3beta1/test_translation_service.py new/google-cloud-translate-3.8.2/tests/unit/gapic/translate_v3beta1/test_translation_service.py --- old/google-cloud-translate-3.7.4/tests/unit/gapic/translate_v3beta1/test_translation_service.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/tests/unit/gapic/translate_v3beta1/test_translation_service.py 2022-09-06 19:57:18.000000000 +0200 @@ -239,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 @@ -256,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 is @@ -273,6 +275,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 @@ -302,6 +305,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", ) @@ -379,6 +401,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 @@ -413,6 +436,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. @@ -435,6 +459,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -549,6 +574,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -587,6 +613,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -607,6 +634,7 @@ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -645,6 +673,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. @@ -3362,6 +3391,28 @@ @pytest.mark.parametrize( + "transport_class", + [ + transports.TranslationServiceGrpcTransport, + transports.TranslationServiceGrpcAsyncIOTransport, + ], +) +def test_translation_service_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.TranslationServiceGrpcTransport, grpc_helpers), @@ -3871,4 +3922,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-translate-3.7.4/tests/unit/v2/test__http.py new/google-cloud-translate-3.8.2/tests/unit/v2/test__http.py --- old/google-cloud-translate-3.7.4/tests/unit/v2/test__http.py 2022-06-07 00:07:02.000000000 +0200 +++ new/google-cloud-translate-3.8.2/tests/unit/v2/test__http.py 2022-09-06 19:57:18.000000000 +0200 @@ -14,7 +14,7 @@ import unittest -import mock +from unittest import mock class TestConnection(unittest.TestCase):