diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-04-28 20:21:43 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-04-28 20:21:43 +0100 |
commit | 40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (patch) | |
tree | 758c221bad35c9288d0bd6df9c7dfc226728e52c /dev-python/python-language-server | |
parent | 8d5dbd847cbc704a6a06405856e94b461011afe3 (diff) |
gentoo resync : 28.04.2021
Diffstat (limited to 'dev-python/python-language-server')
6 files changed, 251 insertions, 2 deletions
diff --git a/dev-python/python-language-server/Manifest b/dev-python/python-language-server/Manifest index 1236fde211d6..4ff253d44828 100644 --- a/dev-python/python-language-server/Manifest +++ b/dev-python/python-language-server/Manifest @@ -1,3 +1,7 @@ +AUX pyls-fix-test_folding.patch 1238 BLAKE2B 1942a7d0b21a25310c2fe361e7a91cd122b5131e75fe2a73e2251a8af7d83678dcfb04e2332d3f7d1bfe9c82cb2d14afff59e354b116169eb5323a245ec5b0a8 SHA512 688036513cacc382159cc8872d55664081020b29e530a4695863dec9bbdca7f728398a55e4b8f1359b0226cbc09d4bb791fda9294ae3141ab1b2797493f2fc32 +AUX pyls-jedi-18.patch 2620 BLAKE2B acd80d45c93096f8809f901381e04ac88a869c8198ddc30991ecde98690567df0740334c07d870b8bc9ccf149fb0534f2f4d03007493189c1a6e853e5833ac96 SHA512 804308c6ce4d6189bf65f33397550d10b848e109a7f547f4bda80e9a78b68921225369667d9c72c3dbb954bda8a35af038596fac3b4ae026f952776f9bbb2c16 +AUX pyls-numpy-1.20.patch 2387 BLAKE2B 98178536140797b12e0725d407ed65df772560eed8cade7d00a8f0c7ef691e8a6cc3141babbd337da6482e959b32c7666eef6ce35de41ec1a52328aee5b8c7ae SHA512 c5708708da39ca18162a567f8006a59b5255e3a46c209b1ed7a0e309280cc5fc606c39dbbd259f7103854ccca9123fb478ebbd95bc0ca420343672b453ae7bd3 DIST python-language-server-0.36.2.tar.gz 74499 BLAKE2B 0bf950e236f8f898c3158afc2b3355948340639b607f474654b0334d484170a210b6e81c7508f12368223ae9915ccf19f76a1bcde41503230d8c008ba0818b47 SHA512 ee909d9332ef76c616d727ebfa36e80fd03ab57df8fc57265de21f0105cc0b64a518b2a8a582f88364d03a7d2a66e1030bcf5b3452ad3a891a3141da9b338373 -EBUILD python-language-server-0.36.2.ebuild 2442 BLAKE2B d61537a5a1132ea6ff586fcb534f770776a6f6872a711fa743745ab703bfe08b5569b8dac52c0fbf9dff86a2f11a241c10ba57eb8829aed7ca3ec89343a6639c SHA512 9a50540cc100d5ddd97e59c5dc677227fc8252247785e703fd3f530b195554fa9ebff32f2f7af7c6174dc7d00646561c262631e9b519d42dbf1a417618f13c6e +EBUILD python-language-server-0.36.2-r1.ebuild 2611 BLAKE2B 6a4c314f971cb6c06a133c52a6ec6ea6eb59f1c637c0495caa58fef55e946b7ae1be6ee730cb6b1c52566ed2b8a29cc8f728443314032cbf483b0f37d7e31bde SHA512 dc21073457cca6d11a9bd64ef804cc723fd3120d30190962a2ece9bd7d9ec0e74315cb0af774401460b8ca6a0bbdd23dd94e7f5f6a32e7ef2c3fa7f1469f4319 +EBUILD python-language-server-0.36.2.ebuild 2358 BLAKE2B 5aa1d66cd29540f597c9da2f69481b3a67fa5723fbde96fe90e5e982dc3bc5e2e44469996c6849d83527453b4c4bbe382e072531bdf77bef5b99226889d40bd4 SHA512 960f91b9dba494d50551fb4849ece1d0cd331422cf082c33cc05504394a38678e820650dddb78aacdae05108a06e04df14a0d200ccdc44c40cde9b98dfaccccf MISC metadata.xml 514 BLAKE2B a5982be16511774dbf4bc63e33eb4370194920873e43dcda1f9914275c17bc6c4ca16acd3289cf69277091b967d0d96dbd0dfd973dc2ae14e825328d449d2173 SHA512 a9b6d7621c33dd0138890e9d8550efed80d19db3b549c677a28025c327f2c5119168aeb05eac4d1cc5098741a904a25cbda1818527f081d4bd9f44d56e561e44 diff --git a/dev-python/python-language-server/files/pyls-fix-test_folding.patch b/dev-python/python-language-server/files/pyls-fix-test_folding.patch new file mode 100644 index 000000000000..6980053bf48a --- /dev/null +++ b/dev-python/python-language-server/files/pyls-fix-test_folding.patch @@ -0,0 +1,38 @@ +From 2d3c52c7b9debd73073650d22a3aa6e86d5491aa Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Thu, 1 Apr 2021 21:33:38 +0200 +Subject: [PATCH 2/2] TST: accept folding of decorator parameters in Python 3.9 + +--- + test/plugins/test_folding.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/test/plugins/test_folding.py b/test/plugins/test_folding.py +index 05f0cdd8..91ac0f3b 100644 +--- a/test/plugins/test_folding.py ++++ b/test/plugins/test_folding.py +@@ -1,11 +1,11 @@ + # Copyright 2019 Palantir Technologies, Inc. + ++import sys + from textwrap import dedent + + from pyls import uris +-from pyls.workspace import Document + from pyls.plugins.folding import pyls_folding_range +- ++from pyls.workspace import Document + + DOC_URI = uris.from_fs_path(__file__) + DOC = dedent(""" +@@ -146,6 +146,10 @@ def test_folding(workspace): + {'startLine': 62, 'endLine': 63}, + {'startLine': 64, 'endLine': 65}, + {'startLine': 67, 'endLine': 68}] ++ if sys.version_info[:2] >= (3, 9): ++ # the argument list of the decorator is also folded in Python >= 3.9 ++ expected.insert(4, {'startLine': 9, 'endLine': 10}) ++ + assert ranges == expected + + diff --git a/dev-python/python-language-server/files/pyls-jedi-18.patch b/dev-python/python-language-server/files/pyls-jedi-18.patch new file mode 100644 index 000000000000..1410f3a81dd7 --- /dev/null +++ b/dev-python/python-language-server/files/pyls-jedi-18.patch @@ -0,0 +1,68 @@ +From 40afab312a6bf0dcd620c82e59555ea2967aacdf Mon Sep 17 00:00:00 2001 +From: bnavigator <code@bnavigator.de> +Date: Tue, 5 Jan 2021 01:17:33 +0100 +Subject: [PATCH 1/2] bump jedi compatibility: compare to Path-like object + +--- + pyls/plugins/symbols.py | 2 +- + setup.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pyls/plugins/symbols.py b/pyls/plugins/symbols.py +index 6468dd83..69a09fe9 100644 +--- a/pyls/plugins/symbols.py ++++ b/pyls/plugins/symbols.py +@@ -37,7 +37,7 @@ def pyls_document_symbols(config, document): + not sym_full_name.startswith('__main__')): + continue + +- if _include_def(d) and document.path == d.module_path: ++ if _include_def(d) and os.path.samefile(document.path, d.module_path): + tuple_range = _tuple_range(d) + if tuple_range in exclude: + continue +diff --git a/setup.py b/setup.py +index 12782990..99d2b312 100755 +--- a/setup.py ++++ b/setup.py +@@ -10,7 +10,7 @@ + 'configparser; python_version<"3.0"', + 'future>=0.14.0; python_version<"3"', + 'backports.functools_lru_cache; python_version<"3.2"', +- 'jedi>=0.17.2,<0.18.0', ++ 'jedi>=0.17.2,<0.19.0', + 'python-jsonrpc-server>=0.4.0', + 'pluggy', + 'ujson<=2.0.3 ; platform_system!="Windows" and python_version<"3.0"', + +From e442467312fe967bff5f893b7e3f92da133182c8 Mon Sep 17 00:00:00 2001 +From: bnavigator <code@bnavigator.de> +Date: Tue, 5 Jan 2021 01:37:25 +0100 +Subject: [PATCH 2/2] Curse you Python 2 on Windows: os.path.samefile not + implemented + +--- + pyls/plugins/symbols.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/pyls/plugins/symbols.py b/pyls/plugins/symbols.py +index 69a09fe9..ef8e7fb8 100644 +--- a/pyls/plugins/symbols.py ++++ b/pyls/plugins/symbols.py +@@ -36,8 +36,14 @@ def pyls_document_symbols(config, document): + if (not sym_full_name.startswith(module_name) and + not sym_full_name.startswith('__main__')): + continue +- +- if _include_def(d) and os.path.samefile(document.path, d.module_path): ++ try: ++ docismodule = os.path.samefile(document.path, d.module_path) ++ except AttributeError: ++ # Python 2 on Windows has no .samefile, but then these are ++ # strings for sure ++ docismodule = document.path == d.module_path ++ ++ if _include_def(d) and docismodule: + tuple_range = _tuple_range(d) + if tuple_range in exclude: + continue diff --git a/dev-python/python-language-server/files/pyls-numpy-1.20.patch b/dev-python/python-language-server/files/pyls-numpy-1.20.patch new file mode 100644 index 000000000000..ab1c5032ff46 --- /dev/null +++ b/dev-python/python-language-server/files/pyls-numpy-1.20.patch @@ -0,0 +1,63 @@ +From 48f5eca25c2da064bcc9aa0fefb5de525bec618f Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Tue, 30 Mar 2021 20:20:08 +0200 +Subject: [PATCH 1/3] don't test np.sin hover for numpy 1.20 + +--- + test/plugins/test_hover.py | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/test/plugins/test_hover.py b/test/plugins/test_hover.py +index 2302b865..f36bcb29 100644 +--- a/test/plugins/test_hover.py ++++ b/test/plugins/test_hover.py +@@ -46,9 +46,13 @@ def test_numpy_hover(workspace): + contents = 'NumPy\n=====\n\nProvides\n' + assert contents in pyls_hover(doc, numpy_hov_position_3)['contents'][0] + +- contents = 'Trigonometric sine, element-wise.\n\n' +- assert contents in pyls_hover( +- doc, numpy_sin_hov_position)['contents'][0] ++ # https://github.com/davidhalter/jedi/issues/1746 ++ import numpy as np ++ ++ if np.lib.NumpyVersion(np.__version__) < '1.20.0': ++ contents = 'Trigonometric sine, element-wise.\n\n' ++ assert contents in pyls_hover( ++ doc, numpy_sin_hov_position)['contents'][0] + + + def test_hover(workspace): + +From 3ee06dac069e27edf6231651ae27bff78ae8aaff Mon Sep 17 00:00:00 2001 +From: Ben Greiner <code@bnavigator.de> +Date: Tue, 30 Mar 2021 20:21:20 +0200 +Subject: [PATCH 2/3] test snippet support with builtin instead of numpy + +--- + test/plugins/test_completion.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/plugins/test_completion.py b/test/plugins/test_completion.py +index 247c2c23..91df89cb 100644 +--- a/test/plugins/test_completion.py ++++ b/test/plugins/test_completion.py +@@ -216,14 +216,14 @@ def test_completion_with_class_objects(config, workspace): + + + def test_snippet_parsing(config, workspace): +- doc = 'import numpy as np\nnp.logical_and' +- completion_position = {'line': 1, 'character': 14} ++ doc = 'divmod' ++ completion_position = {'line': 0, 'character': 6} + doc = Document(DOC_URI, workspace, doc) + config.capabilities['textDocument'] = { + 'completion': {'completionItem': {'snippetSupport': True}}} + config.update({'plugins': {'jedi_completion': {'include_params': True}}}) + completions = pyls_jedi_completions(config, doc, completion_position) +- out = 'logical_and(${1:x1}, ${2:x2})$0' ++ out = 'divmod(${1:a}, ${2:b})$0' + assert completions[0]['insertText'] == out + + + diff --git a/dev-python/python-language-server/python-language-server-0.36.2-r1.ebuild b/dev-python/python-language-server/python-language-server-0.36.2-r1.ebuild new file mode 100644 index 000000000000..0b121d596271 --- /dev/null +++ b/dev-python/python-language-server/python-language-server-0.36.2-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9} ) + +DISTUTILS_USE_SETUPTOOLS=rdepend +inherit distutils-r1 optfeature + +DESCRIPTION="An implementation of the Language Server Protocol for Python" +HOMEPAGE="https://github.com/palantir/python-language-server" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" + +BDEPEND="dev-python/versioneer[${PYTHON_USEDEP}] + test? ( + dev-python/autopep8[${PYTHON_USEDEP}] + dev-python/flaky[${PYTHON_USEDEP}] + >=dev-python/flake8-3.8.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/mock[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + >=dev-python/pycodestyle-2.6.0[${PYTHON_USEDEP}] + <dev-python/pycodestyle-2.7.0[${PYTHON_USEDEP}] + >=dev-python/pydocstyle-2.0.0[${PYTHON_USEDEP}] + >=dev-python/pyflakes-2.2.0[${PYTHON_USEDEP}] + <dev-python/pyflakes-2.3.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/pluggy[${PYTHON_USEDEP}] + >=dev-python/python-jsonrpc-server-0.4.0[${PYTHON_USEDEP}] + >=dev-python/ujson-3[${PYTHON_USEDEP}] +" + +PATCHES=( + "${FILESDIR}/pyls-fix-test_folding.patch" + "${FILESDIR}/pyls-numpy-1.20.patch" + "${FILESDIR}/pyls-jedi-18.patch" +) + +distutils_enable_tests pytest + +python_prepare_all() { + # remove pytest-cov dep + sed -i -e '0,/addopts/I!d' setup.cfg || die + + # allow the use of jedi-18 + sed -i -e 's/jedi<0.18.0/jedi<0.19.0/g' python_language_server.egg-info/requires.txt || 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 +} diff --git a/dev-python/python-language-server/python-language-server-0.36.2.ebuild b/dev-python/python-language-server/python-language-server-0.36.2.ebuild index 66b2b7273e9b..ec3930243f79 100644 --- a/dev-python/python-language-server/python-language-server-0.36.2.ebuild +++ b/dev-python/python-language-server/python-language-server-0.36.2.ebuild @@ -56,7 +56,6 @@ python_prepare_all() { } pkg_postinst() { - elog "To get additional features, optional runtime dependencies may be installed:" 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 |