Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-curio for openSUSE:Factory 
checked in at 2022-10-29 20:16:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-curio (Old)
 and      /work/SRC/openSUSE:Factory/.python-curio.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-curio"

Sat Oct 29 20:16:06 2022 rev:10 rq:1032057 version:1.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-curio/python-curio.changes        
2021-09-03 21:26:32.854200265 +0200
+++ /work/SRC/openSUSE:Factory/.python-curio.new.2275/python-curio.changes      
2022-10-29 20:17:08.346221009 +0200
@@ -1,0 +2,57 @@
+Thu Oct 27 22:40:18 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+
+- Update to 1.6: 
+  ***IMPORTANT NOTE*** This is the last release on pypi.  Curio
+     will no longer be making package releases.  The most recent
+     version can be obtained at https://github.com/dabeaz/curio.
+
+     Fixed a problem with cancellation and waiting in UniversalEvent.
+     Reported by vytasrgl.
+          
+     Merged a fix for #350 where UniversalEvents couldn't be set
+     more than once.   Reported and fixed by Stephen Harding.
+          
+     Fixed Issue #340 related to the handling of daemonic tasks
+     in a TaskGroup.   TaskGroups can now be given existing
+     daemonic tasks in the constructor.  Daemonic tasks are
+     correctly cancelled if a TaskGroup used as a context manager
+     terminates due to an exception.
+           
+    Changed all cancellation related exceptions to inherit
+    from BaseException instead of Exception.   This makes
+    them play slightly better with normal exception handling
+    code:
+
+               try:
+                   await some_operation()
+               except Exception as err:
+                   # Normal (expected) program related error
+                   ...
+               except CancelledError as err:
+                   # Cancellation of some kind
+                   ...
+
+    This also mirrors a similar change to asyncio.CancelledError
+    which now directly inherits from BaseException.
+    ***POTENTIAL INCOMPATIBILITY***
+    If you were using try: ... except Exception: to catch
+    cancellation, that code will break. 
+           
+    Added ps() and where() commands to the monitor
+    that can be used from the Curio REPL when you run
+    `python -m curio`.  These can also be used to monitor
+    the state of the kernel from a different thread.
+    For example:
+    from threading import Thread
+               
+       kern = Kernel()
+       Thread(target=kern.run, args=[main]).start()
+
+        >>> from curio.monitor import ps
+        >>> ps(kern)
+        ... displays active tasks ...
+
+    This makes it a bit easier to have some of the monitor
+    capability in an live-environment where Curio is running.
+
+-------------------------------------------------------------------

Old:
----
  curio-1.5.tar.gz

New:
----
  curio-1.6.tar.gz

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

Other differences:
------------------
++++++ python-curio.spec ++++++
--- /var/tmp/diff_new_pack.BV4vdp/_old  2022-10-29 20:17:09.442226850 +0200
+++ /var/tmp/diff_new_pack.BV4vdp/_new  2022-10-29 20:17:09.450226892 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-curio
 #
-# 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,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-curio
-Version:        1.5
+Version:        1.6
 Release:        0
 Summary:        Concurrent I/O library for Python 3
 License:        BSD-Source-Code

++++++ curio-1.5.tar.gz -> curio-1.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/CHANGES new/curio-1.6/CHANGES
--- old/curio-1.5/CHANGES       2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/CHANGES       2022-10-25 16:10:57.000000000 +0200
@@ -1,7 +1,18 @@
 CHANGES
 -------
-Version 1.5 - In Progress
+Version 1.6 - October 25, 2022
 ------------------------------
+
+10/25/2022 ***IMPORTANT NOTE*** This is the last release on pypi.  Curio
+           will no longer be making package releases.  The most recent
+          version can be obtained at https://github.com/dabeaz/curio.
+
+05/09/2022 Fixed a problem with cancellation and waiting in UniversalEvent.
+          Reported by vytasrgl.
+          
+04/20/2022 Merged a fix for #350 where UniversalEvents couldn't be set
+           more than once.   Reported and fixed by Stephen Harding.
+          
 03/10/2021 Fixed Issue #340 related to the handling of daemonic tasks
            in a TaskGroup.   TaskGroups can now be given existing
            daemonic tasks in the constructor.  Daemonic tasks are
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/README.rst new/curio-1.6/README.rst
--- old/curio-1.5/README.rst    2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/README.rst    2022-10-25 16:10:57.000000000 +0200
@@ -8,6 +8,14 @@
 concurrency. It works on Unix and Windows and has zero dependencies.
 You'll find it to be familiar, small, fast, and fun.
 
