Skip to content

Commit 4b968d3

Browse files
authored
Merge pull request #2 from haplo/python-lsp-server-mypy-ls
Depend on python-lsp-server
2 parents 6ed04c1 + 06cb3c9 commit 4b968d3

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Mypy plugin for PYLS
77
.. image:: https://github.com/Richardk2n/pyls-mypy/workflows/Python%20package/badge.svg?branch=master
88
:target: https://github.com/Richardk2n/pyls-mypy/
99

10-
This is a plugin for the Palantir's Python Language Server (https://github.com/palantir/python-language-server)
10+
This is a plugin for the [Python LSP Server](https://github.com/python-lsp/python-lsp-server).
1111

1212
It, like mypy, requires Python 3.6 or newer.
1313

1414

1515
Installation
1616
------------
1717

18-
Install into the same virtualenv as pyls itself.
18+
Install into the same virtualenv as python-lsp-server itself.
1919

2020
``pip install mypy-ls``
2121

@@ -31,7 +31,7 @@ Depending on your editor, the configuration (found in a file called mypy-ls.cfg
3131
::
3232

3333
{
34-
"enabled": True,
35-
"live_mode": True,
36-
"strict": False
34+
"enabled": True,
35+
"live_mode": True,
36+
"strict": False
3737
}

mypy_ls/plugin.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
File that contains the pyls plugin mypy-ls.
3+
File that contains the python-lsp-server plugin mypy-ls.
44
55
Created on Fri Jul 10 09:53:57 2020
66
@@ -12,9 +12,9 @@
1212
import os.path
1313
import logging
1414
from mypy import api as mypy_api
15-
from pyls import hookimpl
16-
from pyls.workspace import Document, Workspace
17-
from pyls.config.config import Config
15+
from pylsp import hookimpl
16+
from pylsp.workspace import Document, Workspace
17+
from pylsp.config.config import Config
1818
from typing import Optional, Dict, Any, IO, List
1919
import atexit
2020

@@ -88,17 +88,17 @@ def parse_line(line: str, document: Optional[Document] = None) -> Optional[Dict[
8888

8989

9090
@hookimpl
91-
def pyls_lint(config: Config, workspace: Workspace, document: Document,
91+
def pylsp_lint(config: Config, workspace: Workspace, document: Document,
9292
is_saved: bool) -> List[Dict[str, Any]]:
9393
"""
9494
Lints.
9595
9696
Parameters
9797
----------
9898
config : Config
99-
The pyls config.
99+
The pylsp config.
100100
workspace : Workspace
101-
The pyls workspace.
101+
The pylsp workspace.
102102
document : Document
103103
The document to be linted.
104104
is_saved : bool
@@ -144,14 +144,14 @@ def pyls_lint(config: Config, workspace: Workspace, document: Document,
144144

145145

146146
@hookimpl
147-
def pyls_settings(config: Config) -> Dict[str, Dict[str, Dict[str, str]]]:
147+
def pylsp_settings(config: Config) -> Dict[str, Dict[str, Dict[str, str]]]:
148148
"""
149149
Read the settings.
150150
151151
Parameters
152152
----------
153153
config : Config
154-
The pyls config.
154+
The pylsp config.
155155
156156
Returns
157157
-------

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
python-language-server>=0.34.0
1+
python-lsp-server
22
mypy

setup.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = mypy-ls
33
author = Tom van Ommeren, Richard Kellnberger
4-
description = Mypy linter for the Python Language Server
4+
description = Mypy linter for the Python LSP Server
55
url = https://github.com/Richardk2n/pyls-mypy
66
long_description = file: README.rst
77
license='MIT'
@@ -17,13 +17,13 @@ classifiers =
1717
[options]
1818
python_requires = >= 3.6
1919
packages = find:
20-
install_requires =
21-
python-language-server>=0.34.0
20+
install_requires =
21+
python-lsp-server
2222
mypy
2323

2424

2525
[options.entry_points]
26-
pyls = mypy_ls = mypy_ls.plugin
26+
pylsp = mypy_ls = mypy_ls.plugin
2727

2828
[options.extras_require]
2929
test =

test/test_plugin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import pytest
22

3-
from pyls.workspace import Workspace, Document
4-
from pyls.config.config import Config
5-
from pyls import uris
3+
from pylsp.workspace import Workspace, Document
4+
from pylsp.config.config import Config
5+
from pylsp import uris
66
from mock import Mock
77
from mypy_ls import plugin
88

@@ -37,16 +37,16 @@ def plugin_settings(self, plugin, document_path=None):
3737

3838
def test_settings():
3939
config = FakeConfig()
40-
settings = plugin.pyls_settings(config)
40+
settings = plugin.pylsp_settings(config)
4141
assert settings == {"plugins": {"mypy-ls": {}}}
4242

4343

4444
def test_plugin(workspace):
4545
config = FakeConfig()
4646
doc = Document(DOC_URI, workspace, DOC_TYPE_ERR)
4747
workspace = None
48-
plugin.pyls_settings(config)
49-
diags = plugin.pyls_lint(config, workspace, doc, is_saved=False)
48+
plugin.pylsp_settings(config)
49+
diags = plugin.pylsp_lint(config, workspace, doc, is_saved=False)
5050

5151
assert len(diags) == 1
5252
diag = diags[0]

0 commit comments

Comments
 (0)