View Single Post
Old 11-07-2020, 12:42 PM   #1
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Post How-to: Debug calibre plugin development with PyCharm Pro

I found this post on debugging calibre itself with Eclipse/PyDev, but could not find anything on how to debug plugins or how to do the same with PyCharm. It took me a while, but I figured it out, so I decided to spare you the time:
  1. Create a new project in PyCharm and point it to the directory that hold’s the plugin you’re working on as content root
  2. Add remote debugging with path mappings to the project. Path mappings should be 1-on-1, from an absolute path to a .py file to its calibre_plugins module equivalent
  3. Add the debug server to your plugin according to the documentation. (Use the “Add from the installation directory” approach.)
  4. Build your plugin and start calibre with
    Code:
    calibre-customize -b . && calibre-debug -g
    from within the plugin directory
  5. Ignore the warnings and enjoy stepping through your code

In case you want screenshots, I have those here.
harmtemolder is offline   Reply With Quote