Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depend on python-lsp-server #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Mypy plugin for PYLS
.. image:: https://travis-ci.org/tomv564/pyls-mypy.svg?branch=master
:target: https://travis-ci.org/tomv564/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.2 or newer.


Installation
------------

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

``pip install pyls-mypy``

Expand All @@ -34,7 +34,7 @@ Depending on your editor, the configuration should be roughly like this:

::

"pyls":
"pylsp":
{
"plugins":
{
Expand Down
2 changes: 1 addition & 1 deletion pyls_mypy/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_config():
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = ""
cfg.versionfile_source = "pyls/_version.py"
cfg.versionfile_source = "pylsp/_version.py"
cfg.verbose = False
return cfg

Expand Down
4 changes: 2 additions & 2 deletions pyls_mypy/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import logging
from mypy import api as mypy_api
from pyls import hookimpl
from pylsp import hookimpl

line_pattern = r"([^:]+):(?:(\d+):)?(?:(\d+):)? (\w+): (.*)"

Expand Down Expand Up @@ -53,7 +53,7 @@ def parse_line(line, document=None):


@hookimpl
def pyls_lint(config, workspace, document, is_saved):
def pylsp_lint(config, workspace, document, is_saved):
settings = config.plugin_settings('pyls_mypy')
live_mode = settings.get('live_mode', True)
if live_mode:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
future;python_version < '3'
flake8
configparser
python-language-server
python-lsp-server
mypy;python_version >= '3.2'
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[metadata]
name = pyls-mypy
author = Tom van Ommeren
description = Mypy linter for the Python Language Server
description = Mypy linter for the Python LSP Server
url = https://github.com/tomv564/pyls-mypy
long_description = file: README.rst

[options]
packages = find:
install_requires = python-language-server; mypy
install_requires = python-lsp-server; mypy


[options.entry_points]
pyls = pyls_mypy = pyls_mypy.plugin
pylsp = pyls_mypy = pyls_mypy.plugin

[options.extras_require]
test =
Expand Down
3 changes: 2 additions & 1 deletion test/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

from pyls.workspace import Document
from pylsp.workspace import Document

from pyls_mypy import plugin

DOC_URI = __file__
Expand Down