doomemacs/modules/lang/python
Henrik Lissner 0fa93a089f
Bump :lang
Alexander-Miller/company-shell@HEAD -> Alexander-Miller/company-shell@52f3bf2
FStarLang/fstar-mode.el@HEAD -> FStarLang/fstar-mode.el@aaaf256
JuliaEditorSupport/julia-emacs@5238f9a -> JuliaEditorSupport/julia-emacs@1c122f1
Kungsgeten/org-brain@6b7fced -> Kungsgeten/org-brain@cae8e22
OVYA/php-cs-fixer@6540006 -> OVYA/php-cs-fixer@95eace9
ProofGeneral/PG@2a17093 -> ProofGeneral/PG@9196749
aaronjensen/eslintd-fix@98c669e -> aaronjensen/eslintd-fix@0c43114
abicky/nodejs-repl.el@8b90948 -> abicky/nodejs-repl.el@6fad7d7
abo-abo/org-download@3c48102 -> abo-abo/org-download@b96fd7b
agda/agda@74d9fd5 -> agda/agda@ff9173e
alf/ob-restclient.el@c5c22e6 -> alf/ob-restclient.el@f7449b2
ananthakumaran/tide@1878a09 -> ananthakumaran/tide@3b45610
bastibe/org-journal@9d40f62 -> bastibe/org-journal@664c08e
brotzeit/rustic@373f5a1 -> brotzeit/rustic@61032ea
clojure-emacs/cider@7437c67 -> clojure-emacs/cider@52dcc60
clojure-emacs/clj-refactor.el@e24ba62 -> clojure-emacs/clj-refactor.el@92d3723
cpitclaudel/company-coq@6e8bc2e -> cpitclaudel/company-coq@f9dba9d
cython/cython@f6bf6aa -> cython/cython@48dc1f0
defunkt/coffee-mode@86ab8aa -> defunkt/coffee-mode@35a41c7
dgutov/robe@8190cb7 -> dgutov/robe@68503b3
diml/utop@7c99d8c -> diml/utop@30c77ce
dzop/emacs-jupyter@d4b06c5 -> dzop/emacs-jupyter@de7af25
emacs-ess/ESS@a2be8cb -> emacs-ess/ESS@625041a
emacs-lsp/lsp-haskell@6d481f9 -> emacs-lsp/lsp-haskell@582fa27
emacs-lsp/lsp-java@dbeeee9 -> emacs-lsp/lsp-java@6efb741
emacs-php/php-mode@cade4ce -> emacs-php/php-mode@b5d9988
emacs-php/phpactor.el@5ccf65d -> emacs-php/phpactor.el@31fe2ea
emacs-php/phpactor.el@5ccf65d) -> emacs-php/phpactor.el@31fe2ea)
emacs-straight/csv-mode@fbf942e -> emacs-straight/csv-mode@6353374
emacs-straight/org-mode@0a8faec -> emacs-straight/org-mode@ba68555
emacs-typescript/typescript.el@a0f2c3e -> emacs-typescript/typescript.el@102587e
emacsorphanage/gnuplot@a406143 -> emacsorphanage/gnuplot@f0001c3
erlang/otp@c15eb5f -> erlang/otp@3065fbf
factor/factor@a62ea78 -> factor/factor@497d649
felipeochoa/rjsx-mode@014c760 -> felipeochoa/rjsx-mode@0061587
fxbois/web-mode@d1b6660 -> fxbois/web-mode@b0bb4ab
greghendershott/racket-mode@5f396fa -> greghendershott/racket-mode@bd4c8cf
haskell/haskell-mode@4a87d72 -> haskell/haskell-mode@7032966
jaor/geiser@645e477 -> jaor/geiser@83ad875
joaotavora/sly@cfecd21 -> joaotavora/sly@1382bda
jorgenschaefer/emacs-buttercup@178c795 -> jorgenschaefer/emacs-buttercup@b360e35
leanprover/lean-mode@f26e40d -> leanprover/lean-mode@65b55b1
leanprover/lean-mode@f26e40d -> leanprover/lean-mode@65b55b1
ledger/ledger-mode@a514953 -> ledger/ledger-mode@7d78645
mgyucht/jsonnet-mode@2b90b4e -> mgyucht/jsonnet-mode@d8b486c
necaris/conda.el@814439d -> necaris/conda.el@335474e
nonsequitur/inf-ruby@e4ae089 -> nonsequitur/inf-ruby@41e5ed3
ocaml-ppx/ocamlformat@dba4487 -> ocaml-ppx/ocamlformat@5282e04
ocaml/dune@f3df7ab -> ocaml/dune@1944d0f
ocaml/merlin@f6954e9 -> ocaml/merlin@37e38e4
polymode/poly-R@0443c89 -> polymode/poly-R@51ffeb6
polymode/polymode@3eab3c9 -> polymode/polymode@44265e3
purcell/flycheck-ledger@2065bea -> purcell/flycheck-ledger@628e25b
purescript-emacs/psc-ide-emacs@2a93944 -> purescript-emacs/psc-ide-emacs@7fc2b84
s-kostyaev/ivy-erlang-complete@7d60ed1 -> s-kostyaev/ivy-erlang-complete@c443dba
seagle0128/grip-mode@1a61bb7 -> seagle0128/grip-mode@9615c47
skeeto/skewer-mode@123215d -> skeeto/skewer-mode@e5bed35
tpapp/julia-repl@b11a572 -> tpapp/julia-repl@5fa04de
wwwjfy/emacs-fish@688c82d -> wwwjfy/emacs-fish@db257db
xuchunyang/elisp-demos@bec206b -> xuchunyang/elisp-demos@0d74766
yjwen/org-reveal@0d947cb -> yjwen/org-reveal@ea8b502
2020-03-27 16:57:56 -04:00
..
autoload
config.el
doctor.el
packages.el
README.org

