Hello.
I’m trying to chase down a possible bug in platformio-core. I would like to be able fire up the PyCharm debugger and step through the relevant code.
I’ve cloned the platformio-core repository, run tox, and opened the directory in PyCharm.
I have no idea how to actually debug it at this point. Also, the IDE is complaining that it can’t find the clickor semantic_version imports.
TIA,
D.
I don’t see anything beyond https://github.com/platformio/platformio-core/blob/develop/CONTRIBUTING.md, so I would suggest asking https://github.com/platformio/platformio-core/issues. Not having debug instructions while developing the PlatformIO core is a defect in the documentation.
I’ve never tried to debug (step by step) PIO Core using Python’s tools. While generic commands can be debugged, commands like pio run, pio debug, etc., internally invoke SCons in a multi-process environment.
I’ve cloned the platformio-core repository, ran tox, and opened the directory in PyCharm.
That’s correct. Next, just switch to the virtual environment that tox created:
source .tox/py314/bin/activate
which pio
pio --version
Okay. That shows the version in my project directory (I think). But how do I debug a command?
You can directly use the platformio module in pair with the Python Debugger. An example:
python -m platformio --help