A Python 2.7 and 3.5+ implementation of the Language Server Protocol.
The base language server requires Jedi to provide Completions, Definitions, Hover, References, Signature Help, and Symbols:
pip install spyder-pyls
If the respective dependencies are found, the following optional providers will be enabled:
- Rope for completions and renaming
- Pyflakes linter to detect various errors
- McCabe linter for complexity checking
- pycodestyle linter for style checking
- pydocstyle linter for docstring style checking (disabled by default)
- autopep8 for code formatting
- YAPF for code formatting (preferred over autopep8)
Optional providers can be installed using the extras
syntax. To install YAPF formatting for example:
pip install 'spyder-pyls[yapf]'
All optional providers can be installed using:
pip install 'spyder-pyls[all]'
If you get an error similar to 'install_requires' must be a string or list of strings
then please upgrade setuptools before trying again.
pip install -U setuptools
Installing these plugins will add extra functionality to the language server:
- pyls-mypy Mypy type checking for Python 3
- pyls-isort Isort import sort code formatting
- pyls-black for code formatting using [Black(https://github.com/ambv/black)
Please see the above repositories for examples on how to write plugins for the Python Language Server. Please file an issue if you require assistance writing a plugin.
Configuration is loaded from zero or more configuration sources. Currently implemented are:
- pycodestyle: discovered in
~/.config/pycodestyle
,setup.cfg
,tox.ini
andpycodestyle.cfg
- flake8: discovered in
~/.config/flake8
,setup.cfg
,tox.ini
andflake8.cfg
The default configuration source is pycodestyle.
- Code completion
- Code linting (Warnings and errors)
To run the test suite:
pip install .[test] && tox
The Python language server can be developed against a local instance of Spyder IDE.
- Install it with
pip install -e .
- Start Spyder in debug mode (
python bootstrap.py --debug
) - Check logs for both client and server in
~/.spyder-py3/lsp-logs
This project is made available under the MIT License.
Spyder is funded thanks to the generous support of
and the donations we have received from our users around the world through Open Collective: