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

creamy-activity-5659

09/24/2018, 2:27 PM
Hi pants people. I’m just curious at a high level, is it possible at all to get the IDE features working for python? e.g. symbol recognition, goto declaration (command-b in pycharm), and attaching a debugger? I’m nearly certain the answer is no, considering the notes on the site, but it’s worth asking! Thanks.
e

enough-analyst-54434

09/24/2018, 4:23 PM
I'm pretty sure there is nothing fundamental blocking this support, just a lack of time / prioritization. You can work around by creating a virtualenv and populating it with
pip install -U -r <(./pants dependencies --external-only 3rdparty/python::)
. I use this workaround encoded in a script that also runs pants export and then point to this script when setting up my project using the idea plugin:
Copy code
#!/usr/bin/env bash
set -euo pipefail

cd "$(git rev-parse --show-toplevel)"

# Update the python2 venv if needed for use as a Python SDK in IDEA.
./python --version >&2

# Update java dependencies.
exec ./pants --no-enable-pantsd export src/java::
In that example
./python
is a script that handles the venv creation / updating using the technique shown above.
h

hundreds-father-404

09/24/2018, 4:29 PM
@average-lawyer-7503 John are you still working on this? Or were you working on something else?
a

average-lawyer-7503

09/24/2018, 5:20 PM
Kind of? Pycharm’s on my Someday projects. IntelliJ works w/symbol recognition, jump-to… debugger is still ipdb for me but I am unsure if that’s a foursquare limitation or a pants plugin limitation… playing around with it myself
c

creamy-activity-5659

09/24/2018, 5:27 PM
@enough-analyst-54434 Awesome, that’s about all I needed! I will play with that today.
@average-lawyer-7503 I mostly meant intellij above 🙂 I am still curious how a debugger actually attaches.
3 Views