Skip to content
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

PR: Remove IPython kernels from the Python console and connect directly to them #2878

Merged
merged 184 commits into from
Sep 14, 2016

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Dec 22, 2015

Fixes #1860
Fixes #2696
Fixes #2790
Fixes #2844
Fixes #2846
Fixes #2918
Fixes #2945
Fixes #3011
Fixes #3109


This is our fourth iteration(!) to integrate qtconsole within Spyder. The first one was created by Pierre in 2.1, and I Improved what he did in 2.2 and again in 2.3.

The idea this time is to avoid creating IPython kernels as widgets in the Python console, and instead talk to them directly. Of course, this is a major undertaking and so I've been procrastinating to do it for a long time! :-)

The advantages of this approach are:

  • Remove perhaps the ugliest UX present in Spyder at the moment
  • Avoid a ton of intricate code to maintain kernels and IPython consoles in sync
  • A promising approach to improve our debugging experience in a future release (4.0?)

Tasks:

  • Reestablish connection with the Editor
  • Reestablish connection with the Help plugin
  • Reestablish connection with the Variable Explorer (this is the hardest task!)
  • Remove unneeded code from the Python console

@dhirschfeld
Copy link
Contributor

FYI: On this branch I can't open an IPython console - I get the below error in the internal console:

>>> Traceback (most recent call last):
  File "C:\Users\Dave\Code\spyder\spyderlib\plugins\__init__.py", line 503, in <lambda>
    toggled=lambda checked: self.toggle_view(checked),
  File "C:\Users\Dave\Code\spyder\spyderlib\plugins\ipythonconsole.py", line 689, in toggle_view
    self.create_new_client(give_focus=False)
  File "C:\Users\Dave\Code\spyder\spyderlib\plugins\ipythonconsole.py", line 876, in create_new_client
    self.connect_client_to_kernel(client)
  File "C:\Users\Dave\Code\spyder\spyderlib\plugins\ipythonconsole.py", line 1126, in connect_client_to_kernel
    client.password)
  File "C:\Users\Dave\Code\spyder\spyderlib\plugins\ipythonconsole.py", line 1098, in create_kernel_manager_and_client
    kernel_manager.kernel_spec = self.create_kernel_spec()
AttributeError: can't set attribute

@ccordoba12
Copy link
Member Author

@dhirschfeld, thanks for testing. I'll see what's happening :-)

@ccordoba12 ccordoba12 changed the title PR: [WIP] Remove IPython kernels from the Python console and connect directly to them PR: Remove IPython kernels from the Python console and connect directly to them Sep 14, 2016
@ccordoba12
Copy link
Member Author

I think this one is finally ready!! There are some missing things (like inspecting values in the Variable Explorer while debugging) but I'll fix them in 3.1.

For now the most important things are working, i.e. the connections with the Editor, Help and Variable Explorer in normal mode.

@goanpeca
Copy link
Member

👍

@ccordoba12
Copy link
Member Author

Perhaps what I did is not the best approach (we could have used comm messages for some parts), but it's working for now ;-)

@ccordoba12 ccordoba12 merged commit 87f98bd into spyder-ide:master Sep 14, 2016
@ccordoba12 ccordoba12 deleted the connect-ipykernels-to-varexp branch September 14, 2016 21:07
@goanpeca
Copy link
Member

Lets create an issue so we can track these things you suggest we use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants