From 9740902630ca5bf94deb84a6a0862bb80243f79c Mon Sep 17 00:00:00 2001 From: Mariana Meireles Date: Mon, 15 Mar 2021 15:54:36 +0000 Subject: [PATCH 1/6] Update README.rst Hi! I'm the maintainer of `pyls-memestra` and I'd like to add it here as a 3rd party plugin :) Please let me know if I should add this info somewhere else. Thank you for open sourcing the project and for all the work! Cheers. --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index cd53e853..25749474 100644 --- a/README.rst +++ b/README.rst @@ -52,6 +52,7 @@ 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_ +* pyls-memestra_ a static analysis tool for Python, which detects the use of deprecated APIs. 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. @@ -165,4 +166,5 @@ This project is made available under the MIT License. .. _pyls-mypy: https://github.com/tomv564/pyls-mypy .. _pyls-isort: https://github.com/paradoxxxzero/pyls-isort .. _pyls-black: https://github.com/rupert/pyls-black +.. _pyls-memestra: https://github.com/QuantStack/pyls-memestra .. _Black: https://github.com/ambv/black From 6fc93ce4c2d331c0e6c14e99108ae55b31d6177b Mon Sep 17 00:00:00 2001 From: xiaoxiae Date: Tue, 16 Mar 2021 17:54:59 +0100 Subject: [PATCH 2/6] Rewrite README from rst to md --- README.md | 139 ++++++++++++++++++++++++++++++++++++++++++++ README.rst | 168 ----------------------------------------------------- 2 files changed, 139 insertions(+), 168 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 00000000..6a805aea --- /dev/null +++ b/README.md @@ -0,0 +1,139 @@ +# Python Language Server + +[![image](https://github.com/python-ls/python-ls/workflows/Linux%20tests/badge.svg)](https://github.com/python-ls/python-ls/actions?query=workflow%3A%22Linux+tests%22) [![image](https://github.com/python-ls/python-ls/workflows/Mac%20tests/badge.svg)](https://github.com/python-ls/python-ls/actions?query=workflow%3A%22Mac+tests%22) [![image](https://github.com/python-ls/python-ls/workflows/Windows%20tests/badge.svg)](https://github.com/python-ls/python-ls/actions?query=workflow%3A%22Windows+tests%22) [![image](https://img.shields.io/github/license/python-ls/python-ls.svg)](https://github.com/python-ls/python-ls/blob/master/LICENSE) + +A Python 2.7 and 3.5+ implementation of the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol). + +## Installation + +The base language server requires [Jedi](https://github.com/davidhalter/jedi) to provide Completions, Definitions, Hover, References, Signature Help, and Symbols: + +``` +pip install python-language-server +``` + +If the respective dependencies are found, the following optional providers will be enabled: +- [Rope](https://github.com/python-rope/rope) for Completions and renaming +- [Pyflakes](https://github.com/PyCQA/pyflakes) linter to detect various errors +- [McCabe](https://github.com/PyCQA/mccabe) linter for complexity checking +- [pycodestyle](https://github.com/PyCQA/pycodestyle) linter for style checking +- [pydocstyle](https://github.com/PyCQA/pydocstyle) linter for docstring style checking (disabled by default) +- [autopep8](https://github.com/hhatto/autopep8) for code formatting +- [YAPF](https://github.com/google/yapf) for code formatting (preferred over autopep8) + +Optional providers can be installed using the `extras` syntax. To install [YAPF](https://github.com/google/yapf) formatting for example: + +``` +pip install 'python-language-server[yapf]' +``` + +All optional providers can be installed using: + +``` +pip install 'python-language-server[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 +``` + +### 3rd Party Plugins + +Installing these plugins will add extra functionality to the language server: + +- [pyls-mypy](https://github.com/tomv564/pyls-mypy) Mypy type checking for Python 3 +- [pyls-isort](https://github.com/paradoxxxzero/pyls-isort) Isort import sort code formatting +- [pyls-black](https://github.com/rupert/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 + +Configuration is loaded from zero or more configuration sources. Currently implemented are: + +- pycodestyle: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`. +- flake8: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg` + +The default configuration source is pycodestyle. Change the `pyls.configurationSources` setting to `['flake8']` in order to respect flake8 configuration instead. + +Overall configuration is computed first from user configuration (in home directory), overridden by configuration passed in by the language client, and then overriden by configuration discovered in the workspace. + +To enable pydocstyle for linting docstrings add the following setting in your LSP configuration: +`\` "pyls.plugins.pydocstyle.enabled": true \`` + +See [vscode-client/package.json](vscode-client/package.json) for the full set of supported configuration options. + +## Language Server Features + +Auto Completion: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/auto-complete.gif) + +Code Linting with pycodestyle and pyflakes: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/linting.gif) + +Signature Help: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/signature-help.gif) + +Go to definition: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/goto-definition.gif) + +Hover: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/hover.gif) + +Find References: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/references.gif) + +Document Symbols: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-symbols.gif) + +Document Formatting: + +![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-format.gif) + +## Development + +To run the test suite: + +``` +pip install .[test] && pytest +``` + +# Develop against VS Code + +The Python language server can be developed against a local instance of +Visual Studio Code. + +Install [VSCode](https://code.visualstudio.com/download) + +```bash +# Setup a virtual env +virtualenv env +. env/bin/activate + +# Install pyls +pip install . + +# Install the vscode-client extension +cd vscode-client +yarn install + +# Run VSCode which is configured to use pyls +# See the bottom of vscode-client/src/extension.ts for info +yarn run vscode -- $PWD/../ +``` + +Then to debug, click View -> Output and in the dropdown will be pyls. +To refresh VSCode, press `Cmd + r` + +## License + +This project is made available under the MIT License. diff --git a/README.rst b/README.rst deleted file mode 100644 index cd53e853..00000000 --- a/README.rst +++ /dev/null @@ -1,168 +0,0 @@ -Python Language Server -====================== - -.. image:: https://github.com/python-ls/python-ls/workflows/Linux%20tests/badge.svg - :target: https://github.com/python-ls/python-ls/actions?query=workflow%3A%22Linux+tests%22 - -.. image:: https://github.com/python-ls/python-ls/workflows/Mac%20tests/badge.svg - :target: https://github.com/python-ls/python-ls/actions?query=workflow%3A%22Mac+tests%22 - -.. image:: https://github.com/python-ls/python-ls/workflows/Windows%20tests/badge.svg - :target: https://github.com/python-ls/python-ls/actions?query=workflow%3A%22Windows+tests%22 - -.. image:: https://img.shields.io/github/license/python-ls/python-ls.svg - :target: https://github.com/python-ls/python-ls/blob/master/LICENSE - -A Python 2.7 and 3.5+ implementation of the `Language Server Protocol`_. - -Installation ------------- - -The base language server requires Jedi_ to provide Completions, Definitions, Hover, References, Signature Help, and -Symbols: - -``pip install python-language-server`` - -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 'python-language-server[yapf]'`` - -All optional providers can be installed using: - -``pip install 'python-language-server[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`` - -3rd Party Plugins -~~~~~~~~~~~~~~~~~ -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_ - -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 -------------- - -Configuration is loaded from zero or more configuration sources. Currently implemented are: - -* pycodestyle: discovered in ~/.config/pycodestyle, setup.cfg, tox.ini and pycodestyle.cfg. -* flake8: discovered in ~/.config/flake8, setup.cfg, tox.ini and flake8.cfg - -The default configuration source is pycodestyle. Change the `pyls.configurationSources` setting to `['flake8']` in -order to respect flake8 configuration instead. - -Overall configuration is computed first from user configuration (in home directory), overridden by configuration -passed in by the language client, and then overriden by configuration discovered in the workspace. - -To enable pydocstyle for linting docstrings add the following setting in your LSP configuration: -``` -"pyls.plugins.pydocstyle.enabled": true -``` - -See `vscode-client/package.json`_ for the full set of supported configuration options. - -.. _vscode-client/package.json: vscode-client/package.json - -Language Server Features ------------------------- - -Auto Completion: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/auto-complete.gif - -Code Linting with pycodestyle and pyflakes: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/linting.gif - -Signature Help: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/signature-help.gif - -Go to definition: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/goto-definition.gif - -Hover: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/hover.gif - -Find References: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/references.gif - -Document Symbols: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-symbols.gif - -Document Formatting: - -.. image:: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-format.gif - -Development ------------ - -To run the test suite: - -``pip install .[test] && pytest`` - -Develop against VS Code -======================= - -The Python language server can be developed against a local instance of Visual Studio Code. - -Install `VSCode `_ - -.. code-block:: bash - - # Setup a virtual env - virtualenv env - . env/bin/activate - - # Install pyls - pip install . - - # Install the vscode-client extension - cd vscode-client - yarn install - - # Run VSCode which is configured to use pyls - # See the bottom of vscode-client/src/extension.ts for info - yarn run vscode -- $PWD/../ - -Then to debug, click View -> Output and in the dropdown will be pyls. -To refresh VSCode, press `Cmd + r` - -License -------- - -This project is made available under the MIT License. - -.. _Language Server Protocol: https://github.com/Microsoft/language-server-protocol -.. _Jedi: https://github.com/davidhalter/jedi -.. _Rope: https://github.com/python-rope/rope -.. _Pyflakes: https://github.com/PyCQA/pyflakes -.. _McCabe: https://github.com/PyCQA/mccabe -.. _pycodestyle: https://github.com/PyCQA/pycodestyle -.. _pydocstyle: https://github.com/PyCQA/pydocstyle -.. _YAPF: https://github.com/google/yapf -.. _autopep8: https://github.com/hhatto/autopep8 -.. _pyls-mypy: https://github.com/tomv564/pyls-mypy -.. _pyls-isort: https://github.com/paradoxxxzero/pyls-isort -.. _pyls-black: https://github.com/rupert/pyls-black -.. _Black: https://github.com/ambv/black From 905cecde0e60d0fa7c97c947007d4b210697872c Mon Sep 17 00:00:00 2001 From: xiaoxiae Date: Tue, 16 Mar 2021 18:01:34 +0100 Subject: [PATCH 3/6] Update README references from .rst to .md --- MANIFEST.in | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 20438d9a..eea26600 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include README.rst +include README.md include versioneer.py include pyls/_version.py include LICENSE diff --git a/setup.py b/setup.py index 9ca60eb3..a1fa96c3 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import versioneer import sys -README = open('README.rst', 'r').read() +README = open('README.md', 'r').read() install_requires = [ 'configparser; python_version<"3.0"', From e213eff3997d6f269fc24b700940e320a4501b46 Mon Sep 17 00:00:00 2001 From: xiaoxiae Date: Wed, 17 Mar 2021 08:47:04 +0100 Subject: [PATCH 4/6] Add long_description_content_type for Markdown --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index a1fa96c3..11e7d5bc 100755 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ description='Python Language Server for the Language Server Protocol', long_description=README, + long_description_content_type='text/markdown', # The project's main homepage. url='https://github.com/python-ls/python-ls', From ce47547f1a7789b92b0c76f8ee4ae0bedd809c3d Mon Sep 17 00:00:00 2001 From: Mariana Meireles Date: Thu, 18 Mar 2021 12:30:44 +0000 Subject: [PATCH 5/6] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 25749474..5003cf9f 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ 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_ -* pyls-memestra_ a static analysis tool for Python, which detects the use of deprecated APIs. +* pyls-memestra_ for detecting the use of deprecated APIs 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. From 5253201d4568460c95fa21ff0256138b904a92ff Mon Sep 17 00:00:00 2001 From: krassowski Date: Fri, 19 Mar 2021 17:37:05 +0000 Subject: [PATCH 6/6] Update paths for the gifs --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 34a0fc74..ad19b5c3 100644 --- a/README.md +++ b/README.md @@ -70,35 +70,35 @@ See [vscode-client/package.json](vscode-client/package.json) for the full set of Auto Completion: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/auto-complete.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/auto-complete.gif) Code Linting with pycodestyle and pyflakes: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/linting.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/linting.gif) Signature Help: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/signature-help.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/signature-help.gif) Go to definition: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/goto-definition.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/goto-definition.gif) Hover: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/hover.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/hover.gif) Find References: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/references.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/references.gif) Document Symbols: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-symbols.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/document-symbols.gif) Document Formatting: -![image](https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-format.gif) +![image](https://raw.githubusercontent.com/python-ls/python-ls/develop/resources/document-format.gif) ## Development