Question, is it possible to use pants run and pych...
# general
s
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
I do this frequently with
pants test
, are you asking specifically about
pants run
? That should also be possible
s
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
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
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
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
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
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
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
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
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?