+Important Notice: October 25, 2022
+----------------------------------
+The Curio project is no longer making package releases.  I'm more than
+happy to accept bug reports and may continue to work on it from time
+to time as the mood strikes.  If you want the absolute latest version, you
+should vendor the source code from here. Curio has no dependencies
+other than the Python standard library.  --Dave
+
 Curio is Different
 ------------------
 One of the most important ideas from software architecture is the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/curio/__init__.py 
new/curio-1.6/curio/__init__.py
--- old/curio-1.5/curio/__init__.py     2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/curio/__init__.py     2022-10-25 16:10:57.000000000 +0200
@@ -1,6 +1,6 @@
 # curio/__init__.py
 
-__version__ = '1.5'
+__version__ = '1.6'
 
 from .errors import *
 from .queue import *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/curio/kernel.py 
new/curio-1.6/curio/kernel.py
--- old/curio-1.5/curio/kernel.py       2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/curio/kernel.py       2022-10-25 16:10:57.000000000 +0200
@@ -277,7 +277,7 @@
 
         # Create a new task. Putting it on the ready queue
         def new_task(coro):
-            task = taskcls(coro)
+            task = taskcls(coro, current)
             tasks[task.id] = task
             reschedule_task(task)
             for a in _activations:
@@ -466,7 +466,7 @@
         # Add a new task to the kernel
         def trap_spawn(coro):
             task = new_task(coro)
-            task.parentid = current.id
+            # task.parentid = current.id
             current._trap_result = task
 
         # ----------------------------------------
@@ -642,7 +642,9 @@
                 except OSError as e:
                     # If there is nothing to select, windows throws an
                     # OSError, so just set events to an empty list.
-                    if e.errno != getattr(errno, 'WSAEINVAL', None):
+                    wsaeinval = getattr(errno, 'WSAEINVAL', None)
+                    einval = getattr(errno, 'EINVAL', None)
+                    if e.errno not in (wsaeinval, einval):
                         raise
                     events = []
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/curio/sync.py new/curio-1.6/curio/sync.py
--- old/curio-1.5/curio/sync.py 2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/curio/sync.py 2022-10-25 16:10:57.000000000 +0200
@@ -58,8 +58,9 @@
     An event that's safe to use from Curio and threads.
     '''
     def __init__(self):
-        self._fut = Future()
         self._set = False
+        self._lock = threading.Lock()
+        self._waiting = set()
 
     def __repr__(self):
         res = super().__repr__()
@@ -70,35 +71,73 @@
         return self._set
 
     def clear(self):
-        self._fut = Future()
-        self._set = False
+        with self._lock:
+            self._set = False
 
     def wait(self):
-        self._fut.result()
+        with self._lock:
+            if self._set:
+                return
+            fut = Future()
+            self._waiting.add(fut)
+        try:
+            fut.result()
+        finally:
+            self._waiting.discard(fut)
 
     @awaitable(wait)
     async def wait(self):
-        if not self._set:
-            await _future_wait(self._fut)
+        with self._lock:
+            if self._set:
+                return
+            fut = Future()
+            self._waiting.add(fut)
+        try:
+            await _future_wait(fut)
+        finally:
+            self._waiting.discard(fut)
 
     @asyncioable(wait)
     async def wait(self):
-        if not self._set:
-            await asyncio.wrap_future(self._fut)
-
+        with self._lock:
+            if self._set:
+                return
+            fut = Future()
+            self._waiting.add(fut)
+        try:
+            await asyncio.wrap_future(fut)
+        finally:
+            self._waiting.discard(fut)
+
+    def _unblock_waiters(self):
+        # Caution: Should only be called with self._lock held.
+        now_waiting, self._waiting = self._waiting, set()
+        for fut in now_waiting:
+            if not fut.done():
+                fut.set_result(True)
+            
     def set(self):
-        self._set = True
-        self._fut.set_result(True)
+        with self._lock:
+            if self._set:
+                return
+            self._set = True
+            self._unblock_waiters()
 
     @awaitable(set)
     async def set(self):
-        self._set = True
-        self._fut.set_result(True)
+        with self._lock:
+            if self._set:
+                return
+            self._set = True
+            self._unblock_waiters()        
 
     @asyncioable(set)
     async def set(self):
-        self._set = True
-        self._fut.set_result(True)
+        with self._lock:
+            if self._set:
+                return
+            self._set = True
+            self._unblock_waiters()                
 
 # Base class for all synchronization primitives that operate as context 
managers.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/curio/task.py new/curio-1.6/curio/task.py
--- old/curio-1.5/curio/task.py 2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/curio/task.py 2022-10-25 16:10:57.000000000 +0200
@@ -97,11 +97,11 @@
     instantiated directly. Instead, use spawn().
     '''
     _lastid = 1
