emacs-lsp/dap-mode@d472a6c937 -> emacs-lsp/dap-mode@00e1a5d70c emacs-lsp/lsp-dart@01d89d43f1 -> emacs-lsp/lsp-dart@64fb5d9303 emacs-lsp/lsp-haskell@eb37ac4a6a -> emacs-lsp/lsp-haskell@4e62cf897d emacs-lsp/lsp-ivy@bccd86028e -> emacs-lsp/lsp-ivy@3e87441a62 emacs-lsp/lsp-java@b66a075bcb -> emacs-lsp/lsp-java@2a7d27e899 emacs-lsp/lsp-metals@9f82ebee48 -> emacs-lsp/lsp-metals@ca927e5a83 emacs-lsp/lsp-pyright@71a7976093 -> emacs-lsp/lsp-pyright@72fd57643d emacs-lsp/lsp-sourcekit@ae4aa8705c -> emacs-lsp/lsp-sourcekit@97ff36b228 joaotavora/eglot@194b178ef4 -> joaotavora/eglot@c17bdf6c98 non-Jedi/lsp-julia@d4a7a27d6a -> non-Jedi/lsp-julia@809da95c05 Updates lsp-mode and all lsp packages for the LSP 8.0.0 release. Close #5455 Close #5453 Close #5440 Close #5410 |
||
|---|---|---|
| .. | ||
| 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 - LSP integration (mspyls, pyls, or pyright)
Module Flags
+lspLanguage Server Protocol support+pyrightUse the pyright LSP server instead of mspyls or pyls (requires+lsp).+pyenvPython virtual environment support via pyenv+condaPython virtual environment support via Conda+poetryPython packaging, dependency management, and virtual environment support via Poetry+cythonCython files support via cython-mode
Plugins
- anaconda-mode*
- pyimport*
- py-isort*
- nose*
- python-pytest*
- pip-requirements*
- pipenv*
-
if
+conda -
if
+pyenv -
if
+poetry -
if
+lspand: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 pytestpip install nose
- The
:editor formatmodule uses Black for python files ::pip install black pyimportrequires Python's modulepyflakes::pip install pyflakespy-isortrequires isort to be installed ::pip install isort-
Python virtual environments install instructions at:
cythonrequires 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 pyrightornpm 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 |