Skip to content

An extension for [nvim-dap][1] providing default configurations for python and methods to debug individual test methods or classes.

License

Notifications You must be signed in to change notification settings

theHamsta/nvim-dap-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-dap-python

An extension for nvim-dap providing default configurations for python and methods to debug individual test methods or classes.

Installation

It is recommended to install debugpy into a dedicated virtualenv. To do so:

mkdir .virtualenvs
cd .virtualenvs
python -m venv debugpy
debugpy/bin/python -m pip install debugpy

Usage

  1. Call setup in your init.vim to register the adapter and configurations:
lua require('dap-python').setup('~/.virtualenvs/debugpy/bin/python')

The argument to setup is the path to the python installation which contains the debugpy module.

  1. Use nvim-dap as usual.
  • Call :lua require('dap').continue() to start debugging.
  • See :help dap-mappings and :help dap-api.
  • Use :lua require('dap-python').test_method to debug the closest method above the cursor.

Currently this only works with the unittest test framework. pytest and others are not supported yet.

Work in progress

  • Use :lua require('dap-python').test_class to debug the closest class above the cursor.

Looking for Maintainers

I'm looking for co-maintainers who are:

  • Ensuring test runners like pytest are supported as well.
  • Ensuring Windows is well supported

About

An extension for [nvim-dap][1] providing default configurations for python and methods to debug individual test methods or classes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%