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

Add napari plugin debugger launch instructions to the plugin debug guide #154

Closed
seankmartin opened this issue May 10, 2023 · 1 comment · Fixed by #161
Closed

Add napari plugin debugger launch instructions to the plugin debug guide #154

seankmartin opened this issue May 10, 2023 · 1 comment · Fixed by #161
Labels
content Ideas for new or improved content

Comments

@seankmartin
Copy link
Contributor

📚 New content request

While https://napari.org/dev/plugins/debug_plugins.html exists, and has some nice information - it may be missing some prerequisite steps such as how launch a debugger from IDE (e.g. VSCode) that contains a running napari window. Also how to inspect the code from there.

Outline

There is a potential that this could be solved by a simple screen recording of having a plugin in VSCode, and then running a launch script in the debugger like:

import napari

viewer = napari.Viewer()
viewer.window.add_plugin_dock_widget("napari-plugin-name")
napari.run()

And setting a breakpoint or raising an exception to show the output.
I don't know how regular video format is in the current docs, so open to exploring this!

Further context

This arose from a discussion around debugging napari plugins from the recent napari community meeting at euro time. I'm open to thoughts on how to achieve this @psobolewskiPhD, @Czaki

@seankmartin seankmartin added the content Ideas for new or improved content label May 10, 2023
@seankmartin seankmartin changed the title Add debug launch instructions to the plugin debug guide Add napari plugin debugger launch instructions to the plugin debug guide May 10, 2023
@psobolewskiPhD
Copy link
Member

Love this.
I mean your screen share was 🤯 for me, but most of the text of the OP basically explains it. So could go with text & code, plus a screen shot or a video.
Worth also looking for a link to some info about python debugging.

psobolewskiPhD added a commit that referenced this issue May 29, 2023
…ide (#161)

# Description
Adds a "quick start" section to the existing napari plugin debugging
guide that demonstrates writing a launch script with your plugin setup
so that you can debug it.
I've referenced VSCode here quite a bit because that the IDE I'm most
familiar with, it has decent debugging documentation, it is free, and
I'm not sure how much I'd recommend using pdb straight off the bat!

## Type of change
- [x] Fixes or improves existing content

# References
closes #154 

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have added [alt text](https://webaim.org/techniques/alttext/) to
new images included in this PR

---------

Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Ideas for new or improved content
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants