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

[WIP] PR: Connect console and ipdb kernels #52

Open
wants to merge 30 commits into
base: ipdb
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f822094
Console: Add a method to get its connection file
ccordoba12 Sep 30, 2018
d656319
IPdb: Add a kernelspec class to easily start it
ccordoba12 Sep 30, 2018
207f3cc
SpyderPdb: Add a method to start an IPdb kernel
ccordoba12 Sep 30, 2018
7ebf634
IPdb: Pass to its kernelspec the console kernel connection info
ccordoba12 Oct 1, 2018
9badef3
IPdb: Create a kernel client connected to the console kernel
ccordoba12 Oct 1, 2018
4dccd51
IPdb: Create its own console kernel client for testing purposes
ccordoba12 Oct 2, 2018
08f3b7c
IPdb: Add PdbProxy to send Pdb commands to Pdb instance in console ke…
ccordoba12 Oct 2, 2018
925c946
IPdb: Make code completions work again
ccordoba12 Oct 2, 2018
e412fba
IPdb: Make %down magic work to fix a test
ccordoba12 Oct 2, 2018
74a0818
IPdb: Add error proxy method to fix another test
ccordoba12 Oct 2, 2018
2098d24
IPdb: Remove _get_kernel_ because it makes no sense now
ccordoba12 Oct 2, 2018
f574a12
IPdb: Make matplotlib integration work again
ccordoba12 Oct 3, 2018
b030a5f
IPdb: Make %reset magic work again
ccordoba12 Oct 3, 2018
a5a84d3
IPdb: Make %list magic work again
ccordoba12 Oct 3, 2018
ba41206
Testing: Make tests pass again
ccordoba12 Oct 3, 2018
7cd5ad3
Testing: Increase timeout when waiting for signals to be emitted
ccordoba12 Oct 3, 2018
bcc6f8a
IPdb: Remove code that is not needed anymore
ccordoba12 Oct 3, 2018
0887f19
Merge with ipdb
ccordoba12 Dec 27, 2018
9861649
IPdb: Fix code completions with IPython 7.2+
ccordoba12 Dec 27, 2018
c3ed33d
Testing: Skip a test on Windows because it's failing
ccordoba12 Dec 27, 2018
febfe0d
Testing: Remove teardown part of ipdb_kernel fixture because it's doi…
ccordoba12 Dec 27, 2018
c62dd37
Testing: Increase codecov threshold
ccordoba12 Dec 28, 2018
2bf2fbc
Testing: Skip all ipdb test on Linux and Windows
ccordoba12 Dec 28, 2018
16e495f
IPdb: Refactor code to get a response from the remote Pdb instance
ccordoba12 Dec 31, 2018
642627d
IPdb: Ask for breakpoints to Spyder at startup
ccordoba12 Jan 2, 2019
57d8598
IPdb: Fix Matplotlib tests
ccordoba12 Jan 2, 2019
d04bc48
IPdb: Add a testing kwarg to it to better control how we test it
ccordoba12 Jan 2, 2019
861ada3
Fix syntax error in Python 2
ccordoba12 Jan 2, 2019
bb32eae
IPdb: Skip Matplotlib tests on Windows and Python 2
ccordoba12 Jan 2, 2019
9d62e2e
IPdb: Stop inheriting from BaseKernelMixIn
ccordoba12 Jan 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ coverage:
status:
project:
default:
threshold: 1%
threshold: 5%
patch: no
changes: no

Expand Down
18 changes: 16 additions & 2 deletions spyder_kernels/console/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

# Standard library imports
import json
import pickle
import os

Expand All @@ -24,14 +25,17 @@
class ConsoleKernel(BaseKernelMixIn, IPythonKernel):
"""Spyder kernel for Jupyter"""

def __init__(self, *args, **kwargs):
def __init__(self, testing=False, *args, **kwargs):
super(ConsoleKernel, self).__init__(*args, **kwargs)

self._pdb_obj = None
self._pdb_step = None
self._do_publish_pdb_state = True
self._mpl_backend_error = None

# To test this kernel with the IPdb one
self.testing_ipdb = os.environ.get('SPY_TEST_IPDB_KERNEL') is not None

@property
def _pdb_frame(self):
"""Return current Pdb frame if there is any"""
Expand Down Expand Up @@ -102,7 +106,10 @@ def _set_spyder_breakpoints(self, breakpoints):

def _ask_spyder_for_breakpoints(self):
if self._pdb_obj:
self.send_spyder_msg('set_breakpoints')
if not self.testing_ipdb:
self.send_spyder_msg('set_breakpoints')
else:
self._pdb_obj.starting = False

# --- For Matplotlib
def _set_mpl_backend(self, backend, pylab=False):
Expand Down Expand Up @@ -163,3 +170,10 @@ def _load_wurlitzer(self):
if not os.name == 'nt':
from IPython.core.getipython import get_ipython
get_ipython().run_line_magic('reload_ext', 'wurlitzer')

def _get_connection_info(self):
"""Get kernel's connection info."""
from ipykernel import get_connection_file
with open(get_connection_file()) as f:
info = json.load(f)
return info
3 changes: 2 additions & 1 deletion spyder_kernels/console/tests/test_console_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import pytest

# Local imports
from spyder_kernels.console.kernel import ConsoleKernel
from spyder_kernels.utils.test_utils import get_kernel
from spyder_kernels.py3compat import PY3, to_text_string

Expand All @@ -37,7 +38,7 @@
def console_kernel(request):
"""Console kernel fixture"""
# Get kernel instance
kernel = get_kernel()
kernel = get_kernel(kernel_class=ConsoleKernel)
kernel.namespace_view_settings = {'check_all': False,
'exclude_private': True,
'exclude_uppercase': True,
Expand Down
55 changes: 0 additions & 55 deletions spyder_kernels/ipdb/backend_inline.py

This file was deleted.

Loading