Pick up local variables before starting the Python IDE

This commit is contained in:
Ohad Livne 2025-06-24 14:27:06 +03:00
parent 02786dac5c
commit b2f67e84ee
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -243,16 +243,17 @@
(defun load-python-env ()
"Set up the Python IDE in the current project."
(interactive)
(when (derived-mode-p 'python-mode)
(progn
(ignore-errors (poetry-venv-workon))
(eglot-ensure)))
(poetry-venv-workon)
(eglot-ensure))))
(use-package python
:bind (:map python-mode-map
("C-c C-p" . nil)
("C-c C-l" . nil)
("C-c t" . elpy-test))
:hook (python-mode . load-python-env)
:hook (hack-local-variables . load-python-env)
:config
(load "python-tests.el")
:custom