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

Test: Jupyter run by line/debugging #131469

Closed
3 tasks done
roblourens opened this issue Aug 24, 2021 · 3 comments
Closed
3 tasks done

Test: Jupyter run by line/debugging #131469

roblourens opened this issue Aug 24, 2021 · 3 comments

Comments

@roblourens
Copy link
Member

roblourens commented Aug 24, 2021

Refs: #126431, microsoft/vscode-jupyter#5607

Complexity: 4

Authors: @roblourens, @DavidKutu

Create Issue


Setup

  • Set "jupyter.experimental.debugging": true
  • Make sure that you have python 3.7 or greater installed and on your path as python3 or python
  • Set up a python virtualenv (use regular python, conda is not recommended)
  • In past months we had some issues with setup. If you can't get this to work, please ping me, don't struggle with it for hours
mkdir jupyter-dbg
cd jupyter-dbg
python3 -m venv ipykernel-env
  • Activate the virtual environment

Mac/Linux:

source ipykernel-env/bin/activate

Windows:

ipykernel-env\Scripts\activate.bat
  • Make sure you have ipykernel 6+ in the virtual environment, which has debugging support
pip install ipykernel
python3 -m ipykernel install --user
  • Make sure you have the latest version of the Jupyter extension installed in VS Code Insiders

Testing

  • Open a .ipynb notebook file
  • Pick the kernel from your virtual env
  • Click the Run by Line button in the cell toolbar, or press F10 while a cell is selected
    image
  • A debugging session should start, without the status bar changing, without the debug widget and without revealing the debug sidebar automatically
  • Press the same button (or F10) to advance to the next line, or the stop button on the left of the cell to end the session
  • The Variable Explorer should be shown automatically and should update after advancing each line
  • Once you've stepped to the end of the cell, the session should end automatically

Test full debugging

  • You should also be able to set breakpoints and use the Debug Cell command to run a cell and hit breakpoints:
    image

More testing

  • Restarting, Interrupting or changing the Kernel should end the session
  • The Run by Line button shouldn't move position
  • It should not step into another cell or file
  • Note: the flow above is the only entrypoint. launch.json is not relevant here.
  • You should never see an error that looks something like "Unable to open ..." with some tmp file path
  • Clicking Run by Line on a different cell (or notebook) while a session is running should do nothing
  • It shouldn't get stuck where clicking the RBL button does nothing

Known issues

  • Testing run by line in an untitled notebook will ask you to save the file
  • If you step over a line that calls a function in another file, it might open that file. The jupyter extension will be published with this fix tomorrow

Filing issues

File issues on the jupyter repo using the link above. Include the log from the Jupyter output channel

@roblourens roblourens added this to the August 2021 milestone Aug 24, 2021
@lramos15 lramos15 removed their assignment Aug 24, 2021
@paulacamargo25 paulacamargo25 removed their assignment Aug 24, 2021
@stuartleeks
Copy link

Verified on Windows + WSL
Windows (with Powershell) required ipykernel-env\Scripts\activate.ps1 rather than ipykernel-env\Scripts\activate.bat
Windows also required running python -m ipykernel install --user rather than python3 -m ipykernel install --user otherwise I got a No module named ipykernel error

@stuartleeks stuartleeks added the verified Verification succeeded label Aug 25, 2021
@sandy081
Copy link
Member

@stuartleeks Feel free to close the issue if you are the last one to sign off the test plan item. Thanks.

@stuartleeks
Copy link

stuartleeks commented Aug 25, 2021

@stuartleeks Feel free to close the issue if you are the last one to sign off the test plan item. Thanks.

oops - thanks!

@roblourens roblourens removed the verified Verification succeeded label Aug 25, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants