Hello community,

here is the log from the commit of package python-ipykernel for 
openSUSE:Factory checked in at 2020-06-11 14:37:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ipykernel (Old)
 and      /work/SRC/openSUSE:Factory/.python-ipykernel.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ipykernel"

Thu Jun 11 14:37:50 2020 rev:8 rq:810547 version:5.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ipykernel/python-ipykernel.changes        
2020-04-25 20:11:07.391893990 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-ipykernel.new.3606/python-ipykernel.changes  
    2020-06-11 14:37:56.564131126 +0200
@@ -1,0 +2,11 @@
+Sat May 30 23:53:01 UTC 2020 - Arun Persaud <[email protected]>
+
+- update to version 5.3.0:
+  * Fix ipython display imports (:ghpull:`509`)
+  * Skip test_unc_paths if OS is not Windows (:ghpull:`507`)
+  * Allow interrupting input() on Windows, as part of effort to make
+    pdb interruptible (:ghpull:`498`)
+  * Add Trio Loop (:ghpull:`479`)
+  * Flush from process even without newline (:ghpull:`478`)
+
+-------------------------------------------------------------------

Old:
----
  ipykernel-5.2.1.tar.gz

New:
----
  ipykernel-5.3.0.tar.gz

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

Other differences:
------------------
++++++ python-ipykernel.spec ++++++
--- /var/tmp/diff_new_pack.g949KT/_old  2020-06-11 14:37:57.228133025 +0200
+++ /var/tmp/diff_new_pack.g949KT/_new  2020-06-11 14:37:57.228133025 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         skip_python2 1
 Name:           python-ipykernel
-Version:        5.2.1
+Version:        5.3.0
 Release:        0
 Summary:        IPython Kernel for Jupyter
 License:        BSD-3-Clause

++++++ ipykernel-5.2.1.tar.gz -> ipykernel-5.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/PKG-INFO new/ipykernel-5.3.0/PKG-INFO
--- old/ipykernel-5.2.1/PKG-INFO        2020-04-14 21:25:11.000000000 +0200
+++ new/ipykernel-5.3.0/PKG-INFO        2020-05-20 12:18:51.283592200 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: ipykernel
-Version: 5.2.1
+Version: 5.3.0
 Summary: IPython Kernel for Jupyter
 Home-page: https://ipython.org
 Author: IPython Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/docs/changelog.rst 
new/ipykernel-5.3.0/docs/changelog.rst
--- old/ipykernel-5.2.1/docs/changelog.rst      2020-04-14 21:25:03.000000000 
+0200
+++ new/ipykernel-5.3.0/docs/changelog.rst      2020-05-20 12:18:00.000000000 
+0200
@@ -1,6 +1,21 @@
 Changes in IPython kernel
 =========================
 
+5.3
+---
+
+5.3.0
+*****
+
+5.3.0 Adds support for Trio event loops and has some bug fixes.
+
+- Fix ipython display imports (:ghpull:`509`)
+- Skip test_unc_paths if OS is not Windows (:ghpull:`507`)
+- Allow interrupting input() on Windows, as part of effort to make pdb 
interruptible (:ghpull:`498`)
+- Add Trio Loop (:ghpull:`479`)
+- Flush from process even without newline (:ghpull:`478`)
+
+
 5.2
 ---
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/_version.py 
new/ipykernel-5.3.0/ipykernel/_version.py
--- old/ipykernel-5.2.1/ipykernel/_version.py   2020-04-14 21:23:30.000000000 
+0200
+++ new/ipykernel-5.3.0/ipykernel/_version.py   2020-05-20 12:18:39.000000000 
+0200
@@ -1,4 +1,4 @@
-version_info = (5, 2, 1)
+version_info = (5, 3, 0)
 __version__ = '.'.join(map(str, version_info[:3]))
 
 # pep440 is annoying, beta/alpha/rc should _not_ have dots or pip/setuptools
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/iostream.py 
new/ipykernel-5.3.0/ipykernel/iostream.py
--- old/ipykernel-5.2.1/ipykernel/iostream.py   2019-12-06 18:57:22.000000000 
+0100
+++ new/ipykernel-5.3.0/ipykernel/iostream.py   2020-05-20 12:18:00.000000000 
+0200
@@ -296,6 +296,7 @@
         self.parent_header = {}
         self._master_pid = os.getpid()
         self._flush_pending = False
