Ask Your Question

Debug/Execute a poetry packaged project

asked 2020-05-28 20:03:38 -0600

rmorison's avatar

updated 2020-05-28 22:19:45 -0600

I'm trying to debug a managed project ( with a script command like...

migra = 'migra:do_command'

I wrote my own like

from migra import do_command


and that worked, but seemed a little clunky, to have to add my own code to debug with wing. Is there a better way?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-29 08:04:39 -0600

Using 'python -m' is increasingly the standard for launching utilities and tools that are part of Python packages. If it's possible to launch poetry with 'python -m poetry' then you don't need to create a but can instead set Main Entry Point under the Debug tab of Project Properties to Use Selected Entry Point and create a Named Entry Point from there which uses the "Named Module" option with module name poetry.

Another approach would be to start debug from code run by poetry and run it from the command line or Wing's OS Commands tool. I think just adding a is cleaner, but this is documented at

edit flag offensive delete link more



If -m supported -m module:function, yeah would be great. Afaik, there's no python command line arg to set the entrypoint to anything other then the beginning of the script file (or for packages.) it is, then.

rmorison's avatar rmorison  ( 2020-05-29 11:23:25 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-05-28 20:03:38 -0600

Seen: 1,060 times

Last updated: May 29 '20