Closed bnavigator closed 1 year ago
Thanks for the report! Looks like this is going to take some digging to fix.
In the (likely) scenario that this is an involved fix, we should at a minimum update the setup.py
to require ipykernel < 6
until we have time to solve this.
We're starting to hit this in Fedora Rawhide as well.
Ping - any progress here?
Ping - any progress here?
Getting Envisage working with ipykernel >= 6 isn't on our roadmap any time soon, I'm afraid: it's a complex and time-consuming task that requires digging into the ipykernel internals. Priorities for Enthought employees are mostly driven by internal needs, and this isn't (currently) something we need internally. If there are external users who need this, PRs would be welcome.
What we can and should do to aid packagers is make sure that the test suite passes in an environment with ipykernel >= 6 installed (simply by skipping the relevant tests). I'll open a separate issue for that. We also need to get a release out at some point in the near future.
Opened #456.
We also need to avoid the recently-released IPython 8. I've updated the PR #457 accordingly.
Some debugging notes, in case I get called away and don't return for a while:
envisage.plugins.ipython_kernel.tests.test_internal_ipkernel.TestInternalIPKernel.test_shutdown_restores_sys_path
pass, working on the branch for PR #461. That test is currently hanging at a self.context.term()
call in Envisage's own IPKernelApp
. At the point of the hang, the context still has two open sockets (one of type STREAM
and one of type XREQ
), which may be the reason for the hang. I'm currently trying to establish where those sockets are created.Here are tracebacks for the socket creation:
Creating socket 11
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/__main__.py", line 18, in <module>
main(module=None)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/main.py", line 101, in __init__
self.runTests()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/main.py", line 271, in runTests
self.result = testRunner.run(self.test)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/runner.py", line 184, in run
test(result)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 650, in __call__
return self.run(*args, **kwds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 142, in test_shutdown_restores_sys_path
self.create_and_destroy_kernel()
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 318, in create_and_destroy_kernel
kernel.init_ipkernel(gui_backend=None)
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 104, in init_ipkernel
self.ipkernel = _gui_kernel(gui_backend)
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 43, in _gui_kernel
kernel.initialize(argv)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/traitlets/config/application.py", line 88, in inner
return method(app, *args, **kwargs)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 632, in initialize
self.init_sockets()
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 297, in init_sockets
self.init_control(context)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 306, in init_control
self.debugpy_socket = context.socket(zmq.STREAM)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/zmq/sugar/context.py", line 264, in socket
import traceback; traceback.print_stack()
Created socket <zmq.Socket(zmq.STREAM) at 0x1090ed4e0>
Creating socket 5
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/__main__.py", line 18, in <module>
main(module=None)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/main.py", line 101, in __init__
self.runTests()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/main.py", line 271, in runTests
self.result = testRunner.run(self.test)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/runner.py", line 184, in run
test(result)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/suite.py", line 122, in run
test(result)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 650, in __call__
return self.run(*args, **kwds)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 142, in test_shutdown_restores_sys_path
self.create_and_destroy_kernel()
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/tests/test_internal_ipkernel.py", line 318, in create_and_destroy_kernel
kernel.init_ipkernel(gui_backend=None)
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 104, in init_ipkernel
self.ipkernel = _gui_kernel(gui_backend)
File "/Users/mdickinson/Enthought/ETS/envisage/envisage/plugins/ipython_kernel/internal_ipkernel.py", line 43, in _gui_kernel
kernel.initialize(argv)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/traitlets/config/application.py", line 88, in inner
return method(app, *args, **kwargs)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 632, in initialize
self.init_sockets()
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 297, in init_sockets
self.init_control(context)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 309, in init_control
self.debug_shell_socket = context.socket(zmq.DEALER)
File "/Users/mdickinson/.venvs/envisage/lib/python3.10/site-packages/zmq/sugar/context.py", line 264, in socket
import traceback; traceback.print_stack()
Created socket <zmq.Socket(zmq.XREQ) at 0x1090ed5a0>
Looks like this is the relevant source, in ipykernel/kernelapp.py
self.debugpy_socket = context.socket(zmq.STREAM)
self.debugpy_socket.linger = 1000
self.debug_shell_socket = context.socket(zmq.DEALER)
self.debug_shell_socket.linger = 1000
Here's the upstream PR that introduced the relevant new machinery: https://github.com/ipython/ipykernel/pull/597
Closing: IPython components have been removed from Envisage.
Trying to build envisage 6.0.1 on openSUSE Tumbleweed: