The debugpy plugin provisions `debugpy`_ and provides configuration that can
be used in other plugins of csspin_python to run debugpy in order to debug
Python code.
This plugin doesn't need to be activated within a spinfile.yaml, it rather
must be used as dependency in other plugins that require debugpy and want to use
the configuration of the debugpy plugin.
To use the debugpy plugin within other plugins, the plugin must
be added as a dependency and can be used as follows:
from spin import config, task, option, sh
defaults = config(
requires=config(
spin=[
"csspin_python.debugpy",
"csspin_python.python",
],
)
)
@task
def dummy(cfg, debug: option("--debug", is_flag=True), args):
if debug:
sh("debugpy", *cfg.debugpy.opts, "-m", "something", args)
else:
sh("python", "-m", "something", args)