-    def __init__(self, coro):
+    def __init__(self, coro, parent=None):
         # Informational attributes about the task itself
         self.id = Task._lastid
         Task._lastid += 1
-        self.parentid = None          # Parent task id (if any)
+        self.parentid = None if parent is None else parent.id  # Parent task 
id (if any)
         self.coro = coro              # Underlying generator/coroutine
         self.name = getattr(coro, '__qualname__', str(coro))
         self.daemon = False           # Daemonic flag
@@ -260,10 +260,13 @@
     Task class that provides support for contextvars.  Use with the
     taskcls keyword argument to the Curio kernel.
     '''
-    def __init__(self, coro):
+    def __init__(self, coro, parent=None):
         import contextvars
         super().__init__(coro)
-        self._context = contextvars.copy_context()
+        if parent:
+            parent._context.run(lambda: setattr(self, '_context', 
contextvars.copy_context()))
+        else:
+            self._context = contextvars.copy_context()
 
     def send(self, value):
         return self._context.run(super().send, value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/docs/conf.py new/curio-1.6/docs/conf.py
--- old/curio-1.5/docs/conf.py  2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/docs/conf.py  2022-10-25 16:10:57.000000000 +0200
@@ -52,7 +52,7 @@
 
 # General information about the project.
 project = u'Curio'
-copyright = u'2016-2020, David Beazley'
+copyright = u'2016-2022, David Beazley'
 author = u'David Beazley'
 
 # The version info for the project you're documenting, acts as replacement for
@@ -60,9 +60,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '1.5'
+version = '1.6'
 # The full version, including alpha/beta/rc tags.
-release = '1.5'
+release = '1.6'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/docs/tutorial.rst 
new/curio-1.6/docs/tutorial.rst
--- old/curio-1.5/docs/tutorial.rst     2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/docs/tutorial.rst     2022-10-25 16:10:57.000000000 +0200
@@ -340,7 +340,7 @@
 
     async def echo_client(client, addr):
         print("Connection from", addr)
-        async with client.as_stream() as s
+        async with client.as_stream() as s:
             async for line in s:
                 await s.write(line)
         print('Connection closed')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/setup.py new/curio-1.6/setup.py
--- old/curio-1.5/setup.py      2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/setup.py      2022-10-25 16:10:57.000000000 +0200
@@ -6,7 +6,8 @@
 tests_require = ['pytest', 'Sphinx']
 
 long_description = """
-Curio is a coroutine-based library for concurrent systems programming.
+Curio is a coroutine-based library for concurrent systems programming.  No 
longer
+maintained as a PyPi project.  Latest version is available on GitHub. 
 """
 
 
@@ -14,7 +15,7 @@
       description="Curio",
       long_description=long_description,
       license="BSD",
-      version="1.5",
+      version="1.6",
       author="David Beazley",
       author_email="d...@dabeaz.com",
       maintainer="David Beazley",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curio-1.5/tests/test_sync.py 
new/curio-1.6/tests/test_sync.py
--- old/curio-1.5/tests/test_sync.py    2021-03-11 16:52:49.000000000 +0100
+++ new/curio-1.6/tests/test_sync.py    2022-10-25 16:10:57.000000000 +0200
@@ -843,6 +843,40 @@
             False
         ]
 
+    def test_uevent_get_wait_timeout(self, kernel):
+        results = []
+        async def event_setter(evt, seconds):
+            results.append('sleep')
+            await sleep(seconds)
+            results.append('event_set')
+            await evt.set()
+
+        async def event_waiter(evt, seconds):
+            try:
+                results.append('wait_start')
+                await timeout_after(seconds, evt.wait())
+                results.append('wait_done')
+                results.append(evt.is_set())
+            except TaskTimeout:
+                results.append('wait_timeout')
+                results.append(evt.is_set())
+
+        async def main():
+            evt = UniversalEvent()
+            t1 = await spawn(event_waiter, evt, 1)
+            t2 = await spawn(event_setter, evt, 2)
+            await t1.join()
+            await t2.join()
+
+        kernel.run(main())
+        assert results == [
+            'wait_start',
+            'sleep',
+            'wait_timeout',
+            False,
+            'event_set',
+        ]
+        
 class TestResult:
     def test_value(self, kernel):
         

Reply via email to