GithubHelp home page GithubHelp logo

jupyterlab / vscode-config-template Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 8.0 20 KB

A copier template for creating the IDE config needed to debug the Python and Typescript code in any Jupyter project

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 89.41% Jinja 10.59%
jupyterlab template

vscode-config-template's Introduction

JupyterLab Visual Studio Code configurator

A copier template for creating the Visual Studio Code configuration needed to debug the Python and Typescript code in Jupyter extension projects.

It will add:

  • Debug configuration to debug your code in Visual Studio Code
  • [recommended] Development container (can be used to develop within a container) - see installation documentation

Setup Visual Studio Code for extensions

The best is to run this on project generated by the extension template.

  1. Install copier.
pip install copier

or

conda install copier
  1. Navigate to the root of your Jupyter project, then run

For copier v8

copier copy -a .copier-answer.vscode.yml --UNSAFE https://github.com/jupyterlab/vscode-config-template .

The --UNSAFE flag is required as explained in the documentation.

For copier v7

copier -a .copier-answer.vscode.yml copy https://github.com/jupyterlab/vscode-config-template .
  1. Answer the options questions

  2. Install the extension

pip install -e ".[test]"
jupyter labextension develop . --overwrite
# Server extension must be manually enabled in develop mode
# jupyter server extension enable <python_name>
  1. Optional, start watching your extension source changes
jlpm run watch
  1. Inside Visual Studio Code Debug panel, use Debug JupyterLab with Chrome.

Update configuration

To update the configuration to a newer version of the template, execute:

For copier v8

copier update -a .copier-answer.vscode.yml --UNSAFE

The --UNSAFE flag is required as explained in the documentation.

For copier v7

copier -a .copier-answer.vscode.yml update

vscode-config-template's People

Contributors

3coins avatar fcollonval avatar telamonian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-config-template's Issues

VSCode debug mode

Description

I followed the steps to create the random picture extension example: https://jupyterlab.readthedocs.io/en/latest/extension/extension_tutorial.html#extension-tutorial
Everything worked as published, but not the debug mode. Every time I tried to run the code in VSCode debug mode, it fails with some error related to the compatibility between ES and commons compiler. TypeScript configs should have handled this conversion but it still fails.

I tried every possible configs I can find online, nothing worked.

I eventually found your template and installed it: https://github.com/jupyterlab/debug-config-cookiecutter
It works, it runs, but still it does not break at any existing break point or step through the code line by line.

Reproduce

Simply click F5

Expected behavior

Should step through the code line by line, and stops at breakpoints.

Can you share a working version of a JupyterLab extension VSCode project, so I can compare it to mine and maybe find out what's wrong if any?

Context

  • Operating System and version: windows 10
  • Browser and version: Edge latest version
  • JupyterLab version: >=3.0.0
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.

Firefox config

From jupyterlab/jupyterlab#8328 (comment) and jupyterlab/jupyterlab#8328 (comment):

We could also add a Firefox debug config similar to:

{
  "name": "jlab frontend with Firefox",
  "type": "firefox",
  "request": "launch",
  "reAttach": true,
  "firefoxExecutable": "/path/to/firefox",
  "url": "http://localhost:9999",
  "webRoot": "${workspaceFolder}",
  "pathMappings": [
    {
      "url": "webpack:///",
      "path": "${webRoot}/"
    }
  ]
}

And ask in the cookiecutter whether to create the config for Chrome or Firefox (or both?).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.