Does anyone have a working setup for VSCode debugg...
# troubleshooting
m
Does anyone have a working setup for VSCode debugger when working with taps? I'm using this tap-investing to get familiar with the spec, but struggling to get the debugger to recognise and run the tap.
v
It's just Python so any debugger you're used to using with Python should work!
I don't have one or I'd share 😄
m
Ah ok, fiddling with the
launch.json
file to get it running, maybe missing something obvious, but typically I'd be pointing it at a
./main.py
to run,
Copy code
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File",
      "type": "python",
      "request": "launch",
      "program": "${workspaceRoot}/tap_investing.tap:cli",
      "console": "integratedTerminal",
      "args": [
        "--config",
        "config.json"
      ]
    }
  ]
}
Got it working, updated the
local.json
snippet above, and it seems to work fine 😄
For posterity in case someone else is interested in using the VScode debugger, my setup was using a venv, and making sure that VSCode was using that venv! So steps were as follows (specifically for the tap-investing, which btw seems like a nice starter) 1.
git clone <mailto:git@gitlab.com|git@gitlab.com>:DouweM/tap-investing.git
2.
cd tap-investing
3.
python3 -m venv .tap-investing
4.
source .tap-investing/bin/activate
5.
pip install git+<https://gitlab.com/DouweM/tap-investing.git>
6. Ensure that you select the venv in VSCode, per screenshot 7. Add the
local.json
snippet in the previous comment! 8. Set a breakpoint somewhere in the
tap.py
9. Hit F5 to run that debugger!
Update 2: If you are using poetry and want VSCode to see your poetry venv, then you need to run the below command before installing. See here for deets
Copy code
poetry config virtualenvs.in-project true
Poetry seems great 😄
v
😄 yes exactly what I do when I develop too. I just use vim 😮
a
This looks very useful, @matt_arderne. Thanks for sharing here. @amanda.folson fyi👆
m
No worries! I must be quite honest - I haven't got it working 100%. The above will run the tap and get it to the breakpoint, but I cannot get it to print to terminal like if I was running a
poetry run tap-confluence --config config.json
in the CLI.. so still some tweaking to refine it the last little bit. Need to better understand what exactly is going on