Skip to main content

Debugging

This page teachs users to setup python debugger for dep-scan project.

Debugging using Pycharm

  1. Open dep-scan using pycharm, when you open the project for the first time it will take some time initializing everything. 1
  2. Procede by updating your python environment set in Pycharm. a. Click on Python3.x on the bottom right corner of Pycharm b. Choose "Add New Interpreter" > "Add Local Interpreter". c. Choose Virtualenv Environment and existing and find the venv folder inside of dep-scan.(Can be different depending on your system) 1
  3. You may add a debugger point to any part of dep-scan code. For example we are pointing it to main() function in dep-scan/cli.py as this is activated whenever we run dep-scan using the cli. 1
  4. Go to Pycharms top bar and click on "Current File" > "Edit Configurations...". 1
  5. Add a new configurations and choose "Python". 1
  6. In the following dialog: a. add a name to your config b. then next to script button choose the cli.py file. c. add arguments that you want to test. d. finally click on save. 1
  7. Press the debug button. 1
  8. Success!! 🥳 1

Debugging using Eclipse Theia

Use the below launch.json configuration.

{
"version": "0.2.0",
"configurations": [
{
"name": "Debug depscan cli",
"type": "debugpy",
"request": "launch",
"env": {
"SCAN_DEBUG_MODE": "info"
},
"program": "${workspaceFolder}/depscan/cli.py",
"console": "integratedTerminal",
"args": [
"--src",
"source directory",
"--reports-dir",
"reports directory",
"-t",
"project type"
]
}
]
}

Replace "source directory", "reports directory", and "project type" with valid values.