-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc IPython 9 compatibility #931
Conversation
just needed a couple ANSI constants
less sensitive to implementation details, use public imports
@Carreau you don't need to do the IPython release if you don't want, there are a couple other 9.0 compatibility fixes needed and I can do the release today. |
no that's ok, I was expecting 9.0 to break a couple of things, and was quasi certain there would be a 9.0.1 |
I also imported the internal |
IPython 9.0.1 should be out. |
There also appears to be something different about matplotlib registration, because calling
which I guess means the inline backend hasn't been registered yet? Weirdly, this same call works fine in both terminal IPython and |
test matplotlib directly
Ah, apparently ipykernel sets MPLBACKEND=module://matplotlib_inline.backend_inline which is apparently required for |
make sure to pre-init gui integration and load extensions
maybe it's something weird about my environment, but calling |
most of the inline matplotlib stuff should be in matplotlib-inline now. |
Yes, but there seem to be some circular things in how the inline backend is loaded. I'm seeing:
I'm not sure why it's fully loading the default backend with event loop integration (and then doing something incorrect with the event loop hook) before loading the inline backend. This seems like possibly a bug in the inline backend, but maybe also a bug in IPython and/or ipykernel, because |
Ah, looks like the call to convert from matplotlib is added to terminal IPython in a place that's not inherited by ipykernel. I guess ipykernel needs an update for that. But still, I think the hookup of the inline backend should perhaps avoid fully loading the default backend, if possible. I think maybe that's what this bit in pylabtools.activate_matplotlib aims to do, but at least in IPython 9, it is not running early enough to have the desired effect. |
Looks like this issue is already open as ipython/matplotlib-inline#25 and fixed by ipython/matplotlib-inline#38 so a fresh release of matplotlib-inline will solve it. |
just needed a couple ANSI constants
avoids losing the behavior dropped by #924