Skip to content

Commit

Permalink
Add more samples for correct debug configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Aug 16, 2023
1 parent d9fb40c commit 7651f1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Binary file added docs/assets/pycharm_debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_method_to_test(caplog):

### Debug configuration

To debug freqtrade, we recommend VSCode with the following launch configuration (located in `.vscode/launch.json`).
To debug freqtrade, we recommend VSCode (with the Python extension) with the following launch configuration (located in `.vscode/launch.json`).
Details will obviously vary between setups - but this should work to get you started.

``` json
Expand All @@ -102,6 +102,20 @@ This method can also be used to debug a strategy, by setting the breakpoints wit

A similar setup can also be taken for Pycharm - using `freqtrade` as module name, and setting the command line arguments as "parameters".

??? Tip "Correct venv usage"
When using a virtual environment (which you should), make sure that your Editor is using the correct virtual environment to avoid problems or "unknown import" errors.

#### Vscode

You can select the correct environment in VSCode with the command "Python: Select Interpreter" - which will show you environments the extension detected.
If your environment has not been detected, you can also pick a path manually.

#### Pycharm

In pycharm, you can select the appropriate Environment in the "Run/Debug Configurations" window.
![Pycharm debug configuration](assets/pycharm_debug.png)
![Alt text](image.png)

!!! Note "Startup directory"
This assumes that you have the repository checked out, and the editor is started at the repository root level (so setup.py is at the top level of your repository).

Expand Down

0 comments on commit 7651f1b

Please sign in to comment.