All Projects → jupyterlab → Debugger

jupyterlab / Debugger

Licence: bsd-3-clause
A visual debugger for Jupyter notebooks, consoles, and source files

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Debugger

Awesome Jupyter
A curated list of awesome Jupyter projects, libraries and resources
Stars: ✭ 2,523 (+430.04%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Lantern
Data exploration glue
Stars: ✭ 292 (-38.66%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Awesome Jupyterlab Extension
😎 A curated list of awesome Jupyterlab extension projects. 🌠 Detailed introduction with images.
Stars: ✭ 198 (-58.4%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
jupyterlab-topbar
JupyterLab Top Bar extension
Stars: ✭ 95 (-80.04%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
ipydagred3
ipywidgets library for drawing directed acyclic graphs in jupyterlab using dagre-d3
Stars: ✭ 38 (-92.02%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab System Monitor
JupyterLab extension to display system metrics
Stars: ✭ 154 (-67.65%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab templates
Support for jupyter notebook templates in jupyterlab
Stars: ✭ 223 (-53.15%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab Python Bytecode
JupyterLab extension to explore CPython Bytecode
Stars: ✭ 57 (-88.03%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab Dash
An Extension for the Interactive development of Dash apps in JupyterLab
Stars: ✭ 342 (-28.15%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
jupyterlab-sparkmonitor
JupyterLab extension that enables monitoring launched Apache Spark jobs from within a notebook
Stars: ✭ 78 (-83.61%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
jupyterlab-python-file
JupyterLab extension to create Python files
Stars: ✭ 50 (-89.5%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
jupyterlab-theme-solarized-dark
JupyterLab 2/3 Solarized Dark extension
Stars: ✭ 61 (-87.18%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
theme-darcula
A handsome Darcula theme for Jupyterlab. The first jlab theme to include dark scrollbars
Stars: ✭ 136 (-71.43%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab Hub
Deprecated: JupyterLab extension for running JupyterLab with JupyterHub
Stars: ✭ 181 (-61.97%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab Topbar
JupyterLab Top Bar extension
Stars: ✭ 86 (-81.93%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Best Of Jupyter
🏆 A ranked list of awesome Jupyter Notebook, Hub and Lab projects (extensions, kernels, tools). Updated weekly.
Stars: ✭ 200 (-57.98%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab Toc
Table of Contents extension for JupyterLab
Stars: ✭ 660 (+38.66%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (+67.23%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
ipyp5
p5.js Jupyter Widget
Stars: ✭ 33 (-93.07%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension
jupyterlab-heroku
JupyterLab extension to deploy applications to Heroku
Stars: ✭ 20 (-95.8%)
Mutual labels:  jupyter, jupyterlab, jupyterlab-extension

@jupyterlab/debugger

Github Actions Status Binder npm

A JupyterLab debugger UI extension. This extension is under active development.

screencast

Prerequisites

  • JupyterLab 2.0+
  • xeus-python 0.8.0+
  • notebook 6+

Installation

A kernel with support for debugging is required to be able to use the debugger.

It is generally recommended to create a new conda environment to install the dependencies:

conda create -n jupyterlab-debugger -c conda-forge xeus-python=0.8.6 notebook=6 jupyterlab=2 ptvsd nodejs
conda activate jupyterlab-debugger

Then, run the following command to install the extension:

jupyter labextension install @jupyterlab/debugger

Usage

For now xeus-python is the only Jupyter kernel that supports debugging. xeus-python can be selected from the JupyterLab launcher:

xpython-launcher

Alternatively, it is also possible to switch to the xpython kernel using the kernel selection dialog:

xpython-dialog

Enable the debugger, set breakpoints and step into the code:

xpython-step

Development

# Create a new conda environment
conda create -n jupyterlab-debugger -c conda-forge nodejs xeus-python=0.8.6 ptvsd jupyterlab=2

# Activate the conda environment
conda activate jupyterlab-debugger

# Install dependencies
jlpm

# Build TypeScript source
jlpm build

# Link your development version of the extension with JupyterLab
jupyter labextension link .

# Rebuild TypeScript source after making changes
jlpm build

# Rebuild JupyterLab after making any changes
jupyter lab build

# Start JupyterLab with the kernel logs enabled and watch mode enabled
XEUS_LOG=1 jupyter lab --no-browser --watch

Tests

To run the tests:

# [Optional] to enable the logs for xeus-python
export XEUS_LOG=1

jlpm run test

To run tests for a specific test suite name:

jlpm run test --testNamePattern=<regex>

To run tests for a specific test module name:

jlpm run test --testPathPattern=<regex>

Inspecting debug messages

The kernelspy extension for JupyterLab can be used to inspect the debug messages sent between the debugger UI and the kernel.

To install it:

jupyter labextension install jupyterlab-kernelspy

Debug Protocol Overview

The following diagram illustrates the types of messages sent between the JupyterLab extension and the kernel.

Diagram

debug-protocol

References

Source

Generated using: https://bramp.github.io/js-sequence-diagrams/

Diagram source
user->JupyterLab: open notebook

JupyterLab->JupyterLab: check 'debugger' key\nin the kernel spec

JupyterLab->user: show toggle button\nif 'debugger'

user->JupyterLab: enable debugging

JupyterLab->kernel: debugInfo request

kernel->JupyterLab: debugInfo response

user->JupyterLab: start debugger

JupyterLab->kernel: initialize request

kernel->JupyterLab: initialize response

JupyterLab->kernel: attach request

kernel->JupyterLab: attach response

Note right of kernel: debugger started

user->JupyterLab: add breakpoints\n(click on gutters)

JupyterLab->kernel: dumpCell request

kernel->JupyterLab: dumpCell response

JupyterLab->kernel: setBreakpoints request

kernel->JupyterLab: breakpoints response

JupyterLab->kernel: configurationDone request

kernel->JupyterLab: configurationDone response

user->JupyterLab: execute cell\n(Ctrl-Enter)

JupyterLab->kernel: requestExecute

kernel->kernel: execute code

kernel->kernel: hit breakpoint

kernel-->JupyterLab: stopped event

JupyterLab->kernel: stackTrace request

kernel->JupyterLab: stackTrace response

JupyterLab->user: show current line

JupyterLab->kernel: scopes request

kernel->JupyterLab: scopes response

JupyterLab->kernel: variables request

kernel->JupyterLab: variables response

JupyterLab->user: show variables

user->JupyterLab: step in deleted cell code

JupyterLab->kernel: stepIn request

kernel-->JupyterLab: stopped event

JupyterLab->JupyterLab: search for code matching\nsource path

JupyterLab->kernel: source request

kernel->JupyterLab: source response

JupyterLab->user: show source for current path

Note right of kernel: debug session

user->JupyterLab: disable debugging

JupyterLab->kernel: disconnect request

Note right of kernel: debugger stopped

kernel->JupyterLab: disconnect response

JupyterLab->JupyterLab: clear debugger UI for\nthe notebook

Inspecting Debug Messages in VS Code

Inspecting the debug messages in VS Code can be useful to understand when debug requests are made (for example triggered by a UI action), and to compare the behavior of the JupyterLab debugger with the Python debugger in VS Code.

Create launch.json

The first step is to create a test file and a debug configuration:

image

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File",
      "type": "python",
      "request": "launch",
      "program": "${file}",
      "console": "integratedTerminal",
      "env": { "DEBUGPY_LOG_DIR": "/path/to/logs/folder" }
    }
  ]
}

Start the debugger

image

Open the logs

The content of the log file look like this:

...

D00000.032: IDE --> {
                "command": "initialize",
                "arguments": {
                    "clientID": "vscode",
                    "clientName": "Visual Studio Code",
                    "adapterID": "python",
                    "pathFormat": "path",
                    "linesStartAt1": true,
                    "columnsStartAt1": true,
                    "supportsVariableType": true,
                    "supportsVariablePaging": true,
                    "supportsRunInTerminalRequest": true,
                    "locale": "en-us"
                },
                "type": "request",
                "seq": 1
            }

...

With:

Overview

vscode-debug-logs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].