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 () (defun load-python-env ()
"Set up the Python IDE in the current project." "Set up the Python IDE in the current project."
(interactive) (interactive)
(progn (when (derived-mode-p 'python-mode)
(ignore-errors (poetry-venv-workon)) (progn
(eglot-ensure))) (poetry-venv-workon)
(eglot-ensure))))
(use-package python (use-package python
:bind (:map python-mode-map :bind (:map python-mode-map
("C-c C-p" . nil) ("C-c C-p" . nil)
("C-c C-l" . nil) ("C-c C-l" . nil)
("C-c t" . elpy-test)) ("C-c t" . elpy-test))
:hook (python-mode . load-python-env) :hook (hack-local-variables . load-python-env)
:config :config
(load "python-tests.el") (load "python-tests.el")
:custom :custom