jupyter / enhancement-proposals

Enhancement proposals for the Jupyter Ecosystem
https://jupyter.org/enhancement-proposals
BSD 3-Clause "New" or "Revised" License
115 stars 65 forks source link

JEP for copy-to-globals support in debugger_info #93

Closed brichet closed 9 months ago

brichet commented 1 year ago

Introducing a new field to the kernel debugger_info response. This new field will inform the UI that the debugger supports the copyToGlobals request.

Related to https://github.com/jupyterlab/jupyterlab/pull/13476#discussion_r1111061085, which introduces a new feature in the debugger. It would be useful to know if this feature is supported by the kernel from UI side.

cc. @JohanMabille @krassowski

Voting from @jupyter/software-steering-council

JohanMabille commented 1 year ago

+1 on this, it has a very limited impact on the protocol and is backward compatible.

JohanMabille commented 10 months ago

Additional context on this: the copyToGlobals request was added to the Jupyter Debugger Protocol and implemented in xeus-python and ipykernel. However, this request:

Therefore, a solution is to make it optional, like the richInspectVariables request, and avertise for its availabitily in the debugInfo request.

fcollonval commented 10 months ago

Thanks for this JEP @brichet

I would suggest describing in the JEP the request and response format of this new message; adding the section Reference-level explanation seems the right place for that.

brichet commented 10 months ago

Thanks for this JEP @brichet

I would suggest describing in the JEP the request and response format of this new message; adding the section Reference-level explanation seems the right place for that.

Thanks @fcollonval, I updated the description.

ivanov commented 10 months ago

I am abstaining from this vote as I have no familiarity with the debugger. I have never had occasion to use it as a user, let alone dive into its implementation details as a developer.

gabalafou commented 10 months ago

I wanted to familiarize myself more with this before voting, but realistically, I'm not going to find the time, so I'm abstaining.

brichet commented 10 months ago

Some additional information to summarize this feature:

When the debugger stop on a breakpoint, some variables are in the global scope and some other can be in a local scope (in a function). Using the debugger tools only does not help for some introspection in complexe variables.

When the execution ends, the variable(s) in the local scope will not be reachable anymore.

We added a feature in some python kernels (ipykernel and xeus-python, see https://github.com/jupyter/enhancement-proposals/pull/93#issuecomment-1809107434) to be able to copy a variable from a local scope to a global scope during a breakpoint. This way, the variable(s) can be introspected after the code execution, since it still exists in the global scope.

The aim of this JEP is only to send a flag to Jupyterlab (or other UI), whether this feature is supported or not by the kernel.

JohanMabille commented 9 months ago

6 yes, 3 abstains, 2 no votes, let's merge!