+        self._subprocess_flush_pending = False
         self._io_loop = pub_thread.io_loop
         self._new_buffer()
         self.echo = None
@@ -362,6 +363,7 @@
         unless the thread has been destroyed (e.g. forked subprocess).
         """
         self._flush_pending = False
+        self._subprocess_flush_pending = False
 
         if self.echo is not None:
             try:
@@ -401,11 +403,13 @@
             # only touch the buffer in the IO thread to avoid races
             self.pub_thread.schedule(lambda : self._buffer.write(string))
             if is_child:
-                # newlines imply flush in subprocesses
                 # mp.Pool cannot be trusted to flush promptly (or ever),
                 # and this helps.
-                if '\n' in string:
-                    self.flush()
+                if self._subprocess_flush_pending:
+                    return
+                self._subprocess_flush_pending = True
+                # We can not rely on self._io_loop.call_later from a subprocess
+                self.pub_thread.schedule(self._flush)
             else:
                 self._schedule_flush()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/kernelapp.py 
new/ipykernel-5.3.0/ipykernel/kernelapp.py
--- old/ipykernel-5.2.1/ipykernel/kernelapp.py  2020-03-21 21:58:30.000000000 
+0100
+++ new/ipykernel-5.3.0/ipykernel/kernelapp.py  2020-05-20 12:18:00.000000000 
+0200
@@ -72,6 +72,10 @@
         {'IPKernelApp' : {'pylab' : 'auto'}},
         """Pre-load matplotlib and numpy for interactive use with
         the default matplotlib backend."""),
+    'trio-loop' : (
+        {'InteractiveShell' : {'trio_loop' : False}},
+        'Enable Trio as main event loop.'
+    ),
 })
 
 # inherit flags&aliases for any IPython shell apps
@@ -147,6 +151,7 @@
     # streams, etc.
     no_stdout = Bool(False, help="redirect stdout to the null 
device").tag(config=True)
     no_stderr = Bool(False, help="redirect stderr to the null 
device").tag(config=True)
+    trio_loop = Bool(False, help="Set main event loop.").tag(config=True)
     quiet = Bool(True, help="Only send stdout/stderr to output 
stream").tag(config=True)
     outstream_class = DottedObjectName('ipykernel.iostream.OutStream',
         help="The importstring for the OutStream factory").tag(config=True)
@@ -579,10 +584,19 @@
             self.poller.start()
         self.kernel.start()
         self.io_loop = ioloop.IOLoop.current()
-        try:
-            self.io_loop.start()
-        except KeyboardInterrupt:
-            pass
+        if self.trio_loop:
+            from ipykernel.trio_runner import TrioRunner
+            tr = TrioRunner()
+            tr.initialize(self.kernel, self.io_loop)
+            try:
+                tr.run()
+            except KeyboardInterrupt:
+                pass
+        else:
+            try:
+                self.io_loop.start()
+            except KeyboardInterrupt:
+                pass
 
 
 launch_new_instance = IPKernelApp.launch_instance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/kernelbase.py 
new/ipykernel-5.3.0/ipykernel/kernelbase.py
--- old/ipykernel-5.2.1/ipykernel/kernelbase.py 2020-03-21 21:58:30.000000000 
+0100
+++ new/ipykernel-5.3.0/ipykernel/kernelbase.py 2020-05-20 12:18:00.000000000 
+0200
@@ -867,6 +867,7 @@
         # Flush output before making the request.
         sys.stderr.flush()
         sys.stdout.flush()
+
         # flush the stdin socket, to purge stale replies
         while True:
             try:
@@ -885,14 +886,25 @@
         # Await a response.
         while True:
             try:
-                ident, reply = self.session.recv(self.stdin_socket, 0)
-            except Exception:
-                self.log.warning("Invalid Message:", exc_info=True)
+                # Use polling with select() so KeyboardInterrupts can get
+                # through; doing a blocking recv() means stdin reads are
+                # uninterruptible on Windows. We need a timeout because
+                # zmq.select() is also uninterruptible, but at least this
+                # way reads get noticed immediately and KeyboardInterrupts
+                # get noticed fairly quickly by human response time standards.
+                rlist, _, xlist = zmq.select(
+                    [self.stdin_socket], [], [self.stdin_socket], 0.01
+                )
+                if rlist or xlist:
+                    ident, reply = self.session.recv(self.stdin_socket)
+                    if (ident, reply) != (None, None):
+                        break
             except KeyboardInterrupt:
                 # re-raise KeyboardInterrupt, to truncate traceback
                 raise KeyboardInterrupt("Interrupted by user") from None
-            else:
-                break
+            except Exception as e:
+                self.log.warning("Invalid Message:", exc_info=True)
+        
         try:
             value = py3compat.unicode_to_str(reply['content']['value'])
         except:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/pylab/backend_inline.py 
new/ipykernel-5.3.0/ipykernel/pylab/backend_inline.py
--- old/ipykernel-5.2.1/ipykernel/pylab/backend_inline.py       2020-03-21 
21:58:30.000000000 +0100
+++ new/ipykernel-5.3.0/ipykernel/pylab/backend_inline.py       2020-05-20 
12:18:00.000000000 +0200
@@ -15,7 +15,7 @@
 from matplotlib._pylab_helpers import Gcf
 
 from IPython.core.getipython import get_ipython
-from IPython.core.display import display
+from IPython.display import display
 
 from .config import InlineBackend
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/tests/test_kernel.py 
new/ipykernel-5.3.0/ipykernel/tests/test_kernel.py
--- old/ipykernel-5.2.1/ipykernel/tests/test_kernel.py  2020-04-14 
21:21:45.000000000 +0200
+++ new/ipykernel-5.3.0/ipykernel/tests/test_kernel.py  2020-05-20 
12:18:00.000000000 +0200
@@ -256,7 +256,7 @@
         assert reply['content']['status'] == 'complete'
 
 
[email protected](sys.platform.startswith('linux'))
[email protected](sys.platform != 'win32', "only run on Windows")
 def test_complete():
     with kernel() as kc:
         execute(u'a = 1', kc=kc)
@@ -361,3 +361,21 @@
             else:
                 break
         assert not km.is_alive()
+
+
+def test_interrupt_during_input():
+    """
+    The kernel exits after being interrupted while waiting in input().
+    
+    input() appears to have issues other functions don't, and it needs to be
+    interruptible in order for pdb to be interruptible.
+    """
+    with new_kernel() as kc:
+        km = kc.parent
+        msg_id = kc.execute("input()")
+        time.sleep(1)  # Make sure it's actually waiting for input.
+        km.interrupt_kernel()
+        # If we failed to interrupt interrupt, this will timeout:
+        reply = kc.get_shell_msg(timeout=TIMEOUT)
+        from .test_message_spec import validate_message
+        validate_message(reply, 'execute_reply', msg_id)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/tests/test_message_spec.py 
new/ipykernel-5.3.0/ipykernel/tests/test_message_spec.py
--- old/ipykernel-5.2.1/ipykernel/tests/test_message_spec.py    2019-12-06 
18:57:22.000000000 +0100
+++ new/ipykernel-5.3.0/ipykernel/tests/test_message_spec.py    2020-05-20 
12:18:00.000000000 +0200
@@ -541,7 +541,7 @@
 def test_display_data():
     flush_channels()
 
-    msg_id, reply = execute("from IPython.core.display import display; 
display(1)")
+    msg_id, reply = execute("from IPython.display import display; display(1)")
 
     display = KC.iopub_channel.get_msg(timeout=TIMEOUT)
     validate_message(display, 'display_data', parent=msg_id)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel/trio_runner.py 
new/ipykernel-5.3.0/ipykernel/trio_runner.py
--- old/ipykernel-5.2.1/ipykernel/trio_runner.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/ipykernel-5.3.0/ipykernel/trio_runner.py        2020-05-20 
12:18:00.000000000 +0200
@@ -0,0 +1,60 @@
+import builtins
+import logging
+import signal
+import threading
+import traceback
+import warnings
+
+import trio
+
+
+class TrioRunner:
+    def __init__(self):
+        self._cell_cancel_scope = None
+        self._trio_token = None
+
+    def initialize(self, kernel, io_loop):
+        kernel.shell.set_trio_runner(self)
+        kernel.shell.run_line_magic('autoawait', 'trio')
+        kernel.shell.magics_manager.magics['line']['autoawait'] = \
+            lambda _: warnings.warn("Autoawait isn't allowed in Trio "
+                "background loop mode.")
+        bg_thread = threading.Thread(target=io_loop.start, daemon=True,
+            name='TornadoBackground')
+        bg_thread.start()
+
+    def interrupt(self, signum, frame):
+        if self._cell_cancel_scope:
+            self._cell_cancel_scope.cancel()
+        else:
+            raise Exception('Kernel interrupted but no cell is running')
+
+    def run(self):
+        old_sig = signal.signal(signal.SIGINT, self.interrupt)
+
+        def log_nursery_exc(exc):
+            exc = '\n'.join(traceback.format_exception(type(exc), exc,
+                exc.__traceback__))
+            logging.error('An exception occurred in a global nursery 
task.\n%s',
+                exc)
+
+        async def trio_main():
+            self._trio_token = trio.hazmat.current_trio_token()
+            async with trio.open_nursery() as nursery:
+                # TODO This hack prevents the nursery from cancelling all child
+                # tasks when an uncaught exception occurs, but it's ugly.
+                nursery._add_exc = log_nursery_exc
+                builtins.GLOBAL_NURSERY = nursery
+                await trio.sleep_forever()
+
+        trio.run(trio_main)
+        signal.signal(signal.SIGINT, old_sig)
+
+    def __call__(self, async_fn):
+        async def loc(coro):
+            self._cell_cancel_scope = trio.CancelScope()
+            with self._cell_cancel_scope:
+                return await coro
+            self._cell_cancel_scope = None
+
+        return trio.from_thread.run(loc, async_fn, trio_token=self._trio_token)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel.egg-info/PKG-INFO 
new/ipykernel-5.3.0/ipykernel.egg-info/PKG-INFO
--- old/ipykernel-5.2.1/ipykernel.egg-info/PKG-INFO     2020-04-14 
21:25:11.000000000 +0200
+++ new/ipykernel-5.3.0/ipykernel.egg-info/PKG-INFO     2020-05-20 
12:18:50.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: ipykernel
-Version: 5.2.1
+Version: 5.3.0
 Summary: IPython Kernel for Jupyter
 Home-page: https://ipython.org
 Author: IPython Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipykernel-5.2.1/ipykernel.egg-info/SOURCES.txt 
new/ipykernel-5.3.0/ipykernel.egg-info/SOURCES.txt
--- old/ipykernel-5.2.1/ipykernel.egg-info/SOURCES.txt  2020-04-14 
21:25:11.000000000 +0200
+++ new/ipykernel-5.3.0/ipykernel.egg-info/SOURCES.txt  2020-05-20 
12:18:50.000000000 +0200
@@ -38,6 +38,7 @@
 ipykernel/parentpoller.py
 ipykernel/pickleutil.py
 ipykernel/serialize.py
+ipykernel/trio_runner.py
 ipykernel/zmqshell.py
 ipykernel.egg-info/PKG-INFO
 ipykernel.egg-info/SOURCES.txt


Reply via email to