Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ipykernel for openSUSE:Factory checked in at 2022-02-11 23:07:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ipykernel (Old) and /work/SRC/openSUSE:Factory/.python-ipykernel.new.1956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ipykernel" Fri Feb 11 23:07:08 2022 rev:20 rq:953119 version:6.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ipykernel/python-ipykernel.changes 2022-01-17 22:33:49.946235250 +0100 +++ /work/SRC/openSUSE:Factory/.python-ipykernel.new.1956/python-ipykernel.changes 2022-02-11 23:08:14.362744120 +0100 @@ -1,0 +2,19 @@ +Thu Feb 10 05:16:05 UTC 2022 - Arun Persaud <a...@gmx.de> + +- update to version 6.9.0: + * Bugs fixed + + Fixed event forwarding #855 (@JohanMabille) + + use message queue for abort_queues #853 (@minrk) + +- changes from version 6.8.0: + * Enhancements made + + Add support for the debug modules request #816 (@echarles) + * Bugs fixed + + Handle all threads stopped correctly #849 (@JohanMabille) + + Fix the debug modules model #848 (@echarles) + + Handled AllThreadsContinued and workaround for wrong threadId in + cont??? #844 (@JohanMabille) + * Maintenance and upkeep improvements + + Cancel duplicate runs #850 (@blink1073) + +------------------------------------------------------------------- Old: ---- ipykernel-6.7.0.tar.gz New: ---- ipykernel-6.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ipykernel.spec ++++++ --- /var/tmp/diff_new_pack.AvHuQM/_old 2022-02-11 23:08:15.030745975 +0100 +++ /var/tmp/diff_new_pack.AvHuQM/_new 2022-02-11 23:08:15.034745987 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-ipykernel -Version: 6.7.0 +Version: 6.9.0 Release: 0 Summary: IPython Kernel for Jupyter License: BSD-3-Clause @@ -86,7 +86,7 @@ %if 0%{?suse_version} >= 1550 # use the symlink for the default python3 flavor, which was installed during the install but used python3.X name # from the primary flavor. -sed -i "s|$(readlink -f %{__python3})|%{__python3}|" %{buildroot}%{_jupyter_kernel_dir}/python3/kernel.json +sed -i "s|$(readlink -f python3)|python3|" %{buildroot}%{_jupyter_kernel_dir}/python3/kernel.json %{python_expand # install kernelspecs for each flavor PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m ipykernel install \ ++++++ ipykernel-6.7.0.tar.gz -> ipykernel-6.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/CHANGELOG.md new/ipykernel-6.9.0/CHANGELOG.md --- old/ipykernel-6.7.0/CHANGELOG.md 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/CHANGELOG.md 2022-02-07 18:18:56.000000000 +0100 @@ -2,6 +2,47 @@ <!-- <START NEW CHANGELOG ENTRY> --> +## 6.9.0 + +([Full Changelog](https://github.com/ipython/ipykernel/compare/v6.8.0...7a229c6c83d44d315f637ef63159a43c64ec73d6)) + +### Bugs fixed + +- Fixed event forwarding [#855](https://github.com/ipython/ipykernel/pull/855) ([@JohanMabille](https://github.com/JohanMabille)) +- use message queue for abort_queues [#853](https://github.com/ipython/ipykernel/pull/853) ([@minrk](https://github.com/minrk)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/ipython/ipykernel/graphs/contributors?from=2022-02-01&to=2022-02-07&type=c)) + +[@blink1073](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Ablink1073+updated%3A2022-02-01..2022-02-07&type=Issues) | [@JohanMabille](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3AJohanMabille+updated%3A2022-02-01..2022-02-07&type=Issues) | [@minrk](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Aminrk+updated%3A2022-02-01..2022-02-07&type=Issues) + +<!-- <END NEW CHANGELOG ENTRY> --> + +## 6.8.0 + +([Full Changelog](https://github.com/ipython/ipykernel/compare/v6.7.0...4e775b70e7e1be7e96fe7c3c747f21f3d93f0181)) + +### Enhancements made + +- Add support for the debug modules request [#816](https://github.com/ipython/ipykernel/pull/816) ([@echarles](https://github.com/echarles)) + +### Bugs fixed + +- Handle all threads stopped correctly [#849](https://github.com/ipython/ipykernel/pull/849) ([@JohanMabille](https://github.com/JohanMabille)) +- Fix the debug modules model [#848](https://github.com/ipython/ipykernel/pull/848) ([@echarles](https://github.com/echarles)) +- Handled AllThreadsContinued and workaround for wrong threadId in cont??? [#844](https://github.com/ipython/ipykernel/pull/844) ([@JohanMabille](https://github.com/JohanMabille)) + +### Maintenance and upkeep improvements + +- Cancel duplicate runs [#850](https://github.com/ipython/ipykernel/pull/850) ([@blink1073](https://github.com/blink1073)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/ipython/ipykernel/graphs/contributors?from=2022-01-13&to=2022-02-01&type=c)) + +[@blink1073](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Ablink1073+updated%3A2022-01-13..2022-02-01&type=Issues) | [@echarles](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Aecharles+updated%3A2022-01-13..2022-02-01&type=Issues) | [@JohanMabille](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3AJohanMabille+updated%3A2022-01-13..2022-02-01&type=Issues) + ## 6.7.0 ([Full Changelog](https://github.com/ipython/ipykernel/compare/v6.6.1...0be80cbc81927f4fb20343840bf5834b48884717)) @@ -28,8 +69,6 @@ [@Carreau](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3ACarreau+updated%3A2022-01-03..2022-01-13&type=Issues) | [@echarles](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Aecharles+updated%3A2022-01-03..2022-01-13&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Afcollonval+updated%3A2022-01-03..2022-01-13&type=Issues) | [@JohanMabille](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3AJohanMabille+updated%3A2022-01-03..2022-01-13&type=Issues) | [@kycutler](https://github.com/search?q=repo%3Aipython%2Fipykernel+involves%3Akycutler+updated%3A2022-01-03..2022-01-13&type=Issues) -<!-- <END NEW CHANGELOG ENTRY> --> - ## 6.6.1 ([Full Changelog](https://github.com/ipython/ipykernel/compare/v6.6.0...bdce14b32ca8cc8f4b1635ea47200f0828ec1e05)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/PKG-INFO new/ipykernel-6.9.0/PKG-INFO --- old/ipykernel-6.7.0/PKG-INFO 2022-01-13 16:19:22.699461200 +0100 +++ new/ipykernel-6.9.0/PKG-INFO 2022-02-07 18:19:33.637899900 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ipykernel -Version: 6.7.0 +Version: 6.9.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-6.7.0/ipykernel/_version.py new/ipykernel-6.9.0/ipykernel/_version.py --- old/ipykernel-6.7.0/ipykernel/_version.py 2022-01-13 16:18:57.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/_version.py 2022-02-07 18:19:15.000000000 +0100 @@ -4,7 +4,7 @@ import re # Version string must appear intact for tbump versioning -__version__ = '6.7.0' +__version__ = '6.9.0' # Build up version_info tuple for backwards compatibility pattern = r'(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/control.py new/ipykernel-6.9.0/ipykernel/control.py --- old/ipykernel-6.7.0/ipykernel/control.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/control.py 2022-02-07 18:18:56.000000000 +0100 @@ -10,12 +10,13 @@ class ControlThread(Thread): def __init__(self, **kwargs): - Thread.__init__(self, **kwargs) + Thread.__init__(self, name="Control", **kwargs) self.io_loop = IOLoop(make_current=False) self.pydev_do_not_trace = True self.is_pydev_daemon_thread = True def run(self): + self.name = "Control" self.io_loop.make_current() try: self.io_loop.start() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/debugger.py new/ipykernel-6.9.0/ipykernel/debugger.py --- old/ipykernel-6.7.0/ipykernel/debugger.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/debugger.py 2022-02-07 18:18:56.000000000 +0100 @@ -1,5 +1,7 @@ +import sys import os import re +import threading import zmq from zmq.utils import jsonapi @@ -264,7 +266,8 @@ # Requests that can be handled even if the debugger is not running static_debug_msg_types = [ - 'debugInfo', 'inspectVariables', 'richInspectVariables' + 'debugInfo', 'inspectVariables', + 'richInspectVariables', 'modules' ] def __init__(self, log, debugpy_stream, event_callback, shell_socket, session): @@ -274,6 +277,7 @@ self.session = session self.is_started = False self.event_callback = event_callback + self.stopped_queue = Queue() self.started_debug_handlers = {} for msg_type in Debugger.started_debug_msg_types: @@ -284,7 +288,7 @@ self.static_debug_handlers[msg_type] = getattr(self, msg_type) self.breakpoint_list = {} - self.stopped_threads = [] + self.stopped_threads = set() self.debugpy_initialized = False self._removed_cleanup = {} @@ -297,13 +301,21 @@ def _handle_event(self, msg): if msg['event'] == 'stopped': - self.stopped_threads.append(msg['body']['threadId']) + if msg['body']['allThreadsStopped']: + self.stopped_queue.put_nowait(msg) + # Do not forward the event now, will be done in the handle_stopped_event + return + else: + self.stopped_threads.add(msg['body']['threadId']) + self.event_callback(msg) elif msg['event'] == 'continued': - try: + if msg['body']['allThreadsContinued']: + self.stopped_threads = set() + else: self.stopped_threads.remove(msg['body']['threadId']) - except Exception: - pass - self.event_callback(msg) + self.event_callback(msg) + else: + self.event_callback(msg) async def _forward_message(self, msg): return await self.debugpy_client.send_dap_request(msg) @@ -322,6 +334,32 @@ } return reply + def _accept_stopped_thread(self, thread_name): + # TODO: identify Thread-2, Thread-3 and Thread-4. These are NOT + # Control, IOPub or Heartbeat threads + forbid_list = [ + 'IPythonHistorySavingThread', + 'Thread-2', + 'Thread-3', + 'Thread-4' + ] + return thread_name not in forbid_list + + async def handle_stopped_event(self): + # Wait for a stopped event message in the stopped queue + # This message is used for triggering the 'threads' request + event = await self.stopped_queue.get() + req = { + 'seq': event['seq'] + 1, + 'type': 'request', + 'command': 'threads' + } + rep = await self._forward_message(req) + for t in rep['body']['threads']: + if self._accept_stopped_thread(t['name']): + self.stopped_threads.add(t['id']) + self.event_callback(event) + @property def tcp_client(self): return self.debugpy_client @@ -513,7 +551,7 @@ 'tmpFilePrefix': get_tmp_directory() + os.sep, 'tmpFileSuffix': '.py', 'breakpoints': breakpoint_list, - 'stoppedThreads': self.stopped_threads, + 'stoppedThreads': list(self.stopped_threads), 'richRendering': True, 'exceptionPaths': ['Python Exceptions'] } @@ -581,6 +619,24 @@ reply["success"] = True return reply + async def modules(self, message): + modules = list(sys.modules.values()) + startModule = message.get('startModule', 0) + moduleCount = message.get('moduleCount', len(modules)) + mods = [] + for i in range(startModule, moduleCount): + module = modules[i] + filename = getattr(getattr(module, '__spec__', None), 'origin', None) + if filename and filename.endswith('.py'): + mods.append({ + 'id': i, + 'name': module.__name__, + 'path': filename + }) + + reply = {'body': {'modules': mods, 'totalModules': len(modules)}} + return reply + async def process_request(self, message): reply = {} @@ -613,7 +669,7 @@ if message['command'] == 'disconnect': self.stop() self.breakpoint_list = {} - self.stopped_threads = [] + self.stopped_threads = set() self.is_started = False self.log.info('The debugger has stopped') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/heartbeat.py new/ipykernel-6.9.0/ipykernel/heartbeat.py --- old/ipykernel-6.7.0/ipykernel/heartbeat.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/heartbeat.py 2022-02-07 18:18:56.000000000 +0100 @@ -32,7 +32,7 @@ def __init__(self, context, addr=None): if addr is None: addr = ('tcp', localhost(), 0) - Thread.__init__(self) + Thread.__init__(self, name="Heartbeat") self.context = context self.transport, self.ip, self.port = addr self.original_port = self.port @@ -42,6 +42,7 @@ self.daemon = True self.pydev_do_not_trace = True self.is_pydev_daemon_thread = True + self.name = "Heartbeat" def pick_port(self): if self.transport == 'tcp': @@ -89,6 +90,7 @@ return def run(self): + self.name = "Heartbeat" self.socket = self.context.socket(zmq.ROUTER) self.socket.linger = 1000 try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/iostream.py new/ipykernel-6.9.0/ipykernel/iostream.py --- old/ipykernel-6.7.0/ipykernel/iostream.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/iostream.py 2022-02-07 18:18:56.000000000 +0100 @@ -70,10 +70,11 @@ self._events = deque() self._event_pipes = WeakSet() self._setup_event_pipe() - self.thread = threading.Thread(target=self._thread_main) + self.thread = threading.Thread(target=self._thread_main, name="IOPub") self.thread.daemon = True self.thread.pydev_do_not_trace = True self.thread.is_pydev_daemon_thread = True + self.thread.name = "IOPub" def _thread_main(self): """The inner loop that's actually run in a thread""" @@ -176,6 +177,7 @@ def start(self): """Start the IOPub thread""" + self.thread.name = "IOPub" self.thread.start() # make sure we don't prevent process exit # I'm not sure why setting daemon=True above isn't enough, but it doesn't appear to be. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/ipkernel.py new/ipykernel-6.9.0/ipykernel/ipkernel.py --- old/ipykernel-6.7.0/ipykernel/ipkernel.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/ipkernel.py 2022-02-07 18:18:56.000000000 +0100 @@ -169,6 +169,10 @@ def banner(self): return self.shell.banner + async def poll_stopped_queue(self): + while True: + await self.debugger.handle_stopped_event() + def start(self): self.shell.exit_now = False if self.debugpy_stream is None: @@ -176,6 +180,8 @@ else: self.debugpy_stream.on_recv(self.dispatch_debugpy, copy=False) super().start() + if self.debugpy_stream: + asyncio.run_coroutine_threadsafe(self.poll_stopped_queue(), self.control_thread.io_loop.asyncio_loop) def set_parent(self, ident, parent, channel='shell'): """Overridden from parent to tell the display hook and output streams diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/kernelbase.py new/ipykernel-6.9.0/ipykernel/kernelbase.py --- old/ipykernel-6.7.0/ipykernel/kernelbase.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/kernelbase.py 2022-02-07 18:18:56.000000000 +0100 @@ -671,7 +671,7 @@ self.log.debug("%s", reply_msg) if not silent and reply_msg['content']['status'] == 'error' and stop_on_error: - await self._abort_queues() + self._abort_queues() def do_execute(self, code, silent, store_history=True, user_expressions=None, allow_stdin=False): @@ -974,13 +974,31 @@ _aborting = Bool(False) - async def _abort_queues(self): - self.shell_stream.flush() + def _abort_queues(self): + # while this flag is true, + # execute requests will be aborted self._aborting = True + self.log.info("Aborting queue") + + # flush streams, so all currently waiting messages + # are added to the queue + self.shell_stream.flush() + + # Callback to signal that we are done aborting def stop_aborting(): self.log.info("Finishing abort") self._aborting = False - asyncio.get_event_loop().call_later(self.stop_on_error_timeout, stop_aborting) + + # put the stop-aborting event on the message queue + # so that all messages already waiting in the queue are aborted + # before we reset the flag + schedule_stop_aborting = partial(self.schedule_dispatch, stop_aborting) + + # if we have a delay, give messages this long to arrive on the queue + # before we stop aborting requests + asyncio.get_event_loop().call_later( + self.stop_on_error_timeout, schedule_stop_aborting + ) def _send_abort_reply(self, stream, msg, idents): """Send a reply to an aborted request""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/tests/test_debugger.py new/ipykernel-6.9.0/ipykernel/tests/test_debugger.py --- old/ipykernel-6.7.0/ipykernel/tests/test_debugger.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/tests/test_debugger.py 2022-02-07 18:18:56.000000000 +0100 @@ -227,6 +227,7 @@ f(2, 3)""" + r = wait_for_debug_request(kernel_with_debug, "dumpCell", {"code": code}) source = r["body"]["sourcePath"] @@ -246,6 +247,11 @@ kernel_with_debug.execute(code) + # Wait for stop on breakpoint + msg = {"msg_type": "", "content": {}} + while msg.get('msg_type') != 'debug_event' or msg["content"].get("event") != "stopped": + msg = kernel_with_debug.get_iopub_msg(timeout=TIMEOUT) + stacks = wait_for_debug_request(kernel_with_debug, "stackTrace", {"threadId": 1})[ "body" ]["stackFrames"] @@ -276,4 +282,4 @@ def test_convert_to_long_pathname(): if sys.platform == 'win32': from ipykernel.compiler import _convert_to_long_pathname - _convert_to_long_pathname(__file__) \ No newline at end of file + _convert_to_long_pathname(__file__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel/tests/test_message_spec.py new/ipykernel-6.9.0/ipykernel/tests/test_message_spec.py --- old/ipykernel-6.7.0/ipykernel/tests/test_message_spec.py 2022-01-13 16:18:27.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel/tests/test_message_spec.py 2022-02-07 18:18:56.000000000 +0100 @@ -341,15 +341,23 @@ """execute request should not abort execution queue with stop_on_error False""" flush_channels() - fail = '\n'.join([ - # sleep to ensure subsequent message is waiting in the queue to be aborted - 'import time', - 'time.sleep(0.5)', - 'raise ValueError', - ]) + fail = "\n".join( + [ + # sleep to ensure subsequent message is waiting in the queue to be aborted + # async sleep to ensure coroutines are processing while this happens + "import asyncio", + "await asyncio.sleep(1)", + "raise ValueError()", + ] + ) KC.execute(code=fail) KC.execute(code='print("Hello")') - KC.get_shell_msg(timeout=TIMEOUT) + KC.execute(code='print("world")') + reply = KC.get_shell_msg(timeout=TIMEOUT) + print(reply) + reply = KC.get_shell_msg(timeout=TIMEOUT) + assert reply["content"]["status"] == "aborted" + # second message, too reply = KC.get_shell_msg(timeout=TIMEOUT) assert reply['content']['status'] == 'aborted' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipykernel-6.7.0/ipykernel.egg-info/PKG-INFO new/ipykernel-6.9.0/ipykernel.egg-info/PKG-INFO --- old/ipykernel-6.7.0/ipykernel.egg-info/PKG-INFO 2022-01-13 16:19:22.000000000 +0100 +++ new/ipykernel-6.9.0/ipykernel.egg-info/PKG-INFO 2022-02-07 18:19:33.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ipykernel -Version: 6.7.0 +Version: 6.9.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-6.7.0/pyproject.toml new/ipykernel-6.9.0/pyproject.toml --- old/ipykernel-6.7.0/pyproject.toml 2022-01-13 16:18:57.000000000 +0100 +++ new/ipykernel-6.9.0/pyproject.toml 2022-02-07 18:19:15.000000000 +0100 @@ -16,7 +16,7 @@ skip = ["check-links"] [tool.tbump.version] -current = "6.7.0" +current = "6.9.0" regex = ''' (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+) ((?P<channel>a|b|rc|.dev)(?P<release>\d+))?