Hello community, here is the log from the commit of package python-google-api-core for openSUSE:Factory checked in at 2019-03-14 22:43:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-google-api-core (Old) and /work/SRC/openSUSE:Factory/.python-google-api-core.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-google-api-core" Thu Mar 14 22:43:01 2019 rev:6 rq:685062 version:1.8.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-google-api-core/python-google-api-core.changes 2019-02-28 21:41:51.133564846 +0100 +++ /work/SRC/openSUSE:Factory/.python-google-api-core.new.28833/python-google-api-core.changes 2019-03-14 22:43:02.578626490 +0100 @@ -1,0 +2,8 @@ +Thu Mar 14 16:21:46 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> + +- Update to 1.8.1: + * Protect the creation of a background thread in BackgroundConsumer and wait on it starting. (#7499) + * Add support to unwrap Anys into wrapped pb2 objects. (#7430) + * Add Operation.deserialize. (#7427) + +------------------------------------------------------------------- Old: ---- google-api-core-1.7.0.tar.gz New: ---- google-api-core-1.8.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-google-api-core.spec ++++++ --- /var/tmp/diff_new_pack.uDpyMD/_old 2019-03-14 22:43:04.134625950 +0100 +++ /var/tmp/diff_new_pack.uDpyMD/_new 2019-03-14 22:43:04.214625923 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-google-api-core -Version: 1.7.0 +Version: 1.8.1 Release: 0 Summary: Google API client core library License: Apache-2.0 ++++++ google-api-core-1.7.0.tar.gz -> google-api-core-1.8.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/PKG-INFO new/google-api-core-1.8.1/PKG-INFO --- old/google-api-core-1.7.0/PKG-INFO 2018-12-17 23:23:33.000000000 +0100 +++ new/google-api-core-1.8.1/PKG-INFO 2019-03-14 00:38:07.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-api-core -Version: 1.7.0 +Version: 1.8.1 Summary: Google API client core library Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python Author: Google LLC @@ -19,7 +19,7 @@ :target: https://pypi.org/project/google-api_core/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-api_core.svg :target: https://pypi.org/project/google-api_core/ - .. _documentation: https://googlecloudplatform.github.io/google-cloud-python/latest/core/ + .. _documentation: https://googleapis.github.io/google-cloud-python/latest/core/ Supported Python Versions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/README.rst new/google-api-core-1.8.1/README.rst --- old/google-api-core-1.7.0/README.rst 2018-12-17 18:10:25.000000000 +0100 +++ new/google-api-core-1.8.1/README.rst 2019-03-14 00:36:13.000000000 +0100 @@ -11,7 +11,7 @@ :target: https://pypi.org/project/google-api_core/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-api_core.svg :target: https://pypi.org/project/google-api_core/ -.. _documentation: https://googlecloudplatform.github.io/google-cloud-python/latest/core/ +.. _documentation: https://googleapis.github.io/google-cloud-python/latest/core/ Supported Python Versions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/google/api_core/bidi.py new/google-api-core-1.8.1/google/api_core/bidi.py --- old/google-api-core-1.7.0/google/api_core/bidi.py 2018-12-03 18:45:52.000000000 +0100 +++ new/google-api-core-1.8.1/google/api_core/bidi.py 2019-03-14 00:36:13.000000000 +0100 @@ -505,8 +505,9 @@ # when the RPC has terminated. self.resume() - def _thread_main(self): + def _thread_main(self, ready): try: + ready.set() self._bidi_rpc.add_done_callback(self._on_call_done) self._bidi_rpc.open() @@ -555,11 +556,19 @@ def start(self): """Start the background thread and begin consuming the thread.""" with self._operational_lock: + ready = threading.Event() thread = threading.Thread( - name=_BIDIRECTIONAL_CONSUMER_NAME, target=self._thread_main + name=_BIDIRECTIONAL_CONSUMER_NAME, + target=self._thread_main, + args=(ready,) ) thread.daemon = True thread.start() + # Other parts of the code rely on `thread.is_alive` which + # isn't sufficient to know if a thread is active, just that it may + # soon be active. This can cause races. Further protect + # against races by using a ready event and wait on it to be set. + ready.wait() self._thread = thread _LOGGER.debug("Started helper thread %s", thread.name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/google/api_core/operation.py new/google-api-core-1.8.1/google/api_core/operation.py --- old/google-api-core-1.7.0/google/api_core/operation.py 2018-12-03 18:45:52.000000000 +0100 +++ new/google-api-core-1.8.1/google/api_core/operation.py 2019-03-14 00:36:13.000000000 +0100 @@ -101,6 +101,18 @@ self._metadata_type, self._operation.metadata ) + @classmethod + def deserialize(self, payload): + """Deserialize a ``google.longrunning.Operation`` protocol buffer. + + Args: + payload (bytes): A serialized operation protocol buffer. + + Returns: + ~.operations_pb2.Operation: An Operation protobuf object. + """ + return operations_pb2.Operation.FromString(payload) + def _set_result_from_operation(self): """Set the result or exception from the operation if it is complete.""" # This must be done in a lock to prevent the polling thread diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/google/api_core/protobuf_helpers.py new/google-api-core-1.8.1/google/api_core/protobuf_helpers.py --- old/google-api-core-1.7.0/google/api_core/protobuf_helpers.py 2018-12-13 19:00:05.000000000 +0100 +++ new/google-api-core-1.8.1/google/api_core/protobuf_helpers.py 2019-03-14 00:36:13.000000000 +0100 @@ -55,13 +55,22 @@ TypeError: if the message could not be converted. """ msg = pb_type() - if not any_pb.Unpack(msg): + + # Unwrap proto-plus wrapped messages. + if callable(getattr(pb_type, "pb", None)): + msg_pb = pb_type.pb(msg) + else: + msg_pb = msg + + # Unpack the Any object and populate the protobuf message instance. + if not any_pb.Unpack(msg_pb): raise TypeError( "Could not convert {} to {}".format( any_pb.__class__.__name__, pb_type.__name__ ) ) + # Done; return the message. return msg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/google_api_core.egg-info/PKG-INFO new/google-api-core-1.8.1/google_api_core.egg-info/PKG-INFO --- old/google-api-core-1.7.0/google_api_core.egg-info/PKG-INFO 2018-12-17 23:23:33.000000000 +0100 +++ new/google-api-core-1.8.1/google_api_core.egg-info/PKG-INFO 2019-03-14 00:38:07.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: google-api-core -Version: 1.7.0 +Version: 1.8.1 Summary: Google API client core library Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python Author: Google LLC @@ -19,7 +19,7 @@ :target: https://pypi.org/project/google-api_core/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-api_core.svg :target: https://pypi.org/project/google-api_core/ - .. _documentation: https://googlecloudplatform.github.io/google-cloud-python/latest/core/ + .. _documentation: https://googleapis.github.io/google-cloud-python/latest/core/ Supported Python Versions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/setup.py new/google-api-core-1.8.1/setup.py --- old/google-api-core-1.7.0/setup.py 2018-12-17 23:21:09.000000000 +0100 +++ new/google-api-core-1.8.1/setup.py 2019-03-14 00:36:13.000000000 +0100 @@ -22,7 +22,7 @@ name = "google-api-core" description = "Google API client core library" -version = "1.7.0" +version = "1.8.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/tests/unit/test_operation.py new/google-api-core-1.8.1/tests/unit/test_operation.py --- old/google-api-core-1.7.0/tests/unit/test_operation.py 2018-12-03 18:45:52.000000000 +0100 +++ new/google-api-core-1.8.1/tests/unit/test_operation.py 2019-03-14 00:36:13.000000000 +0100 @@ -231,3 +231,11 @@ assert future._metadata_type == struct_pb2.Struct assert future.operation.name == TEST_OPERATION_NAME assert future.done + + +def test_deserialize(): + op = make_operation_proto(name="foobarbaz") + serialized = op.SerializeToString() + deserialized_op = operation.Operation.deserialize(serialized) + assert op.name == deserialized_op.name + assert type(op) is type(deserialized_op) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/tests/unit/test_page_iterator.py new/google-api-core-1.8.1/tests/unit/test_page_iterator.py --- old/google-api-core-1.7.0/tests/unit/test_page_iterator.py 2018-12-03 18:45:52.000000000 +0100 +++ new/google-api-core-1.8.1/tests/unit/test_page_iterator.py 2019-03-14 00:36:13.000000000 +0100 @@ -514,7 +514,7 @@ method.assert_called_with(request) assert method.call_count == 2 - assert request.page_token is "1" + assert request.page_token == "1" class GAXPageIterator(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/google-api-core-1.7.0/tests/unit/test_protobuf_helpers.py new/google-api-core-1.8.1/tests/unit/test_protobuf_helpers.py --- old/google-api-core-1.7.0/tests/unit/test_protobuf_helpers.py 2018-12-03 18:45:52.000000000 +0100 +++ new/google-api-core-1.8.1/tests/unit/test_protobuf_helpers.py 2019-03-14 00:36:13.000000000 +0100 @@ -38,6 +38,29 @@ assert in_message == out_message +def test_from_any_pb_wrapped_success(): + # Declare a message class conforming to wrapped messages. + class WrappedDate(object): + def __init__(self, **kwargs): + self._pb = date_pb2.Date(**kwargs) + + def __eq__(self, other): + return self._pb == other + + @classmethod + def pb(cls, msg): + return msg._pb + + # Run the same test as `test_from_any_pb_success`, but using the + # wrapped class. + in_message = date_pb2.Date(year=1990) + in_message_any = any_pb2.Any() + in_message_any.Pack(in_message) + out_message = protobuf_helpers.from_any_pb(WrappedDate, in_message_any) + + assert out_message == in_message + + def test_from_any_pb_failure(): in_message = any_pb2.Any() in_message.Pack(date_pb2.Date(year=1990))