Commit 3a9cb8b5 authored by Sylvain Benner's avatar Sylvain Benner
Browse files

[python] Fix directory specific python-backend

With this fix it is now possible to select different backends in
different project using the directory variables mechanism of Emacs
(the file .dir-local.el)
parent bc713b19
......@@ -30,10 +30,12 @@
"The backend to use for IDE features.
Possible values are `anaconda'and `lsp'.
If `nil' then `anaconda' is the default backend unless `lsp' layer is used.")
(put 'python-backend 'safe-local-variable #'symbolp)
(defvar python-lsp-server 'pyls
"Language server to use for lsp backend. Possible values are `pyls', `pyright'
and `mspyls'")
(put 'python-lsp-server 'safe-local-variable #'symbolp)
(defvar python-lsp-git-root nil
"If non-nil, use a development version of the language server in this folder")
......@@ -54,6 +56,7 @@ If nil then `yapf' is the default formatter unless `lsp' layer is used.")
(defvar python-test-runner 'nose
"Test runner to use. Possible values are `nose' or `pytest'.")
(put 'python-test-runner 'safe-local-variable #'symbolp)
(defvar python-save-before-test t
"If non nil, current buffer will be save before call a test function")
......
......@@ -364,9 +364,8 @@
(spacemacs/register-repl 'python
'spacemacs/python-start-or-switch-repl "python")
(spacemacs//bind-python-repl-keys)
(spacemacs/add-to-hook 'python-mode-hook
'(spacemacs//python-setup-backend
spacemacs//python-default))
(add-hook 'python-mode-local-vars-hook 'spacemacs//python-setup-backend)
(add-hook 'python-mode-hook 'spacemacs//python-default)
;; call `spacemacs//python-setup-shell' once, don't put it in a hook
;; (see issue #5988)
(spacemacs//python-setup-shell))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment