Andersbakken/rtags@cdff9b47fc -> Andersbakken/rtags@db39790fda Sarcasm/irony-mode@ec6dce7ee1 -> Sarcasm/irony-mode@5063d6b16d ananthakumaran/tide@296c0e0e3a -> ananthakumaran/tide@28137ed904 brianc/jade-mode@111460b056 -> brianc/jade-mode@1ad7c51f3c cython/cython@aea4e6b84b -> cython/cython@5b325c9860 dgutov/robe@fd972e912d -> dgutov/robe@11207bd549 dominikh/go-mode.el@34974346d1 -> dominikh/go-mode.el@32cbd78c0a emacs-lsp/lsp-pyright@72fd57643d -> emacs-lsp/lsp-pyright@d428dbcf18 emacs-typescript/typescript.el@2a58631230 -> emacs-typescript/typescript.el@e824162051 galaunay/poetry.el@d5163fe065 -> galaunay/poetry.el@5b9ef569d6 hlissner/emacs-counsel-css@f7647b4195 -> hlissner/emacs-counsel-css@8e9c0515fc hlissner/emacs-pug-mode@d08090485e -> hlissner/emacs-pug-mode@73f8c2f95e jorgenschaefer/pyvenv@045ff9476d -> jorgenschaefer/pyvenv@31ea715f21 necaris/conda.el@4de6eccda5 -> necaris/conda.el@7a34e06931 pythonic-emacs/anaconda-mode@4f367c768a -> pythonic-emacs/anaconda-mode@cbea0fb318 wbolster/emacs-python-pytest@31ae5e0e68 -> wbolster/emacs-python-pytest@b603c5c7f2
lang/python
Description
Adds Python support to Doom Emacs.
- Syntax checking (
flycheck
) - Snippets
- Run tests (
nose
,pytest
) - Auto-format (
black
), requires:editor format
- LSP integration (mspyls, pyls, or pyright)
Module Flags
+lsp
Language Server Protocol support+pyright
Use the pyright LSP server instead of mspyls or pyls (requires+lsp
).+pyenv
Python virtual environment support via pyenv+conda
Python virtual environment support via Conda+poetry
Python packaging, dependency management, and virtual environment support via Poetry+cython
Cython files support via cython-mode
Plugins
- anaconda-mode*
- pyimport*
- py-isort*
- nose*
- python-pytest*
- pip-requirements*
- pipenv*
-
if
+conda
-
if
+pyenv
-
if
+poetry
-
if
+lsp
and:tools lsp
- lsp
-
if
+pyright
-
else
-
if
+cython
- cython-mode
- if
:checkers syntax
: flycheck-cython
Prerequisites
This module has no hard prerequisites, but a few soft ones:
-
For this module's supported test runners:
pip install pytest
pip install nose
- The
:editor format
module uses Black for python files ::pip install black
pyimport
requires Python's modulepyflakes
::pip install pyflakes
py-isort
requires isort to be installed ::pip install isort
-
Python virtual environments install instructions at:
cython
requires Cython
Language Server Protocol Support
For LSP support the :tools lsp
module must be enabled, along with this
module's +lsp
flag. By default, it supports mspyls
and pyls
, in that
order. With the +pyright
flag, it will try Pyright first.
Each of these servers must be installed on your system via your OS package manager or manually:
- pyls can be installed with
pip install python-language-server[all]
. - mspyls can be installed by typing
M-x lsp-install-server RET mspyls
. - pyright can be installed with
pip install pyright
ornpm i -g pyright
.
Features
This module supports LSP. It requires installation of Python Language Server, Microsoft Language Server, or pyright, see LSP Support.
To enable support for auto-formatting with black enable :editor format
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 |