The parallel magics did work with the new code, but I didn't touch the magic, as they were still for IPython.kernel. Now that IPython.kernel is out of the way, I should give the parallelmagic an update, to make it better match newparallel.
Also, %autopx is now broken, I believe due to the recent AST merge. %autopx hijacked run_source, but as far as I can tell, that's never called anymore.
Thanks, I think I've figured it out enough for interactive use. However, it doesn't work from inside %run or irunner.
If I have a script containing:
%autopx should hijack execution until %autopx is called again, but this doesn't happen. I believe this is because the whole file gets run inside a single run_cell. Is there not a way to hijack individual lines anymore?
It looks like hijacking run_code is my only option, but I'm pretty sure I need the source, not the code objects.
This is a general issue. I expect there are several behaviors no longer consistent between %run/irunner and interactive execution, when manipulating the ipython object.
If they are pickleable, then I think I should be fine. Of course, it also requires that I can execute code that would raise NameErrors locally.
Splitting run_ast_nodes so that it calls run_code for each node, rather than for the whole set, seems to fix much of the issue. Then, all I need to do is override run_code, and it works.
closed by e68cf3a