cython/cython@48dc1f0 -> cython/cython@12ab8bc
emacs-lsp/lsp-python-ms@5d0c799 -> emacs-lsp/lsp-python-ms@db6f263
galaunay/poetry.el@6dcc9d2 -> galaunay/poetry.el@d876522
necaris/conda.el@335474e -> necaris/conda.el@9d02130
pwalsh/pipenv.el@b730bb5 -> pwalsh/pipenv.el@b730bb5
pythonic-emacs/company-anaconda@a31354c -> pythonic-emacs/company-anaconda@da1566d
pythonic-emacs/pyenv-mode@aec6f2a -> pythonic-emacs/pyenv-mode@d191037
We're also transitioning from abbreviated SHA1 hashes to full ones. See
|
||
---|---|---|
.. | ||
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+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*
-
:editor format
-
+conda
-
+pyenv
-
+poetry
-
+lsp
and:tools lsp
-
+cython
- Cython-mode
:checkers syntax
Flycheck-cython
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 filespip 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:
pipenv
requires pipenvcython
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 pyls then mspyls; the first that is available.
To use Python Language Server (pyls) install it with pip install
'python-language-server[all]'
To use mspyls, install it with M-x lsp-install-server
and add this to your
private config.el:
(after! lsp-python-ms
(set-lsp-priority! 'mspyls 1))
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 |