Skip to content

Commit

Permalink
* layers/+lang/python/*: New flag python-enable-importmagic
Browse files Browse the repository at this point in the history
  • Loading branch information
sunlin7 authored and Lin Sun committed Dec 24, 2024
1 parent abba23b commit 7881763
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion layers/+lang/python/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,15 @@ config section:
or as a directory-local variable (for per-project settings).

** Importmagic
Install importmagic and epc for importmagic functionality.
Install importmagic and epc for importmagic functionality, it will start a epc
instance on background to serve the requests.

To enable importmagic, set the =python-enable-importmagic= in the python layer
config section:
#+BEGIN_SRC elisp
(setq-default dotspacemacs-configuration-layers
'((python :variables python-enable-importmagic t)))
#+END_SRC

#+BEGIN_SRC sh
pip install importmagic epc
Expand Down
3 changes: 3 additions & 0 deletions layers/+lang/python/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Possible values are `on-visit', `on-project-switch' or `nil'.")
(defvar python-sort-imports-on-save nil
"If non-nil, automatically sort imports on save.")

(defvar python-enable-importmagic nil
"If non-nil, enable the importmagic feature.")

(defvar spacemacs--python-pyenv-modes nil
"List of major modes where to add pyenv support.")

Expand Down
2 changes: 1 addition & 1 deletion layers/+lang/python/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
ggtags
helm-cscope
(helm-pydoc :requires helm)
importmagic
(importmagic :toggle python-enable-importmagic)
live-py-mode
(nose :location (recipe :fetcher github :repo "syl20bnr/nose.el")
:toggle (memq 'nose (flatten-list (list python-test-runner))))
Expand Down

0 comments on commit 7881763

Please sign in to comment.