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

Simplify debugger classes. #9731

Merged
merged 1 commit into from Jul 19, 2016
Merged

Simplify debugger classes. #9731

merged 1 commit into from Jul 19, 2016

Conversation

@anntzer
Copy link
Contributor

anntzer commented Jul 10, 2016

Directly get the color scheme from the interactive shell (which is
created if not already present, anyways). The goal is ultimately to
allow the IPython debugger to be a drop-in replacement of the stdlib pdb
with the same signature (in particular, this would obviate the need for
plugins such as nose-ipdb and pytest-ipdb; nose and pytest could instead
let their --pdb command line arg take an argument specifying the Pdb
(sub)class to use, e.g. py.test --pdb=IPython.core.debugger.Pdb).

Also deprecate the Tracer class (and related utilities), which can be
fairly trivially replaced by IPython.core.debugger.Pdb().set_trace()
(we can let Pdb catch BdbQuit itself).

It may be also possible to make color_scheme a kw-only arg to Pdb, but it would be awkward to do so while maintaining back-compatibility (because it is used positionally and as the first argument in a few places). So another option would be to break back-compatibility without a deprecation period, and directly make it a kw-only arg in IPython 6 (this is trivial to do in a Py3-only codebase).

@Carreau
Copy link
Member

Carreau commented Jul 12, 2016

Great ! Thanks !

I don't think we'll do that in the 5.x branch but as soon as we release 5.1 and for master toward a 6.0 I'll be happy to get things like that in !

Unless @takluyver thinks the deprecation messages in 5.1 are worth it.

Thoughts ?

@@ -62,6 +63,7 @@ def BdbQuit_excepthook(et, ev, tb, excepthook=None):
All other exceptions are processed using the `excepthook`
parameter.
"""
warnings.warn("`BdbQuit_excepthook` is deprecated", DeprecationWarning)

This comment has been minimized.

Copy link
@Carreau

Carreau Jul 12, 2016

Member

Nitpicking, but once we agree on when to deprecate (5.1 or 6.0), I like to add ...deprecated since version X.y otherwise it's painful for user to figure out when they can remove potential shims , and for us to figure out when we can delete the code.

This comment has been minimized.

Copy link
@anntzer

anntzer Jul 12, 2016

Author Contributor

Added deprecation as of 5.1 following @takluyver's comment.

@anntzer
Copy link
Contributor Author

anntzer commented Jul 12, 2016

PS: pytest-dev/pytest#1712 seems on its way in. nose2 seems to directly call the pdb API (instead of instantiating a Pdb instance) so it would require a bit deeper refactoring.

@takluyver
Copy link
Member

takluyver commented Jul 12, 2016

I kind of think that the colour stuff should be in the terminal subclass. But that would remove coloured output from debugging in Jupyter frontends, so probably not...

@takluyver
Copy link
Member

takluyver commented Jul 12, 2016

I think I'd be OK with this going in for 5.1, but I don't feel strongly either way.

Directly get the color scheme from the interactive shell (which is
created if not already present, anyways).  The goal is ultimately to
allow the IPython debugger to be a drop-in replacement of the stdlib pdb
with the same signature (in particular, this would obviate the need for
plugins such as nose-ipdb and pytest-ipdb; nose and pytest could instead
let their `--pdb` command line arg take an argument specifying the Pdb
(sub)class to use, e.g. `py.test --pdb=IPython.core.debugger.Pdb`).

Also deprecate the `Tracer` class (and related utilities), which can be
fairly trivially replaced by `IPython.core.debugger.Pdb().set_trace()`
(we can let `Pdb` catch `BdbQuit` itself).
@anntzer anntzer force-pushed the anntzer:simplify-debugger branch from ef175ff to ec2d023 Jul 12, 2016
@Carreau Carreau added this to the 5.1 milestone Jul 12, 2016
@Carreau
Copy link
Member

Carreau commented Jul 12, 2016

5.1 it will be then.

@Carreau
Copy link
Member

Carreau commented Jul 19, 2016

Ok, let's merge this one.

@Carreau Carreau merged commit eece8e8 into ipython:master Jul 19, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@anntzer anntzer deleted the anntzer:simplify-debugger branch Jul 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.