Hi @UltimateSquid
I dont know PyCharm that much. But I do know a little about debugging. I have been trying to make debug posible for around a year but had bit trouble. But finaly short time ago I figured out how and what should be changed in mycroft-core to make debugging running skills posible.
You cannot just debug a singel file in a skill as it dont run alone. If you want to debug a running skill you hav to debug the skillsservice and attatch to that.
But debugging the skillsservice is a bit more complex than just debug a single pythonfile. But defently posible.
I made a skill that is pending market - Remote debug skill.
What it does is stopping skillservice, set patadious into single thread mode and then start debug adaptor and get that to start skillservice.
Then you can attatch to that debug session and if you have breakpoints set in your skill it will st at that and you can step into the running code.
It works from vscode and Theia IDE, and I guess itt also would work from other IDE’s like PyCharm, but as I dont know PyCharm I cant help on how to do it from that IDE.
Se more about remote debug skill here
Specifik on the setup of remote attatcg
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
}
To install remote debug skill you can install that with mycroft-msm by:
mycroft-msm install https://github.com/andlo/remote-debug-skill.git
and after that you start debug adaptor by asking mycroft to do that by:
“Hey mycroft - Run remote debug adaptor”
And then you can see in the cli that he is stopping skillsservice and start again and that patadious is in single mode.
When you dont want to debug anymore you can stop the debug adaptor by saying:
“Hey mycroft - End remote debug adaptor”
And you can se in the CLI taht skillservice is stoped and started and patadious single thrad is false.
When debuging adaptor is active you can se that it is running by
pi@picroft1:/opt/mycroft/skills $ ps ax |grep " -m mycroft.skills"
22034 ? Rl 0:09 python3 -m ptvsd --host 0.0.0.0 --port 5678 -m mycroft.skills
22138 pts/1 S+ 0:00 grep --color=auto -m mycroft.skills
pi@picroft1:/opt/mycroft/skills $
When debug adaptor is not run same command shows:
pi@picroft1:/opt/mycroft/skills $ ps ax |grep " -m mycroft.skills"
21460 pts/1 S+ 0:00 grep --color=auto -m mycroft.skills
28762 pts/10 Sl 575:48 python3 -m mycroft.skills
pi@picroft1:/opt/mycroft/skills $
Notise teh difference - mycroft.skills is called from ptvsd when debug is active and not when running normal.
Hope that gets you further, and I would be interesting in hearing on how to setup PyCharm for rempte debuging as PyCharm is a IDE lots of pythonists are using and others could benefit on knowing on how to do remote debug of mycroft.