Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-txaio for openSUSE:Factory 
checked in at 2022-06-04 23:27:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-txaio (Old)
 and      /work/SRC/openSUSE:Factory/.python-txaio.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-txaio"

Sat Jun  4 23:27:23 2022 rev:12 rq:980776 version:22.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-txaio/python-txaio.changes        
2021-03-02 14:28:46.098115229 +0100
+++ /work/SRC/openSUSE:Factory/.python-txaio.new.1548/python-txaio.changes      
2022-06-04 23:27:28.072782013 +0200
@@ -1,0 +2,10 @@
+Sat Jun  4 15:12:30 UTC 2022 - Dirk M??ller <[email protected]>
+
+- update to 22.2.1:
+  * fix: cancel handling in python 3.8/3.9. (#175)
+  * fix: gracefully fail if coroutine called with wrong args (#176)
+  * fix: eliminate redundant dep. on mock (#170)
+  * fix: doc note that twisted supports native coroutines (#172)
+- remove-mock.patch: upstream
+
+-------------------------------------------------------------------

Old:
----
  remove-mock.patch
  txaio-21.2.1.tar.gz

New:
----
  txaio-22.2.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-txaio.spec ++++++
--- /var/tmp/diff_new_pack.G3kYmp/_old  2022-06-04 23:27:28.840782789 +0200
+++ /var/tmp/diff_new_pack.G3kYmp/_new  2022-06-04 23:27:28.844782793 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-txaio
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,15 +19,13 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-txaio
-Version:        21.2.1
+Version:        22.2.1
 Release:        0
 Summary:        WebSocket and WAMP in Python for Twisted and asyncio
 License:        MIT
 Group:          Development/Languages/Python
 URL:            https://github.com/crossbario/txaio
 Source:         
https://files.pythonhosted.org/packages/source/t/txaio/txaio-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM remove-mock.patch gh#crossbario/txaio#169
-Patch0:         remove-mock.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module testsuite}
 BuildRequires:  fdupes

++++++ txaio-21.2.1.tar.gz -> txaio-22.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/PKG-INFO new/txaio-22.2.1/PKG-INFO
--- old/txaio-21.2.1/PKG-INFO   2021-02-20 15:35:10.133086200 +0100
+++ new/txaio-22.2.1/PKG-INFO   2022-02-23 18:53:33.395578600 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: txaio
-Version: 21.2.1
+Version: 22.2.1
 Summary: Compatibility API between asyncio/Twisted/Trollius
 Home-page: https://github.com/crossbario/txaio
 Author: Crossbar.io Technologies GmbH
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/docs/overview.rst 
new/txaio-22.2.1/docs/overview.rst
--- old/txaio-21.2.1/docs/overview.rst  2020-01-21 00:10:08.000000000 +0100
+++ new/txaio-22.2.1/docs/overview.rst  2021-11-21 10:02:35.000000000 +0100
@@ -74,17 +74,15 @@
 
 There is **no support for @coroutine or @inlineCallbacks**
 decorators. This is not possible, as asyncio under Python3 introduced
-a new syntax (``yield from``) to call into other co-routines. So, you
+a new syntax (``yield from``) to delegate to other coroutines. So, you
 are stuck with "callback style" code for your cross-platform
 library. (Note that *users* of your library can of course use new
 Python3 features like ``yield from``, ``async`` and ``await`` in their
-own code -- but they do so by explicitly choosing "Python3 and
-asyncio" as their platform).
+own code -- but they do so by explicitly choosing "Python3" as their platform).
 
 ``txaio`` is basically a "lowest common denominator" tool. There is a
 minimum of wrapping, etcetera but the library author doesn't get to
-use fancy features (e.g. ``@inlineCallbacks``, mutation of returns,
-``@coroutine``) of the underlying async platforms.
+use fancy features (e.g. ``@inlineCallbacks`` or mutation of returns).
 
 
 Futures and Deferreds
@@ -169,10 +167,10 @@
 ---------------
 
 If you wish to write Twisted-like code that uses ``asyncio`` as its
-event-loop, you should look at `txtulip
-<https://github.com/itamarst/txtulip>`_. I do not know of a project
-that lets you write asyncio-like code that runs on Twisted's
-event-loop.
+event-loop, you should look at `AsyncioSelectorReactor
+<https://twistedmatrix.com/documents/21.2.0/api/twisted.internet.asyncioreactor.AsyncioSelectorReactor.html>`_.
+
+Twisted supports ``async def`` coroutines natively from v16.4
 
 
 .. _Autobahn|Python: http://autobahn.ws/python/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/docs/releases.rst 
new/txaio-22.2.1/docs/releases.rst
--- old/txaio-21.2.1/docs/releases.rst  2021-02-20 15:34:08.000000000 +0100
+++ new/txaio-22.2.1/docs/releases.rst  2022-02-23 18:53:04.000000000 +0100
@@ -1,6 +1,14 @@
 txio releases
 =============
 
+22.2.1
+------
+
+- fix: cancel handling in python 3.8/3.9. (#175)
+- fix: gracefully fail if coroutine called with wrong args (#176)
+- fix: eliminate redundant dep. on mock (#170)
+- fix: doc note that twisted supports native coroutines (#172)
+
 21.2.1
 ------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/setup.py new/txaio-22.2.1/setup.py
--- old/txaio-21.2.1/setup.py   2021-02-20 15:34:08.000000000 +0100
+++ new/txaio-22.2.1/setup.py   2021-11-21 10:02:35.000000000 +0100
@@ -61,7 +61,6 @@
     'sphinxcontrib-spelling>=2.1.2',    # BSD
     'sphinx_rtd_theme>=0.1.9',          # BSD
     'tox>=2.1.1',                       # MIT
-    'mock==1.3.0',                      # BSD
     'twine>=1.6.5',                     # Apache 2.0
     'tox-gh-actions>=2.2.0 ',           # MIT
 ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/test/test_call_later.py 
new/txaio-22.2.1/test/test_call_later.py
--- old/txaio-21.2.1/test/test_call_later.py    2020-01-21 00:10:08.000000000 
+0100
+++ new/txaio-22.2.1/test/test_call_later.py    2021-11-21 10:02:35.000000000 
+0100
@@ -26,7 +26,7 @@
 
 import sys
 
-from mock import patch
+from unittest.mock import patch
 
 import pytest
 import txaio
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/test/test_errback.py 
new/txaio-22.2.1/test/test_errback.py
--- old/txaio-21.2.1/test/test_errback.py       2020-01-21 00:10:08.000000000 
+0100
+++ new/txaio-22.2.1/test/test_errback.py       2021-11-21 10:02:35.000000000 
+0100
@@ -23,6 +23,7 @@
 # THE SOFTWARE.
 #
 ###############################################################################
+import sys
 
 import txaio
 
@@ -109,6 +110,32 @@
     assert 'it failed' in str(errors[0])
 
 
+def test_errback_cancel_exception(framework):
+    '''
+    reject a future with a CancelledError
+    '''
+    f = txaio.create_future()
+    errors = []
+
+    def err(f):
+        errors.append(f)
+    txaio.add_callbacks(f, None, err)
+    txaio.cancel(f, msg="future cancelled")
+
+    run_once()
+
+    assert len(errors) == 1
+    assert isinstance(errors[0], txaio.IFailedFuture)
+    tb = txaio.failure_format_traceback(errors[0])
+
+    assert 'CancelledError' in tb
+    if txaio.using_asyncio and sys.version_info >= (3, 9):
+        assert txaio.failure_message(errors[0]) == 'CancelledError: future 
cancelled'
+        assert 'future cancelled' in str(errors[0])
+    else:
+        assert txaio.failure_message(errors[0]) == 'CancelledError: '
+
+
 def test_errback_illegal_args(framework):
     '''
     non-Exception/Failures should be rejected
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/tox.ini new/txaio-22.2.1/tox.ini
--- old/txaio-21.2.1/tox.ini    2020-12-19 16:22:52.000000000 +0100
+++ new/txaio-22.2.1/tox.ini    2021-11-21 10:02:35.000000000 +0100
@@ -29,7 +29,6 @@
 
 [testenv]
 deps =
-    mock
     pytest==4.6.9
     coverage==4.5.4
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/txaio/_version.py 
new/txaio-22.2.1/txaio/_version.py
--- old/txaio-21.2.1/txaio/_version.py  2021-02-20 15:34:08.000000000 +0100
+++ new/txaio-22.2.1/txaio/_version.py  2022-02-23 18:53:04.000000000 +0100
@@ -24,4 +24,4 @@
 #
 ###############################################################################
 
-__version__ = '21.2.1'
+__version__ = '22.2.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/txaio/aio.py 
new/txaio-22.2.1/txaio/aio.py
--- old/txaio-21.2.1/txaio/aio.py       2020-04-13 18:11:41.000000000 +0200
+++ new/txaio-22.2.1/txaio/aio.py       2021-11-21 10:02:35.000000000 +0100
@@ -459,8 +459,11 @@
                 raise RuntimeError("reject requires an IFailedFuture or 
Exception")
         future.set_exception(error.value)
 
-    def cancel(self, future):
-        future.cancel()
+    def cancel(self, future, msg=None):
+        if sys.version_info >= (3, 9):
+            future.cancel(msg)
+        else:
+            future.cancel()
 
     def create_failure(self, exception=None):
         """
@@ -484,7 +487,7 @@
                 res = f.result()
                 if callback:
                     callback(res)
-            except Exception:
+            except (Exception, asyncio.CancelledError):
                 if errback:
                     errback(create_failure())
         return future.add_done_callback(done)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/txaio/tx.py new/txaio-22.2.1/txaio/tx.py
--- old/txaio-21.2.1/txaio/tx.py        2020-01-30 10:03:20.000000000 +0100
+++ new/txaio-22.2.1/txaio/tx.py        2021-11-21 10:02:35.000000000 +0100
@@ -362,7 +362,10 @@
     def as_future(self, fun, *args, **kwargs):
         # Twisted doesn't automagically deal with coroutines on Py3
         if iscoroutinefunction(fun):
-            return ensureDeferred(fun(*args, **kwargs))
+            try:
+                return ensureDeferred(fun(*args, **kwargs))
+            except TypeError as e:
+                return create_future_error(e)
         return maybeDeferred(fun, *args, **kwargs)
 
     def is_future(self, obj):
@@ -414,7 +417,7 @@
                 raise RuntimeError("reject requires a Failure or Exception")
         future.errback(error)
 
-    def cancel(self, future):
+    def cancel(self, future, msg=None):
         future.cancel()
 
     def create_failure(self, exception=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/txaio.egg-info/PKG-INFO 
new/txaio-22.2.1/txaio.egg-info/PKG-INFO
--- old/txaio-21.2.1/txaio.egg-info/PKG-INFO    2021-02-20 15:35:10.000000000 
+0100
+++ new/txaio-22.2.1/txaio.egg-info/PKG-INFO    2022-02-23 18:53:33.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: txaio
-Version: 21.2.1
+Version: 22.2.1
 Summary: Compatibility API between asyncio/Twisted/Trollius
 Home-page: https://github.com/crossbario/txaio
 Author: Crossbar.io Technologies GmbH
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/txaio-21.2.1/txaio.egg-info/requires.txt 
new/txaio-22.2.1/txaio.egg-info/requires.txt
--- old/txaio-21.2.1/txaio.egg-info/requires.txt        2021-02-20 
15:35:10.000000000 +0100
+++ new/txaio-22.2.1/txaio.egg-info/requires.txt        2022-02-23 
18:53:33.000000000 +0100
@@ -15,7 +15,6 @@
 sphinxcontrib-spelling>=2.1.2
 sphinx_rtd_theme>=0.1.9
 tox>=2.1.1
-mock==1.3.0
 twine>=1.6.5
 tox-gh-actions>=2.2.0
 

Reply via email to