Another question: How are people using Pants with ...
# general
b
Another question: How are people using Pants with an IDE for Python projects? In particular, how do you tell VSCode where to find the right Python interpreter? What I've done:
pants export --resolve=default
and then in VSCode I find that venv with "> python: Select interpreter". However, this doesn't install first-party code into the environment. Without first-party code installed in "editiable" mode, I can't have VSCode launch and debug a Python module, as none of my first-party code is in the venv.
c
I’ve never used VSCode, so will have to defer to others on that one
oh, for VSCode there’s the DAP (debug adapter protocol)
b
Vim user? 😄
c
emacs 😉
b
Noice.
I mean, a more generic problem statement is this: How do I get first-party code installed into the venv with
pants export ...
?
Something equivalent to
pip install --editable .
c
I know I have ppl at work that use VSCode and can break and step into the tests and such… shouldn’t be too difficult to find out what they’ve done 🙂
b
Okay. 🙂
And yeah this is what I want to be able to do: Step through the code in a debug session.
c
DM’d…
s
Under "First-party sources" it describes how to teach VS code about your first party code
b
Ahhh yes! I had seen this at one point.
Thanks @silly-queen-7197
s
I also like to include
Copy code
{
  "python.defaultInterpreterPath": "dist/export/python/virtualenvs/python-default/3.10.13"
}
in my
.vscode/settings.json
. One thing to note is that the
3.10.13
depends on your version of python. On some machines I have
3.10.9
and others I have
3.10.13
.
🫡 2
w
Ooh, I like that - of note stuff like formatters and linters aren’t bundled in there, which can be annoying
b
This is because you only get one resolve per
export
goal, right?