Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* layers/+lang/python/*: New flag python-enable-importmagic #16752

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion layers/+lang/python/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,24 @@ 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.

The importmagic is a heavy feature, will take time to prepare the background
server, especially slow with =ipython= or =ipython3=, set the
=importmagic-python-interpreter= to =python= or =python3= (if it is the
interpreter of ipython) will have performance benefit. Fox example:
#+BEGIN_SRC elisp
(setq-default dotspacemacs-configuration-layers
'((python :variables importmagic-python-interpreter "python3")))
#+END_SRC

To disable the 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 nil)))
#+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 t
"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
Loading