csspin-python/doc/plugins/debugpy.rst at master · cslab/csspin-python · GitHub
Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.93 KB

File metadata and controls

62 lines (46 loc) · 1.93 KB

csspin_python.debugpy

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.

How to use the debugpy plugin within other plugins?

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)

debugpy schema reference