Local development IDE setup

You might find development easier in an IDE with features such as code completion and syntax highlighting. The preferred IDE is Visual Studio Code. You can use other IDEs such as PyCharm, Eclipse, and Vim, but Q2 can provide only limited support for these.

The video below shows the IDE setup using VSCode:

To set up Visual Studio Code for development, complete the following steps:

  1. Download and install Visual Studio Code.

  2. Launch Visual Studio Code and open the Extensions marketplace.

  3. Search for “Q2 SDK Extension Pack” and “WSL”, then install these.

  4. Set the workspace root to your code directory. You can do this by selecting File > Open Folder… and selecting the directory built by Caliper Admin, or by navigating to this directory in a terminal and running the command code .

  5. If a directory named .vscode does not exist here, create it.

  6. Create a settings.json file and launch.json file in this directory with the following contents:

settings.json:

{
  "python.defaultInterpreterPath": ".env/bin/python"
}

launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "q2 run",
      "type": "debugpy",
      "request": "launch",
      "program": "${workspaceRoot}/.env/bin/q2",
      "cwd": "${workspaceFolder}",
      "python": "${workspaceFolder}/.env/bin/python",
      "windows": {
        "python": "${workspaceFolder}/.venv/Scripts/python.exe",
        "program": "${workspaceRoot}/.venv/Scripts/q2.exe"
      },
      "console": "integratedTerminal",
      "args": [
        "run"
      ]
    }
  ]
}

The Visual Studio Code environment is now set up and ready for you to begin development.