lang/python: update & correct README

Corrected typos and misinformation, also mentioned new +pyright flag.
This commit is contained in:
Henrik Lissner 2020-08-07 19:04:41 -04:00
parent 7bec0e3518
commit 39344dee79
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 31 additions and 41 deletions

View file

@ -131,7 +131,7 @@ Modules that bring support for a language or group of languages to Emacs.
+ [[file:../modules/lang/php/README.org][php]] =+hack +lsp= - TODO + [[file:../modules/lang/php/README.org][php]] =+hack +lsp= - TODO
+ plantuml - TODO + plantuml - TODO
+ purescript =+lsp= - TODO + purescript =+lsp= - TODO
+ [[file:../modules/lang/python/README.org][python]] =+cython +lsp +pyenv +conda +poetry= - TODO + [[file:../modules/lang/python/README.org][python]] =+cython +lsp +pyright +pyenv +conda +poetry= - TODO
+ qt - TODO + qt - TODO
+ racket - TODO + racket - TODO
+ [[file:../modules/lang/raku/README.org][raku]] - TODO + [[file:../modules/lang/raku/README.org][raku]] - TODO

View file

@ -20,14 +20,17 @@ Adds Python support to Doom Emacs.
+ Snippets + Snippets
+ Run tests (~nose~, ~pytest~) + Run tests (~nose~, ~pytest~)
+ Auto-format (~black~), requires ~:editor format~ + Auto-format (~black~), requires ~:editor format~
+ LSP integration (mspyls, pyls, or pyright)
** Module Flags ** Module Flags
+ ~+lsp~ Language Server Protocol support + ~+lsp~ Language Server Protocol support
+ ~+pyright~ Use the pyright LSP server instead of mspyls or pyls (requires
~+lsp~).
+ ~+pyenv~ Python virtual environment support via [[https://github.com/pyenv/pyenv][pyenv]] + ~+pyenv~ Python virtual environment support via [[https://github.com/pyenv/pyenv][pyenv]]
+ ~+conda~ Python virtual environment support via [[https://conda.io/en/latest/][Conda]] + ~+conda~ Python virtual environment support via [[https://conda.io/en/latest/][Conda]]
+ ~+poetry~ Python packaging, dependency management, and virtual environment + ~+poetry~ Python packaging, dependency management, and virtual environment
support via [[https://python-poetry.org/][Poetry]] support via [[https://python-poetry.org/][Poetry]]
+ ~+cython~ Cython files support via [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][Cython-mode]] + ~+cython~ Cython files support via [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][cython-mode]]
** Plugins ** Plugins
+ [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]* + [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]*
@ -37,68 +40,55 @@ Adds Python support to Doom Emacs.
+ [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]* + [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]*
+ [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]* + [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]*
+ [[https://github.com/pwalsh/pipenv.el][pipenv]]* + [[https://github.com/pwalsh/pipenv.el][pipenv]]*
+ ~:editor format~ + if ~+conda~
+ [[https://github.com/lassik/emacs-format-all-the-code][format-all]]*
+ ~+conda~
+ [[https://github.com/necaris/conda.el][conda]]* + [[https://github.com/necaris/conda.el][conda]]*
+ ~+pyenv~ + if ~+pyenv~
+ [[https://github.com/pythonic-emacs/pyenv-mode][pyenv]]* + [[https://github.com/pythonic-emacs/pyenv-mode][pyenv]]*
+ ~+poetry~ + if ~+poetry~
+ [[https://github.com/galaunay/poetry.el][poetry]]* + [[https://github.com/galaunay/poetry.el][poetry]]*
+ ~+lsp~ and ~:tools lsp~ + if ~+lsp~ and ~:tools lsp~
+ [[https://github.com/emacs-lsp/lsp-mode][lsp]] + [[https://github.com/emacs-lsp/lsp-mode][lsp]]
+ [[https://github.com/emacs-lsp/lsp-python-ms][lsp-python-ms]]* + if ~+pyright~
+ ~+cython~ + [[https://github.com/emacs-lsp/lsp-pyright][lsp-pyright]]
+ [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][Cython-mode]] + else
+ ~:checkers syntax~ [[https://github.com/lbolla/emacs-flycheck-cython/tree/master][Flycheck-cython]] + [[https://github.com/emacs-lsp/lsp-python-ms][lsp-python-ms]]
+ if ~+cython~
+ [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][cython-mode]]
+ if ~:checkers syntax~: [[https://github.com/lbolla/emacs-flycheck-cython/tree/master][flycheck-cython]]
* Prerequisites * Prerequisites
This module has no direct prerequisites. Here are some of its soft dependencies. This module has no hard prerequisites, but a few soft ones:
+ To run tests inside of Emacs: + For this module's supported test runners:
+ ~pip install pytest~ + ~pip install pytest~
+ ~pip install nose~ + ~pip install nose~
+ The ~:editor format~ module uses [[https://github.com/psf/black][Black]] for python files :: ~pip install black~
+ The ~:editor format~ module uses [[https://github.com/psf/black][Black]] for python files + ~pyimport~ requires Python's module ~pyflakes~ :: ~pip install pyflakes~
+ ~pip install black~ + ~py-isort~ requires [[https://github.com/timothycrosley/isort][isort]] to be installed :: ~pip install isort~
+ ~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: + Python virtual environments install instructions at:
+ [[https://github.com/pyenv/pyenv][pyenv]] + [[https://github.com/pyenv/pyenv][pyenv]]
+ [[https://conda.io/en/latest/][Conda]] + [[https://conda.io/en/latest/][Conda]]
+ [[https://python-poetry.org/][Poetry]] + [[https://python-poetry.org/][Poetry]]
+ [[https://pipenv.readthedocs.io/en/latest/][pipenv]]
+ ~pipenv~ requires [[https://pipenv.readthedocs.io/en/latest/][pipenv]]
+ ~cython~ requires [[https://cython.org/][Cython]] + ~cython~ requires [[https://cython.org/][Cython]]
** Language Server Protocol Support ** Language Server Protocol Support
This module must be enabled with the =+lsp= flag, and the =:tools lsp= module For LSP support the =:tools lsp= module must be enabled, along with this
must be enabled. LSP will try pyls then mspyls; the first that is available. module's =+lsp= flag. By default, it supports =mspyls= and =pyls=, in that
order. With the =+pyright= flag, it will try Pyright first.
*To use [[https://pypi.org/project/python-language-server/][Python Language Server]] (pyls)* install it with ~pip install Each of these servers must be installed on your system via your OS package
'python-language-server[all]'~ manager or manually:
*To use mspyls*, install it with ~M-x lsp-install-server~ and add this to your + [[https://pypi.org/project/python-language-server/][*pyls*]] can be installed with ~pip install python-language-server[all]~.
private config.el: + *mspyls* can be installed by typing =M-x lsp-install-server RET mspyls=.
+ *pyright* can be installed with ~pip install pyright~ or ~npm i -g pyright~.
#+BEGIN_SRC elisp
(after! lsp-python-ms
(set-lsp-priority! 'mspyls 1))
#+END_SRC
*To use pyright*, install it from your shell with with ~npm i -g pyright~.
* Features * Features
This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language
Server]], [[https://github.com/Microsoft/python-language-server][Microsoft Language Server]], or [[https://github.com/microsoft/pyright][pyright]], see [[Language Server Protocol Support][LSP Support]]. Server]], [[https://github.com/Microsoft/python-language-server][Microsoft Language Server]], or [[https://github.com/microsoft/pyright][pyright]], see [[Language Server Protocol Support][LSP Support]].
To enable support for auto-formatting with black enable ~:editor format-all~ in To enable support for auto-formatting with black enable ~:editor format~ in
~init.el~ file. ~init.el~ file.
** Keybindings ** Keybindings