Make anaconda & pipenv integrations remote-aware

Resolve paths to pipenv and python-shell-interpreter on the remote if
over tramp.
This commit is contained in:
Henrik Lissner 2021-01-08 17:45:33 -05:00
parent 5da3641aad
commit c8bfbda556
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -102,7 +102,7 @@
(unless (or (bound-and-true-p lsp-mode) (unless (or (bound-and-true-p lsp-mode)
(bound-and-true-p eglot--managed-mode) (bound-and-true-p eglot--managed-mode)
(bound-and-true-p lsp--buffer-deferred) (bound-and-true-p lsp--buffer-deferred)
(not (executable-find python-shell-interpreter))) (not (executable-find python-shell-interpreter t)))
(anaconda-mode +1)))) (anaconda-mode +1))))
:config :config
(set-company-backend! 'anaconda-mode '(company-anaconda)) (set-company-backend! 'anaconda-mode '(company-anaconda))
@ -207,7 +207,7 @@
(set-eval-handler! 'python-mode (set-eval-handler! 'python-mode
'((:command . (lambda () python-shell-interpreter)) '((:command . (lambda () python-shell-interpreter))
(:exec (lambda () (:exec (lambda ()
(if-let* ((bin (executable-find "pipenv")) (if-let* ((bin (executable-find "pipenv" t))
(_ (pipenv-project-p))) (_ (pipenv-project-p)))
(format "PIPENV_MAX_DEPTH=9999 %s run %%c %%o %%s %%a" bin) (format "PIPENV_MAX_DEPTH=9999 %s run %%c %%o %%s %%a" bin)
"%c %o %s %a"))) "%c %o %s %a")))