lang/python: add bootstrap
This commit is contained in:
parent
c6a61b9b2c
commit
4cebeb092e
1 changed files with 17 additions and 0 deletions
|
@ -7,3 +7,20 @@
|
|||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-anaconda))
|
||||
|
||||
;;
|
||||
(def-bootstrap! python
|
||||
;; Since there are so many possible setups for a python environment (pyenv,
|
||||
;; virtualenv, etc), I'll leave it to you and only take care of installing
|
||||
;; dependencies available via pip.
|
||||
(unless (executable-find "python")
|
||||
(error "python isn't installed"))
|
||||
(unless (executable-find "pip")
|
||||
(error "pip isn't installed"))
|
||||
(when-let (pkgs (cl-remove-if
|
||||
(lambda (pkg) (zerop (shell-command (format "pip show %s" pkg))))
|
||||
'("jedi" "setuptools")))
|
||||
(funcall (if (file-writable-p (executable-find "pip")) 'sh 'sudo)
|
||||
"pip install %s"
|
||||
(string-join pkgs " "))
|
||||
t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue