Accepting request 1033864 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 1.6.0 * Migrate to MarkupContent and convert docstrings to Markdown by default. * Add support for flake8 version 5. * Add function objects to Jedi completions. * Don't include class and functions objects by default in Jedi completions. - Drop patches * python-lsp-server-advanceflake8.patch * python-lsp-server-pylint-syntax-error.patch OBS-URL: https://build.opensuse.org/request/show/1033864 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-lsp-server?expand=0&rev=25
This commit is contained in:
parent
bb72266182
commit
3a227d8b3d
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:e5c094c19925022a27c4068f414b2bb653243f8fb0d768e39735289d7a89380d
|
|
||||||
size 82371
|
|
3
python-lsp-server-1.6.0.tar.gz
Normal file
3
python-lsp-server-1.6.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d75cdff9027c4212e5b9e861e9a0219219c8e2c69508d9f24949951dabd0dc1b
|
||||||
|
size 85242
|
@ -1,35 +0,0 @@
|
|||||||
Index: python-lsp-server-1.5.0/pyproject.toml
|
|
||||||
===================================================================
|
|
||||||
--- python-lsp-server-1.5.0.orig/pyproject.toml
|
|
||||||
+++ python-lsp-server-1.5.0/pyproject.toml
|
|
||||||
@@ -27,22 +27,22 @@ Homepage = "https://github.com/python-ls
|
|
||||||
[project.optional-dependencies]
|
|
||||||
all = [
|
|
||||||
"autopep8>=1.6.0,<1.7.0",
|
|
||||||
- "flake8>=4.0.0,<4.1.0",
|
|
||||||
- "mccabe>=0.6.0,<0.7.0",
|
|
||||||
- "pycodestyle>=2.8.0,<2.9.0",
|
|
||||||
+ "flake8>=5.0.0,<5.1.0",
|
|
||||||
+ "mccabe>=0.7.0,<0.8.0",
|
|
||||||
+ "pycodestyle>=2.9.0,<2.10.0",
|
|
||||||
"pydocstyle>=2.0.0",
|
|
||||||
- "pyflakes>=2.4.0,<2.5.0",
|
|
||||||
+ "pyflakes>=2.5.0,<2.6.0",
|
|
||||||
"pylint>=2.5.0",
|
|
||||||
"rope>=0.10.5",
|
|
||||||
"yapf",
|
|
||||||
"whatthepatch"
|
|
||||||
]
|
|
||||||
autopep8 = ["autopep8>=1.6.0,<1.7.0"]
|
|
||||||
-flake8 = ["flake8>=4.0.0,<4.1.0"]
|
|
||||||
-mccabe = ["mccabe>=0.6.0,<0.7.0"]
|
|
||||||
-pycodestyle = ["pycodestyle>=2.8.0,<2.9.0"]
|
|
||||||
+flake8 = ["flake8>=5.0.0,<5.1.0"]
|
|
||||||
+mccabe = ["mccabe>=0.7.0,<0.8.0"]
|
|
||||||
+pycodestyle = ["pycodestyle>=2.9.0,<2.10.0"]
|
|
||||||
pydocstyle = ["pydocstyle>=2.0.0"]
|
|
||||||
-pyflakes = ["pyflakes>=2.4.0,<2.5.0"]
|
|
||||||
+pyflakes = ["pyflakes>=2.5.0,<2.6.0"]
|
|
||||||
pylint = ["pylint>=2.5.0"]
|
|
||||||
rope = ["rope>0.10.5"]
|
|
||||||
yapf = ["yapf", "whatthepatch>=1.0.2,<2.0.0"]
|
|
@ -1,102 +0,0 @@
|
|||||||
diff --git a/test/__init__.py b/test/__init__.py
|
|
||||||
index ab920d2..bb21669 100644
|
|
||||||
--- a/test/__init__.py
|
|
||||||
+++ b/test/__init__.py
|
|
||||||
@@ -1,13 +1,9 @@
|
|
||||||
# Copyright 2017-2020 Palantir Technologies, Inc.
|
|
||||||
# Copyright 2021- Python Language Server Contributors.
|
|
||||||
|
|
||||||
-import sys
|
|
||||||
import pytest
|
|
||||||
from pylsp import IS_WIN
|
|
||||||
|
|
||||||
-IS_PY3 = sys.version_info.major == 3
|
|
||||||
|
|
||||||
unix_only = pytest.mark.skipif(IS_WIN, reason="Unix only")
|
|
||||||
windows_only = pytest.mark.skipif(not IS_WIN, reason="Windows only")
|
|
||||||
-py3_only = pytest.mark.skipif(not IS_PY3, reason="Python3 only")
|
|
||||||
-py2_only = pytest.mark.skipif(IS_PY3, reason="Python2 only")
|
|
||||||
diff --git a/test/plugins/test_pylint_lint.py b/test/plugins/test_pylint_lint.py
|
|
||||||
index afd5c30..b6c0329 100644
|
|
||||||
--- a/test/plugins/test_pylint_lint.py
|
|
||||||
+++ b/test/plugins/test_pylint_lint.py
|
|
||||||
@@ -4,10 +4,8 @@
|
|
||||||
|
|
||||||
import contextlib
|
|
||||||
import os
|
|
||||||
-import sys
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
-from test import py2_only, py3_only, IS_PY3
|
|
||||||
from pylsp import lsp, uris
|
|
||||||
from pylsp.workspace import Document
|
|
||||||
from pylsp.plugins import pylint_lint
|
|
||||||
@@ -53,30 +51,26 @@ def test_pylint(config, workspace):
|
|
||||||
assert unused_import['severity'] == lsp.DiagnosticSeverity.Warning
|
|
||||||
assert unused_import['tags'] == [lsp.DiagnosticTag.Unnecessary]
|
|
||||||
|
|
||||||
- if IS_PY3:
|
|
||||||
- # test running pylint in stdin
|
|
||||||
- config.plugin_settings('pylint')['executable'] = 'pylint'
|
|
||||||
- diags = pylint_lint.pylsp_lint(config, doc, True)
|
|
||||||
+ # test running pylint in stdin
|
|
||||||
+ config.plugin_settings('pylint')['executable'] = 'pylint'
|
|
||||||
+ diags = pylint_lint.pylsp_lint(config, doc, True)
|
|
||||||
|
|
||||||
- msg = 'Unused import sys (unused-import)'
|
|
||||||
- unused_import = [d for d in diags if d['message'] == msg][0]
|
|
||||||
+ msg = 'Unused import sys (unused-import)'
|
|
||||||
+ unused_import = [d for d in diags if d['message'] == msg][0]
|
|
||||||
|
|
||||||
- assert unused_import['range']['start'] == {
|
|
||||||
- 'line': 0,
|
|
||||||
- 'character': 0,
|
|
||||||
- }
|
|
||||||
- assert unused_import['severity'] == lsp.DiagnosticSeverity.Warning
|
|
||||||
+ assert unused_import['range']['start'] == {
|
|
||||||
+ 'line': 0,
|
|
||||||
+ 'character': 0,
|
|
||||||
+ }
|
|
||||||
+ assert unused_import['severity'] == lsp.DiagnosticSeverity.Warning
|
|
||||||
|
|
||||||
|
|
||||||
-@py3_only
|
|
||||||
-def test_syntax_error_pylint_py3(config, workspace):
|
|
||||||
+def test_syntax_error_pylint(config, workspace):
|
|
||||||
with temp_document(DOC_SYNTAX_ERR, workspace) as doc:
|
|
||||||
diag = pylint_lint.pylsp_lint(config, doc, True)[0]
|
|
||||||
|
|
||||||
- if sys.version_info[:2] >= (3, 10):
|
|
||||||
- assert diag['message'].count("[syntax-error] expected ':'")
|
|
||||||
- else:
|
|
||||||
- assert diag['message'].startswith('[syntax-error] invalid syntax')
|
|
||||||
+ assert diag['message'].startswith("[syntax-error]")
|
|
||||||
+ assert diag['message'].count("expected ':'") or diag['message'].count('invalid syntax')
|
|
||||||
# Pylint doesn't give column numbers for invalid syntax.
|
|
||||||
assert diag['range']['start'] == {'line': 0, 'character': 12}
|
|
||||||
assert diag['severity'] == lsp.DiagnosticSeverity.Error
|
|
||||||
@@ -86,23 +80,12 @@ def test_syntax_error_pylint_py3(config, workspace):
|
|
||||||
config.plugin_settings('pylint')['executable'] = 'pylint'
|
|
||||||
diag = pylint_lint.pylsp_lint(config, doc, True)[0]
|
|
||||||
|
|
||||||
- assert diag['message'].count("expected ':'") or diag['message'].startswith('invalid syntax')
|
|
||||||
+ assert diag['message'].count("expected ':'") or diag['message'].count('invalid syntax')
|
|
||||||
# Pylint doesn't give column numbers for invalid syntax.
|
|
||||||
assert diag['range']['start'] == {'line': 0, 'character': 12}
|
|
||||||
assert diag['severity'] == lsp.DiagnosticSeverity.Error
|
|
||||||
|
|
||||||
|
|
||||||
-@py2_only
|
|
||||||
-def test_syntax_error_pylint_py2(config, workspace):
|
|
||||||
- with temp_document(DOC_SYNTAX_ERR, workspace) as doc:
|
|
||||||
- diag = pylint_lint.pylsp_lint(config, doc, True)[0]
|
|
||||||
-
|
|
||||||
- assert diag['message'].startswith('[syntax-error] invalid syntax')
|
|
||||||
- # Pylint doesn't give column numbers for invalid syntax.
|
|
||||||
- assert diag['range']['start'] == {'line': 0, 'character': 0}
|
|
||||||
- assert diag['severity'] == lsp.DiagnosticSeverity.Error
|
|
||||||
-
|
|
||||||
-
|
|
||||||
def test_lint_free_pylint(config, workspace):
|
|
||||||
# Can't use temp_document because it might give us a file that doesn't
|
|
||||||
# match pylint's naming requirements. We should be keeping this file clean
|
|
@ -1,3 +1,17 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Nov 6 15:10:39 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Update to 1.6.0
|
||||||
|
* Migrate to MarkupContent and convert docstrings to Markdown by
|
||||||
|
default.
|
||||||
|
* Add support for flake8 version 5.
|
||||||
|
* Add function objects to Jedi completions.
|
||||||
|
* Don't include class and functions objects by default in Jedi
|
||||||
|
completions.
|
||||||
|
- Drop patches
|
||||||
|
* python-lsp-server-advanceflake8.patch
|
||||||
|
* python-lsp-server-pylint-syntax-error.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Aug 27 09:41:07 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
Sat Aug 27 09:41:07 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
@ -17,16 +17,12 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: python-python-lsp-server
|
Name: python-python-lsp-server
|
||||||
Version: 1.5.0
|
Version: 1.6.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Python Language Server for the Language Server Protocol
|
Summary: Python Language Server for the Language Server Protocol
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/python-lsp/python-lsp-server
|
URL: https://github.com/python-lsp/python-lsp-server
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/python-lsp-server/python-lsp-server-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/python-lsp-server/python-lsp-server-%{version}.tar.gz
|
||||||
# PATCH-FEATURE-UPSTREAM python-lsp-server-advanceflake8.patch gh#python-lsp/python-lsp-server#257
|
|
||||||
Patch0: python-lsp-server-advanceflake8.patch
|
|
||||||
# PATCH-FEATURE-UPSTREAM python-lsp-server-pylint-syntax-error.patch gh#python-lsp/python-lsp-server#258
|
|
||||||
Patch1: python-lsp-server-pylint-syntax-error.patch
|
|
||||||
BuildRequires: %{python_module base >= 3.7}
|
BuildRequires: %{python_module base >= 3.7}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools >= 61.2}
|
BuildRequires: %{python_module setuptools >= 61.2}
|
||||||
@ -35,9 +31,9 @@ BuildRequires: %{python_module tomli}
|
|||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: python-rpm-macros >= 20210628
|
BuildRequires: python-rpm-macros >= 20210628
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
|
BuildRequires: %{python_module docstring-to-markdown}
|
||||||
BuildRequires: %{python_module PyQt5}
|
BuildRequires: %{python_module PyQt5}
|
||||||
BuildRequires: %{python_module autopep8 >= 1.6.0 with %python-autopep8 < 1.7.0}
|
BuildRequires: %{python_module autopep8 >= 1.6.0 with %python-autopep8 < 1.7.0}
|
||||||
# flake8 and its dependencies in a particular range, see Patch0
|
|
||||||
BuildRequires: %{python_module flake8 >= 5.0.0 with %python-flake8 < 5.1.0}
|
BuildRequires: %{python_module flake8 >= 5.0.0 with %python-flake8 < 5.1.0}
|
||||||
BuildRequires: %{python_module flaky}
|
BuildRequires: %{python_module flaky}
|
||||||
BuildRequires: %{python_module jedi >= 0.17.2 with %python-jedi < 0.19.0}
|
BuildRequires: %{python_module jedi >= 0.17.2 with %python-jedi < 0.19.0}
|
||||||
@ -55,6 +51,7 @@ BuildRequires: %{python_module whatthepatch}
|
|||||||
BuildRequires: %{python_module yapf}
|
BuildRequires: %{python_module yapf}
|
||||||
# /SECTION
|
# /SECTION
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
|
Requires: python-docstring-to-markdown
|
||||||
Requires: python-pluggy >= 1.0.0
|
Requires: python-pluggy >= 1.0.0
|
||||||
Requires: python-python-lsp-jsonrpc >= 1.0.0
|
Requires: python-python-lsp-jsonrpc >= 1.0.0
|
||||||
Requires: python-setuptools >= 39.0.0
|
Requires: python-setuptools >= 39.0.0
|
||||||
@ -67,7 +64,7 @@ Suggests: python-pylint >= 2.5.0
|
|||||||
Suggests: python-rope >= 0.10.5
|
Suggests: python-rope >= 0.10.5
|
||||||
Suggests: python-yapf
|
Suggests: python-yapf
|
||||||
Suggests: python-whatthepatch
|
Suggests: python-whatthepatch
|
||||||
# SECTION flake8 pins -- see Patch0
|
# SECTION flake8 pins
|
||||||
Suggests: python-flake8 >= 5.0.0
|
Suggests: python-flake8 >= 5.0.0
|
||||||
Conflicts: python-flake8 >= 5.1.0
|
Conflicts: python-flake8 >= 5.1.0
|
||||||
Suggests: python-mccabe >= 0.7.0
|
Suggests: python-mccabe >= 0.7.0
|
||||||
|
Loading…
Reference in New Issue
Block a user