lang/python

Description

Adds Python support to Doom Emacs.

  • Syntax checking (flycheck)
  • Snippets
  • Run tests (nose, pytest)
  • Auto-format (black), requires :editor format

Module Flags

  • +lsp Language Server Protocol support
  • +pyenv Python virtual environment support via pyenv
  • +conda Python virtual environment support via Conda
  • +cython Cython files support via Cython-mode

Plugins

Prerequisites

This module has no direct prerequisites. Here are some of its soft dependencies.

  • To run tests inside of Emacs:

    • pip install pytest
    • pip install nose
  • The :editor format module uses Black for python files

    • pip install black
  • pyimport requires Python's module pyflakes:

    • pip install pyflakes
  • py-isort requires isort to be installed:

    • pip install isort
  • Python virtual environments install instructions at:

  • pipenv requires pipenv
  • cython requires Cython

Language Server Protocol Support

This module must be enabled with the +lsp flag, and the :tools lsp module must be enabled. LSP will try mspyls, then pyls; whichever is available.

mypyls can be installed with M-x lsp-install-server after opening a python buffer.

Alternatively, use the Python Language Server instead. pip install 'python-language-server[all]'

Features

This module supports LSP. It requires installation of Python Language Server or Microsoft Language Server, see LSP Support.

To enable support for auto-formatting with black enable :editor format-all in init.el file.

Keybindings

Binding Description
<localleader> c c Compile Cython buffer
<localleader> i i Insert mising imports
<localleader> i r Remove unused imports
<localleader> i s Sort imports
<localleader> i o Optimize imports
<localleader> t r nosetests-again
<localleader> t a nosetests-all
<localleader> t s nosetests-one
<localleader> t v nosetests-module
<localleader> t A nosetests-pdb-all
<localleader> t O nosetests-pdb-one
<localleader> t V nosetests-pdb-module
<localleader> t f python-pytest-file
<localleader> t k python-pytest-file-dwim
<localleader> t t python-pytest-function
<localleader> t m python-pytest-function-dwim
<localleader> t r python-pytest-repeat
<localleader> t p python-pytest-popup
<localleader> g d anaconda-mode-find-definitions
<localleader> g h anaconda-mode-show-doc
<localleader> g a anaconda-mode-find-assignments
<localleader> g f anaconda-mode-find-file
<localleader> g u anaconda-mode-find-references

Configuration

This module has the following variables to set extra arguments to ipython and jupyter shells:

;; ~/.doom.d/config.el
(setq +python-ipython-repl-args '("-i" "--simple-prompt" "--no-color-info"))
(setq +python-jupyter-repl-args '("--simple-prompt"))