Skip to content

Commit

Permalink
auto-select debugpy and debugpy-module and fix project root functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho committed Jul 13, 2024
1 parent 71a1fa0 commit 582f959
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pet.el
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,12 @@ buffer local values."
(setq-local lsp-ruff-lsp-ruff-path (pet-executable-find "ruff"))
(setq-local lsp-ruff-lsp-python-path python-shell-interpreter)
(setq-local dap-python-executable python-shell-interpreter)
(setq-local dap-variables-project-root-function #'pet-virtualenv-root)
(setq-local dape-command `(debugpy-module command ,(pet-executable-find "python")))
(setq-local dape-cwd-fn #'pet-virtualenv-root)
(setq-local dap-variables-project-root-function #'pet-project-root)
(setq-local dape-command
(if (file-exists-p (concat (file-name-directory (buffer-file-name)) "__main__.py"))
`(debugpy-module command ,python-shell-interpreter)
`(debugpy command ,python-shell-interpreter)))
(setq-local dape-cwd-fn #'pet-project-root)
(setq-local python-pytest-executable (pet-executable-find "pytest"))
(setq-local python-black-command (pet-executable-find "black"))
(setq-local python-isort-command (pet-executable-find "isort"))
Expand Down

0 comments on commit 582f959

Please sign in to comment.