diff --git a/modules/lang/python/README.org b/modules/lang/python/README.org index 57e555f8f..b0eff6697 100644 --- a/modules/lang/python/README.org +++ b/modules/lang/python/README.org @@ -31,7 +31,7 @@ Adds Python support to Doom Emacs. ** Plugins + [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]* + [[https://github.com/Wilfred/pyimport][pyimport]]* -+ [[https://github.com/emacs-pe/pyimpsort.el][pyimpsort]]* ++ [[https://github.com/paetzke/py-isort.el][py-isort]]* + [[https://melpa.org/#/nose][nose]]* + [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]* + [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]* @@ -67,6 +67,9 @@ This module has no direct prerequisites. Here are some of its soft dependencies. + ~pyimport~ requires Python's module ~pyflakes~: + ~pip install pyflakes~ ++ ~py-isort~ requires [[https://github.com/timothycrosley/isort][isort]] to be installed: + + ~pip install isort~ + + Python virtual environments install instructions at: + [[https://github.com/pyenv/pyenv][pyenv]] + [[https://conda.io/en/latest/][Conda]] diff --git a/modules/lang/python/autoload/python.el b/modules/lang/python/autoload/python.el index 6cfd0429b..4f6ef7f3b 100644 --- a/modules/lang/python/autoload/python.el +++ b/modules/lang/python/autoload/python.el @@ -59,4 +59,4 @@ "organize imports" (interactive) (pyimport-remove-unused) - (pyimpsort-buffer)) + (py-isort-buffer)) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 66450c698..d8d72f6a7 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -139,10 +139,19 @@ called.") (:prefix ("i" . "imports") :desc "Insert missing imports" "i" #'pyimport-insert-missing :desc "Remove unused imports" "r" #'pyimport-remove-unused - :desc "Sort imports" "s" #'pyimpsort-buffer :desc "Optimize imports" "o" #'+python/optimize-imports))) +(use-package! py-isort + :defer t + :init + (map! :after python + :map python-mode-map + :localleader + (:prefix ("i" . "imports") + :desc "Sort imports" "s" #'py-isort-buffer + :desc "Sort region" "r" #'py-isort-region))) + (use-package! nose :commands nose-mode :preface (defvar nose-mode-map (make-sparse-keymap)) diff --git a/modules/lang/python/packages.el b/modules/lang/python/packages.el index 600af8529..053f1fb94 100644 --- a/modules/lang/python/packages.el +++ b/modules/lang/python/packages.el @@ -31,4 +31,4 @@ ;; Import managements (package! pyimport) -(package! pyimpsort) +(package! py-isort)