https://pantsbuild.org/ logo
#general
Title
# general
s

stale-artist-91164

12/16/2020, 10:26 PM
Question, is it possible to use pants run and pycharm's interactive debugger together? Pants docs looks like it will work great for CICD, but I couldn't find anywhere about here is how you can single step through your code locally while you are developing
h

happy-kitchen-89482

12/16/2020, 10:34 PM
I do this frequently with
pants test
, are you asking specifically about
pants run
? That should also be possible
s

stale-artist-91164

12/16/2020, 10:36 PM
can 'pants test' run my flask app and allow me to single step? I will want to single step debug my unit tests, but I also want to single step debug my app. (I'm new to pants so sorry if my lingo is off)
h

happy-kitchen-89482

12/16/2020, 10:57 PM
Welcome to Pants!
./pants test
is how you run unit tests, and there are instructions on how to single step debug into a test here: https://www.pantsbuild.org/docs/python-test-goal#running-tests-interactively
./pants run
is how you would ask Pants to run your app, and the same instructions should work
Let me try it out
Yep, the same instructions work
The only thing is,
run
runs your code in a sandbox, so PyCharm may ask you how to map those paths to original source paths. "Auto-detect" should work fine.
Or it may just work
h

hundreds-father-404

12/16/2020, 11:27 PM
We're thinking it'd be helpful to write a guide on integrating with how to integrate with each IDE. This is a good example
s

stale-artist-91164

12/16/2020, 11:41 PM
Excellent I'll give it a try. And ya, a document would be very useful. I can't live without pycharm, and so if I had known pants worked well with it I'd probably have switched from my manual setup monorepo to pants earlier.
2
h

happy-kitchen-89482

12/16/2020, 11:50 PM
I've replicated the debugging instructions here, so it's obvious that this works with
./pants run
as well: https://www.pantsbuild.org/v2.2/docs/python-run-goal
Thanks for the feedback!
Let us know if you have any other questions or issues
s

salmon-photographer-72811

04/28/2021, 11:26 PM
We're thinking it'd be helpful to write a guide on integrating with how to integrate with each IDE. This is a good example
Hello! New (potential) Pants user here, and I joined the Slack channel to ask the exact question that the OP posted. Does any documentation exist for integrating Pants with PyCharm and/or VS Code?
h

happy-kitchen-89482

04/29/2021, 3:47 PM
I thought we had docs for this, but I can't find them right now.
👌 1
Nope, I was wrong. There are docs on how to use the PyCharm remote debugger with
pants run
and
pants test
, but none for setting up a project. I will add to my TODO list to write those, as they are pretty important.
s

salmon-photographer-72811

04/30/2021, 12:24 AM
Thanks! I'm considering trying out Pants for our data science team (10-12 members), as we're moving from having a few separate repos to a monorepo. It's very important that the development environment be relatively straightforward to setup and maintain, since some of our scientists don't have a lot of experience with
git
and virtual environments, for example.
h

happy-kitchen-89482

04/30/2021, 1:30 PM
Right, makes sense.
That is a fairly common use-case.
Hey @salmon-photographer-72811, just wanted to follow up and see how your evaluation went/is going, and whether we can help with anything?
7 Views