IBM / pyflowgraph

Flow graphs for Python
Apache License 2.0
25 stars 8 forks source link

Kernel broken on IPython v7.0 #6

Open epatters opened 5 years ago

epatters commented 5 years ago

Our custom IPython kernel is broken on IPython v7.0 and later. Because the IPython team dropped Python 2.7 support in that release, they were able to adopt asyncio in the kernel. The kernel API now uses coroutines.

By far the simplest fix is to just drop our own Python 2.7 support for the kernel. (We can retain Python 2.7 compatibility in other parts of the codebase.)

ioana-blue commented 5 years ago

+1 for dropping support for 2.7

epatters commented 5 years ago

I'm postponing fixing this not-too-important feature.

It will be less trivial than I initially hoped because asynchronicity has been push all the way down the stack, including into IPython's InteractiveShell, making it hard to activate the tracer at the right time by overriding methods. Instead, I think I will have to use the InteractiveShell's ast_transformers to wrap the user code in a Tracer context mananger. I'm noting this for future reference.

epatters commented 5 years ago

With the arrival of #19, this should be easier to fix. We no longer need to call sys.settrace at just the right moment. We just need to install our AST transformers, which IPython already allows.