hey folks, is it possible to get into a debugger w...
# development
f
hey folks, is it possible to get into a debugger when running
./pants
command with in-repo plugin code being executed? If I add
import pdb; pdb.set_trace()
inside my plugin code, I get
Exception: stdin is currently Exclusive owned.
in the terminal
b
At some point I was gonna explore
PANTS_DEBUG
(which is in the pants repo) but for end-users. It might be possible to cobble together. You use VS Code?
f
can use vscode if that will help 🙂
for now, I just run the
./pants
from a terminal; it's a trivial piece of Python code in the plugin
b
So there's twoish pieces to solve. I can take a stab at it in about 15-ish minutes
f
it's not urgent!
a
I use:
Copy code
[cli.alias]
plugin-dev = "--no-local-cache --no-dynamic-ui --print-stacktrace --no-concurrent"
1
b
Alrighty, taking a look now. Let's see how quick this will go 😛
OK I'm so perplexed with bash and spaces
Copy code
DEBUG_ARGS='-c "__import__(\"sys\").path.pop(0);__import__(\"debugpy.server.cli\").main()" --listen 127.0.0.1:5678 --wait-for-client'
exec python ${DEBUG_ARGS}
and nothing happens
@fresh-cat-90827 ☝️
❤️ 1
OK @fresh-cat-90827 you should be able to upgrade your pants shim and use
PANTS_DEBUG=1
🙌 1