How do you all typically setup PyCharm, so that you can attach the debugger when developing an addon? I was able to get it working, but it felt a little clunky, so wanted to see if there was an easier way. These were the steps that I used:
- clone and build
anki
from source using steps outlined README.development
Within PyCharm
- Open ->
addon
in PyCharm as a project.-
addon
the directory containing addon that you’re working on.
-
- Open ->
anki
-> Attach-
anki
is the directory of version built from source in 1.
-
- Add new run configuration. Here is mine (sorry wasn’t allowed to upload an image to the forum since I’m new, but linked to imgur along with key params below).
-
Script Path:
~/PycharmProjects/anki/qt/runanki
-
Parameters:
-b ~/PycharmProjects/addon/profile
- Creates a new profile, so doesn’t mess up real Anki profile if you are an Anki user
-
Interpreter:
~/PycharmProjects/anki/pyenv/bin/python
- Initally I didn’t realize that anki creates its own python environment when you build it from source. You need to use that interpreter to start
anki
in the run configuration.
- Initally I didn’t realize that anki creates its own python environment when you build it from source. You need to use that interpreter to start
-
Script Path:
-
ln -s ~/PycharmProjects/addon/src ~/PycharmProjects/addon/profile/addons21
- symlink or copy the
addon
source location to the dev profile’saddons21
directory.
- symlink or copy the