Skip to content

Commit

Permalink
Merge pull request #1745 from galaunay/Fix1740
Browse files Browse the repository at this point in the history
Install flake8 in the current env instead of the rpc venv
  • Loading branch information
galaunay committed Jan 12, 2020
2 parents 29b81d9 + 2a01a56 commit c879ae8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions elpy.el
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ item in another window.\n\n")
"\n")
(insert "\n")
(widget-create 'elpy-insert--pip-button
:package python-shell-interpreter)
:package python-shell-interpreter :norpc t)
(insert "\n\n"))

;; Pip not available in the rpc virtualenv
Expand Down Expand Up @@ -970,7 +970,7 @@ item in another window.\n\n")
"program to provide syntax checks of your programs, so you might "
"want to install one. Elpy by default uses flake8.\n")
(insert "\n")
(widget-create 'elpy-insert--pip-button :package "flake8")
(widget-create 'elpy-insert--pip-button :package "flake8" :norpc t)
(insert "\n\n"))

))
Expand Down Expand Up @@ -1285,8 +1285,12 @@ PyPI, or nil if that's VERSION."

(defun elpy-insert--pip-button-action (widget &optional _event)
"The :action option for the pip button widget."
(with-elpy-rpc-virtualenv-activated
(async-shell-command (widget-get widget :command))))
(let ((command (widget-get widget :command))
(norpc (widget-get widget :norpc)))
(if norpc
(async-shell-command command)
(with-elpy-rpc-virtualenv-activated
(async-shell-command command)))))

;;;;;;;;;;;;
;;; Projects
Expand Down

0 comments on commit c879ae8

Please sign in to comment.