Skip to content

Commit

Permalink
Extend virtualenv section in README with folder detection info
Browse files Browse the repository at this point in the history
The readme didn't reflect the changes from #121
  • Loading branch information
mfussenegger committed Apr 10, 2024
1 parent 66560f0 commit 141f3cf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ The [Debugpy Wiki][debugpy_wiki] contains a list of all supported configuration

## Python dependencies and virtualenv

`nvim-dap-python` by default looks for `VIRTUAL_ENV` and `CONDA_PREFIX`
environment variables and if present uses these environments to execute your
application or tests.
`nvim-dap-python` by default tries to detect a virtual environment and uses it
when debugging your application. It looks for:

- The environment variables `VIRTUAL_ENV` and `CONDA_PREFIX`
- The folders `venv`, `.venv`, `env`, `.env` relative to either the current
working directory or the `root_dir` of a active language server client. See
`:h lsp.txt` for more information about the latter.

If you're using another way to manage virtual environments, you can set a
custom `resolve_python` function:
Expand All @@ -142,6 +146,10 @@ require('dap-python').resolve_python = function()
end
```

Or explicitly set the `pythonPath` property within your debugpy/nvim-dap
configurations. See `:h dap-configuration` and [Launch/Attach
Settings][debugpy_wiki]


## Alternatives

Expand Down

0 comments on commit 141f3cf

Please sign in to comment.