Skip to content
Snippets Groups Projects
Commit dff1e43e authored by Liu Miao's avatar Liu Miao
Browse files

make pyright work well

parent 23cb2bd6
No related branches found
No related tags found
Loading
...@@ -12,12 +12,11 @@ ...@@ -12,12 +12,11 @@
(let ((file-path (expand-file-name ".venv" root-path))) (let ((file-path (expand-file-name ".venv" root-path)))
(cond ((file-directory-p file-path) (cond ((file-directory-p file-path)
(pyvenv-activate file-path) (pyvenv-activate file-path)
(setq pyvenv-activate file-path)
(message "Activated local virtualenv")) (message "Activated local virtualenv"))
(t (message ".venv is not a directory"))))))) (t (message ".venv is not a directory")))))))
(use-package python (use-package python
:defer t
:ensure nil
:after flycheck :after flycheck
:mode "\\.py\\'" :mode "\\.py\\'"
:custom :custom
...@@ -29,12 +28,12 @@ ...@@ -29,12 +28,12 @@
(use-package lsp-pyright (use-package lsp-pyright
:ensure t :ensure t
:hook (python-mode . (lambda () (require 'lsp-pyright))) :hook (python-mode . (lambda () (require 'lsp-pyright)))
:init (when (executable-find "python3") ;; :init (when (executable-find "python3")
(setq lsp-pyright-python-executable-cmd "python3"))) ;; (setq lsp-pyright-python-executable-cmd "python3")))
)
(use-package yapfify (use-package yapfify
:ensure t :ensure t
:defer t
:hook (python-mode . yapf-mode)) :hook (python-mode . yapf-mode))
(use-package pyvenv (use-package pyvenv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment