so, how are you all using pants (python project) w...
# general
f
so, how are you all using pants (python project) with IDEs - it seems that's all still not there yet even if PyCharm seems to be ahead a little. F.e. I can't use the exported virtualenv in my case with VSCode. any hints on this?
I'm the rubber duck debugging king I guess. got it working with vscode - at least to select the correct venv...
only tests are still missing
g
f
yes, sure - that's where I started
there is even a vscode extension but it's a a pre-alpha release
@gorgeous-winter-99296 how do you work with pants regarding this topic?
f.e. I wonder how to debug tests
g
I use
pants test --debug-adapter
to connect using debugpy from Visual Studio Code. There's some details about debugging tests here: https://www.pantsbuild.org/docs/python-test-goal#debugging-tests
f
ok, true, totally forget about that approach - probably not attractive enough! 😄 anyways, I'm giving it a try now, thx for the hint
g
I think you can probably setup a debug template to make it invoke pants before launching, but I've never tried.
f
yeah, that should probably work with a task
actually, works quite nice I have to admit
somehow print statements don't render the output but that's probably related to how pant is collecting/catching stdout??
ah maybe just how pytest is catching
l
Yes, there are several flags that control seeing the output, but they are all ref'ed in the doc that Tom linked. Like you have to get pants to let the stdout of pytest out (test
--debug
I believe) and then you have to get pytest to let the python code's stdout out as well (which for passing tests requires passing
-s
to pytest directly, after the
--
)