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:
- Create a new project in PyCharm and point it to the directory that hold’s the plugin you’re working on as content root
- 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
- Add the debug server to your plugin according to the documentation. (Use the “Add from the installation directory” approach.)
- Build your plugin and start calibre with
Code:
calibre-customize -b . && calibre-debug -g
from within the plugin directory
- Ignore the warnings and enjoy stepping through your code
In case you want screenshots, I have those
here.