diff --git a/README.rst b/README.rst index a0eb5fa..dcb642f 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ Mypy plugin for PYLS .. image:: https://github.com/Richardk2n/pyls-mypy/workflows/Python%20package/badge.svg?branch=master :target: https://github.com/Richardk2n/pyls-mypy/ -This is a plugin for the Palantir's Python Language Server (https://github.com/palantir/python-language-server) +This is a plugin for the [Python LSP Server](https://github.com/python-lsp/python-lsp-server). It, like mypy, requires Python 3.6 or newer. @@ -15,7 +15,7 @@ It, like mypy, requires Python 3.6 or newer. Installation ------------ -Install into the same virtualenv as pyls itself. +Install into the same virtualenv as python-lsp-server itself. ``pip install mypy-ls`` @@ -31,7 +31,7 @@ Depending on your editor, the configuration (found in a file called mypy-ls.cfg :: { - "enabled": True, - "live_mode": True, - "strict": False + "enabled": True, + "live_mode": True, + "strict": False } diff --git a/mypy_ls/plugin.py b/mypy_ls/plugin.py index e1e9e55..c49b1d3 100644 --- a/mypy_ls/plugin.py +++ b/mypy_ls/plugin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -File that contains the pyls plugin mypy-ls. +File that contains the python-lsp-server plugin mypy-ls. Created on Fri Jul 10 09:53:57 2020 @@ -12,9 +12,9 @@ import os.path import logging from mypy import api as mypy_api -from pyls import hookimpl -from pyls.workspace import Document, Workspace -from pyls.config.config import Config +from pylsp import hookimpl +from pylsp.workspace import Document, Workspace +from pylsp.config.config import Config from typing import Optional, Dict, Any, IO, List import atexit @@ -88,7 +88,7 @@ def parse_line(line: str, document: Optional[Document] = None) -> Optional[Dict[ @hookimpl -def pyls_lint(config: Config, workspace: Workspace, document: Document, +def pylsp_lint(config: Config, workspace: Workspace, document: Document, is_saved: bool) -> List[Dict[str, Any]]: """ Lints. @@ -96,9 +96,9 @@ def pyls_lint(config: Config, workspace: Workspace, document: Document, Parameters ---------- config : Config - The pyls config. + The pylsp config. workspace : Workspace - The pyls workspace. + The pylsp workspace. document : Document The document to be linted. is_saved : bool @@ -144,14 +144,14 @@ def pyls_lint(config: Config, workspace: Workspace, document: Document, @hookimpl -def pyls_settings(config: Config) -> Dict[str, Dict[str, Dict[str, str]]]: +def pylsp_settings(config: Config) -> Dict[str, Dict[str, Dict[str, str]]]: """ Read the settings. Parameters ---------- config : Config - The pyls config. + The pylsp config. Returns ------- diff --git a/requirements.txt b/requirements.txt index a32a2de..b0840b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -python-language-server>=0.34.0 +python-lsp-server mypy diff --git a/setup.cfg b/setup.cfg index e4d82ce..2ef0ec6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] name = mypy-ls author = Tom van Ommeren, Richard Kellnberger -description = Mypy linter for the Python Language Server +description = Mypy linter for the Python LSP Server url = https://github.com/Richardk2n/pyls-mypy long_description = file: README.rst license='MIT' @@ -17,13 +17,13 @@ classifiers = [options] python_requires = >= 3.6 packages = find: -install_requires = - python-language-server>=0.34.0 +install_requires = + python-lsp-server mypy [options.entry_points] -pyls = mypy_ls = mypy_ls.plugin +pylsp = mypy_ls = mypy_ls.plugin [options.extras_require] test = diff --git a/test/test_plugin.py b/test/test_plugin.py index 26b7043..44eed41 100644 --- a/test/test_plugin.py +++ b/test/test_plugin.py @@ -1,8 +1,8 @@ import pytest -from pyls.workspace import Workspace, Document -from pyls.config.config import Config -from pyls import uris +from pylsp.workspace import Workspace, Document +from pylsp.config.config import Config +from pylsp import uris from mock import Mock from mypy_ls import plugin @@ -37,7 +37,7 @@ def plugin_settings(self, plugin, document_path=None): def test_settings(): config = FakeConfig() - settings = plugin.pyls_settings(config) + settings = plugin.pylsp_settings(config) assert settings == {"plugins": {"mypy-ls": {}}} @@ -45,8 +45,8 @@ def test_plugin(workspace): config = FakeConfig() doc = Document(DOC_URI, workspace, DOC_TYPE_ERR) workspace = None - plugin.pyls_settings(config) - diags = plugin.pyls_lint(config, workspace, doc, is_saved=False) + plugin.pylsp_settings(config) + diags = plugin.pylsp_lint(config, workspace, doc, is_saved=False) assert len(diags) == 1 diag = diags[0]