summaryrefslogtreecommitdiff
path: root/dev-python/python-lsp-server
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-10-26 00:10:07 +0100
committerV3n3RiX <venerix@koprulu.sector>2021-10-26 00:10:07 +0100
commit95461df035e3867364495f065e5e805bf629b2d7 (patch)
tree867dce371a84a696e91be255d89f282975aa0480 /dev-python/python-lsp-server
parent46eedbedafdb0040c37884982d4c775ce277fb7b (diff)
gentoo resync : 25.10.2021
Diffstat (limited to 'dev-python/python-lsp-server')
-rw-r--r--dev-python/python-lsp-server/Manifest3
-rw-r--r--dev-python/python-lsp-server/files/python-lsp-server-1.2.4-unpin-pylint.patch254
-rw-r--r--dev-python/python-lsp-server/python-lsp-server-1.2.4.ebuild86
3 files changed, 343 insertions, 0 deletions
diff --git a/dev-python/python-lsp-server/Manifest b/dev-python/python-lsp-server/Manifest
index efc3127a3709..e56e1ee1ac45 100644
--- a/dev-python/python-lsp-server/Manifest
+++ b/dev-python/python-lsp-server/Manifest
@@ -1,5 +1,8 @@
+AUX python-lsp-server-1.2.4-unpin-pylint.patch 9732 BLAKE2B 059b449e70def94d333e1c5f967187ebd2896a296b93412b62476a233ccb55607c49181d81749f78e51f822e4e34d89274b28b82fdb418ed26462ff44690936b SHA512 05d7d29beb835ecb00f89266288539289bbeac07d51d1a4bdca9d336588e0087eec48d50dfb3660e7f814a1ca5c988334e378acde641d85a3d6b6ca9dac20f8a
DIST python-lsp-server-1.2.2.tar.gz 61742 BLAKE2B d0886549d9ebf79bf97be30abb361be1fdee243abf9ed4707e27857122e9721dcc59f968c4ad7d2904ba11f06e6e6dc34593e5255ce0c9c528defdab7b6e3b7e SHA512 afeb0798fef151ab7cb79b3a0b294a30111d4bb409a4a8ad5148f9cb3dfb9a56e0033541b44a2b683bf043fcb31a8d83a788b0c9c22587b6ae532abb288542a6
DIST python-lsp-server-1.2.3.tar.gz 62072 BLAKE2B 3d84e2d1eb77a706eee2da0e02bfab5e075faec9a0279070e2e43bd9dbfb973c6e343c5c2e3826fd64b55987603f7b1b27762d598bd1b5689f2013e3f5d06e90 SHA512 48b9441962d9d00010cee9b482f141259ff4944f737626630ef5051cac82578c9a37f62eea238c6e9df1b90dae739db335195a9eff4f50d0120721763791dad1
+DIST python-lsp-server-1.2.4.tar.gz 62073 BLAKE2B b1426d71a4da5ac29fa6b3e956010625d594eee7924a51eb5074933866254189a9738895bc5dd4aae8acc1733b9f162b73646d9a3eee3ac17a587456f2da00e4 SHA512 862d59426c6e7c19f9d3d2766ec5f9ec818d29988ee72cde9553e4b1725fbbe4230ed2f6d7e8d08983c9ef1ced8d5afe42d6751ea529d3d8799c8930b1e10a26
EBUILD python-lsp-server-1.2.2.ebuild 2922 BLAKE2B 1f8b84df7f3fc22b86d60917f214b343d1fb6f2d95d56c60bb561c17c119e26ee93fd39f5dbbb74a39c00889fe662a4ff3f07225f9db1eddc3f398bb03e00148 SHA512 718abf67cfcfd700306c60e6e54a7b87738ba7b144015d7ff2501394ba37cfdd878897636e79286e40213757858d47265eebe2767cd6f03d81e0cd77b0bb27cc
EBUILD python-lsp-server-1.2.3.ebuild 2924 BLAKE2B b5615b6116040f99318f6f689e177baf18dac40080e0457739e3c84c72d06dda1c93ae022380157a7c7d4221ad2d12b6244b50544efb0cb59d5731177822bdf0 SHA512 954a1648c3ccb3e7db3490e0f40c4ab51b3aa5ca5f9a5d48fdb91d2ea4a7c4ac2b1662d5e1dfcb5f82c20f62962315487f9ce4079e33f554ab8ce41f2e6028e2
+EBUILD python-lsp-server-1.2.4.ebuild 2867 BLAKE2B 51a5db5df015ee6ebadd19d63064cd080adc5eabe02a6802715b253e27bb6bed5d25fba0021bed319d1942350aba5c87b667d4075f27bbf9db89181cefed7a0f SHA512 a88ac6233891fd91af16390084a9ef8a444632c0531369feb7d7eb2388133d4989435bc268b6078173578e88ad18144acf3eb07f33d2eae538d3398c371d7280
MISC metadata.xml 542 BLAKE2B ca71a08385d37c7f5cc562986630ae482970842054ffa944151d2e4a5d8449329b71c16c61e2a81f3d3d93f02a61ce637fe0bd0961ba3f86b7182b9728b62d5c SHA512 2d5103643838ba8aec53e7d3e924517cc3d735c724b6dfea249bcce3716aebb9f54e3264cb2cccc15dfe7d0ad4b7d052388122144fe6248d4faeef3482d197e7
diff --git a/dev-python/python-lsp-server/files/python-lsp-server-1.2.4-unpin-pylint.patch b/dev-python/python-lsp-server/files/python-lsp-server-1.2.4-unpin-pylint.patch
new file mode 100644
index 000000000000..8c849720447e
--- /dev/null
+++ b/dev-python/python-lsp-server/files/python-lsp-server-1.2.4-unpin-pylint.patch
@@ -0,0 +1,254 @@
+diff --git a/.pylintrc b/.pylintrc
+index 4249ac5..326751f 100644
+--- a/.pylintrc
++++ b/.pylintrc
+@@ -16,7 +16,8 @@ disable =
+ too-few-public-methods,
+ too-many-arguments,
+ too-many-instance-attributes,
+- import-error
++ import-error,
++ consider-using-f-string,
+
+ [REPORTS]
+
+diff --git a/pylsp/__main__.py b/pylsp/__main__.py
+index a480823..4698d5c 100644
+--- a/pylsp/__main__.py
++++ b/pylsp/__main__.py
+@@ -92,7 +92,7 @@ def _configure_logger(verbose=0, log_config=None, log_file=None):
+ root_logger = logging.root
+
+ if log_config:
+- with open(log_config, 'r') as f:
++ with open(log_config, 'r', encoding='utf-8') as f:
+ logging.config.dictConfig(json.load(f))
+ else:
+ formatter = logging.Formatter(LOG_FORMAT)
+diff --git a/pylsp/_utils.py b/pylsp/_utils.py
+index 92376f6..9ac30cf 100644
+--- a/pylsp/_utils.py
++++ b/pylsp/_utils.py
+@@ -144,8 +144,8 @@ def format_docstring(contents):
+ Until we can find a fast enough way of discovering and parsing each format,
+ we can do a little better by at least preserving indentation.
+ """
+- contents = contents.replace('\t', u'\u00A0' * 4)
+- contents = contents.replace(' ', u'\u00A0' * 2)
++ contents = contents.replace('\t', '\u00A0' * 4)
++ contents = contents.replace(' ', '\u00A0' * 2)
+ return contents
+
+
+diff --git a/pylsp/plugins/flake8_lint.py b/pylsp/plugins/flake8_lint.py
+index 7ac8c62..aefd09e 100644
+--- a/pylsp/plugins/flake8_lint.py
++++ b/pylsp/plugins/flake8_lint.py
+@@ -79,7 +79,7 @@ def run_flake8(flake8_executable, args, document):
+ try:
+ cmd = [flake8_executable]
+ cmd.extend(args)
+- p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with
++ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ except IOError:
+ log.debug("Can't execute %s. Trying with 'python -m flake8'", flake8_executable)
+ cmd = ['python', '-m', 'flake8']
+diff --git a/pylsp/plugins/pylint_lint.py b/pylsp/plugins/pylint_lint.py
+index bdb65fe..69bad1c 100644
+--- a/pylsp/plugins/pylint_lint.py
++++ b/pylsp/plugins/pylint_lint.py
+@@ -236,7 +236,7 @@ def _run_pylint_stdio(pylint_executable, document, flags):
+ cmd = [pylint_executable]
+ cmd.extend(flags)
+ cmd.extend(['--from-stdin', document.path])
+- p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with
++ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ except IOError:
+ log.debug("Can't execute %s. Trying with 'python -m pylint'", pylint_executable)
+ cmd = ['python', '-m', 'pylint']
+diff --git a/pylsp/workspace.py b/pylsp/workspace.py
+index ec031b6..bf312f6 100644
+--- a/pylsp/workspace.py
++++ b/pylsp/workspace.py
+@@ -76,7 +76,7 @@ def root_uri(self):
+ return self._root_uri
+
+ def is_local(self):
+- return (self._root_uri_scheme == '' or self._root_uri_scheme == 'file') and os.path.exists(self._root_path)
++ return (self._root_uri_scheme in ['', 'file']) and os.path.exists(self._root_path)
+
+ def get_document(self, doc_uri):
+ """Return a managed document if-present, else create one pointing at disk.
+diff --git a/setup.py b/setup.py
+index 3f79774..14ade20 100755
+--- a/setup.py
++++ b/setup.py
+@@ -52,7 +52,7 @@ def get_version(module='pylsp'):
+ 'pycodestyle>=2.7.0',
+ 'pydocstyle>=2.0.0',
+ 'pyflakes>=2.3.0,<2.4.0',
+- 'pylint>=2.5.0,<2.10.0',
++ 'pylint>=2.5.0',
+ 'rope>=0.10.5',
+ 'yapf',
+ ],
+@@ -62,10 +62,10 @@ def get_version(module='pylsp'):
+ 'pycodestyle': ['pycodestyle>=2.7.0'],
+ 'pydocstyle': ['pydocstyle>=2.0.0'],
+ 'pyflakes': ['pyflakes>=2.3.0,<2.4.0'],
+- 'pylint': ['pylint>=2.5.0,<2.10.0'],
++ 'pylint': ['pylint>=2.5.0'],
+ 'rope': ['rope>0.10.5'],
+ 'yapf': ['yapf'],
+- 'test': ['pylint>=2.5.0,<2.10.0', 'pytest', 'pytest-cov', 'coverage',
++ 'test': ['pylint>=2.5.0', 'pytest', 'pytest-cov', 'coverage',
+ 'numpy', 'pandas', 'matplotlib', 'pyqt5', 'flaky'],
+ },
+ entry_points={
+diff --git a/test/fixtures.py b/test/fixtures.py
+index 3ced0d5..e57bda6 100644
+--- a/test/fixtures.py
++++ b/test/fixtures.py
+@@ -101,7 +101,7 @@ def temp_workspace_factory(workspace): # pylint: disable=redefined-outer-name
+ def fn(files):
+ def create_file(name, content):
+ fn = os.path.join(workspace.root_path, name)
+- with open(fn, 'w') as f:
++ with open(fn, 'w', encoding='utf-8') as f:
+ f.write(content)
+ workspace.put_document(uris.from_fs_path(fn), content)
+
+diff --git a/test/plugins/test_flake8_lint.py b/test/plugins/test_flake8_lint.py
+index 046127c..e82a226 100644
+--- a/test/plugins/test_flake8_lint.py
++++ b/test/plugins/test_flake8_lint.py
+@@ -93,7 +93,7 @@ def get_flake8_cfg_settings(workspace, config_str):
+ This function creates a ``setup.cfg``; you'll have to delete it yourself.
+ """
+
+- with open(os.path.join(workspace.root_path, "setup.cfg"), "w+") as f:
++ with open(os.path.join(workspace.root_path, "setup.cfg"), "w+", encoding='utf-8') as f:
+ f.write(config_str)
+
+ workspace.update_config({"pylsp": {"configurationSources": ["flake8"]}})
+diff --git a/test/plugins/test_pycodestyle_lint.py b/test/plugins/test_pycodestyle_lint.py
+index c0d1d7e..e238147 100644
+--- a/test/plugins/test_pycodestyle_lint.py
++++ b/test/plugins/test_pycodestyle_lint.py
+@@ -91,7 +91,7 @@ def test_pycodestyle_config(workspace):
+
+ for conf_file, (content, working) in list(content.items()):
+ # Now we'll add config file to ignore it
+- with open(os.path.join(workspace.root_path, conf_file), 'w+') as f:
++ with open(os.path.join(workspace.root_path, conf_file), 'w+', encoding='utf-8') as f:
+ f.write(content)
+ workspace._config.settings.cache_clear()
+
+diff --git a/test/plugins/test_pyflakes_lint.py b/test/plugins/test_pyflakes_lint.py
+index 494cb63..d52ac63 100644
+--- a/test/plugins/test_pyflakes_lint.py
++++ b/test/plugins/test_pyflakes_lint.py
+@@ -21,7 +21,7 @@ def hello():
+ DOC_UNDEFINED_NAME_ERR = "a = b"
+
+
+-DOC_ENCODING = u"""# encoding=utf-8
++DOC_ENCODING = """# encoding=utf-8
+ import sys
+ """
+
+diff --git a/test/plugins/test_pylint_lint.py b/test/plugins/test_pylint_lint.py
+index cf7a7e4..5b5b99c 100644
+--- a/test/plugins/test_pylint_lint.py
++++ b/test/plugins/test_pylint_lint.py
+@@ -37,7 +37,7 @@ def temp_document(doc_text, workspace):
+
+
+ def write_temp_doc(document, contents):
+- with open(document.path, 'w') as temp_file:
++ with open(document.path, 'w', encoding='utf-8') as temp_file:
+ temp_file.write(contents)
+
+
+diff --git a/test/test_document.py b/test/test_document.py
+index b543a40..3dcabb6 100644
+--- a/test/test_document.py
++++ b/test/test_document.py
+@@ -16,7 +16,7 @@ def test_document_lines(doc):
+
+
+ def test_document_source_unicode(workspace):
+- document_mem = Document(DOC_URI, workspace, u'my source')
++ document_mem = Document(DOC_URI, workspace, 'my source')
+ document_disk = Document(DOC_URI, workspace)
+ assert isinstance(document_mem.source, type(document_disk.source))
+
+@@ -44,27 +44,27 @@ def test_word_at_position(doc):
+
+
+ def test_document_empty_edit(workspace):
+- doc = Document('file:///uri', workspace, u'')
++ doc = Document('file:///uri', workspace, '')
+ doc.apply_change({
+ 'range': {
+ 'start': {'line': 0, 'character': 0},
+ 'end': {'line': 0, 'character': 0}
+ },
+- 'text': u'f'
++ 'text': 'f'
+ })
+- assert doc.source == u'f'
++ assert doc.source == 'f'
+
+
+ def test_document_line_edit(workspace):
+- doc = Document('file:///uri', workspace, u'itshelloworld')
++ doc = Document('file:///uri', workspace, 'itshelloworld')
+ doc.apply_change({
+- 'text': u'goodbye',
++ 'text': 'goodbye',
+ 'range': {
+ 'start': {'line': 0, 'character': 3},
+ 'end': {'line': 0, 'character': 8}
+ }
+ })
+- assert doc.source == u'itsgoodbyeworld'
++ assert doc.source == 'itsgoodbyeworld'
+
+
+ def test_document_multiline_edit(workspace):
+@@ -73,8 +73,8 @@ def test_document_multiline_edit(workspace):
+ " print a\n",
+ " print b\n"
+ ]
+- doc = Document('file:///uri', workspace, u''.join(old))
+- doc.apply_change({'text': u'print a, b', 'range': {
++ doc = Document('file:///uri', workspace, ''.join(old))
++ doc.apply_change({'text': 'print a, b', 'range': {
+ 'start': {'line': 1, 'character': 4},
+ 'end': {'line': 2, 'character': 11}
+ }})
+@@ -89,8 +89,8 @@ def test_document_end_of_file_edit(workspace):
+ "print 'a'\n",
+ "print 'b'\n"
+ ]
+- doc = Document('file:///uri', workspace, u''.join(old))
+- doc.apply_change({'text': u'o', 'range': {
++ doc = Document('file:///uri', workspace, ''.join(old))
++ doc.apply_change({'text': 'o', 'range': {
+ 'start': {'line': 2, 'character': 0},
+ 'end': {'line': 2, 'character': 0}
+ }})
+diff --git a/test/test_workspace.py b/test/test_workspace.py
+index a008e7e..44d754b 100644
+--- a/test/test_workspace.py
++++ b/test/test_workspace.py
+@@ -51,7 +51,7 @@ def test_non_root_project(pylsp, metafiles):
+ os.mkdir(project_root)
+
+ for metafile in metafiles:
+- with open(os.path.join(project_root, metafile), 'w+') as f:
++ with open(os.path.join(project_root, metafile), 'w+', encoding='utf-8') as f:
+ f.write('# ' + metafile)
+
+ test_uri = uris.from_fs_path(os.path.join(project_root, 'hello/test.py'))
diff --git a/dev-python/python-lsp-server/python-lsp-server-1.2.4.ebuild b/dev-python/python-lsp-server/python-lsp-server-1.2.4.ebuild
new file mode 100644
index 000000000000..b04edfbecc67
--- /dev/null
+++ b/dev-python/python-lsp-server/python-lsp-server-1.2.4.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..9} )
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit distutils-r1 optfeature
+
+DESCRIPTION="Python Language Server for the Language Server Protocol"
+HOMEPAGE="https://github.com/python-lsp/python-lsp-server"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+IUSE="all-plugins"
+
+BDEPEND="
+ test? (
+ dev-python/autopep8[${PYTHON_USEDEP}]
+ dev-python/flaky[${PYTHON_USEDEP}]
+ >=dev-python/flake8-3.8.0[${PYTHON_USEDEP}]
+ <dev-python/flake8-4.0.0[${PYTHON_USEDEP}]
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ >=dev-python/mccabe-0.6.0[${PYTHON_USEDEP}]
+ <dev-python/mccabe-0.7.0[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pandas[${PYTHON_USEDEP}]
+ >=dev-python/pycodestyle-2.7.0[${PYTHON_USEDEP}]
+ >=dev-python/pydocstyle-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pyflakes-2.3.0[${PYTHON_USEDEP}]
+ <dev-python/pyflakes-2.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pylint-2.5.0[${PYTHON_USEDEP}]
+ dev-python/QtPy[gui,testlib,${PYTHON_USEDEP}]
+ >=dev-python/rope-0.10.5[${PYTHON_USEDEP}]
+ dev-python/yapf[${PYTHON_USEDEP}]
+ )"
+
+RDEPEND="
+ >=dev-python/jedi-0.17.2[${PYTHON_USEDEP}]
+ <dev-python/jedi-0.19.0[${PYTHON_USEDEP}]
+ >=dev-python/python-lsp-jsonrpc-1.0.0[${PYTHON_USEDEP}]
+ dev-python/pluggy[${PYTHON_USEDEP}]
+ all-plugins? (
+ dev-python/autopep8[${PYTHON_USEDEP}]
+ >=dev-python/flake8-3.8.0[${PYTHON_USEDEP}]
+ <dev-python/flake8-4.0.0[${PYTHON_USEDEP}]
+ >=dev-python/mccabe-0.6.0[${PYTHON_USEDEP}]
+ <dev-python/mccabe-0.7.0[${PYTHON_USEDEP}]
+ >=dev-python/pycodestyle-2.7.0[${PYTHON_USEDEP}]
+ >=dev-python/pydocstyle-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/pyflakes-2.3.0[${PYTHON_USEDEP}]
+ <dev-python/pyflakes-2.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pylint-2.5.0[${PYTHON_USEDEP}]
+ >=dev-python/rope-0.10.5[${PYTHON_USEDEP}]
+ dev-python/yapf[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-unpin-pylint.patch"
+)
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ # remove pytest-cov dep
+ sed -i -e '0,/addopts/I!d' setup.cfg || die
+
+ distutils-r1_python_prepare_all
+}
+
+pkg_postinst() {
+ optfeature "Automatically formats Python code to conform to the PEP 8 style guide" dev-python/autopep8
+ optfeature "A wrapper around PyFlakes, pep8 & mccabe" dev-python/flake8
+ optfeature "flake8 plugin: McCabe complexity checker" dev-python/mccabe
+ optfeature "Python style guide checker (fka pep8)" dev-python/pycodestyle
+ optfeature "Python docstring style checker" dev-python/pydocstyle
+ optfeature "Passive checker for Python programs" dev-python/pyflakes
+ optfeature "Python code static checker" dev-python/pylint
+ optfeature "Python refactoring library" dev-python/rope
+ optfeature "A formatter for Python files" dev-python/yapf
+}