[arch-commits] Commit in python-language-server/trunk (PKGBUILD jedi15.patch)
Maxim Baz
maximbaz at archlinux.org
Sat Oct 12 11:03:03 UTC 2019
Date: Saturday, October 12, 2019 @ 11:03:02
Author: maximbaz
Revision: 515214
upgpkg: python-language-server 0.29.0-1
Modified:
python-language-server/trunk/PKGBUILD
Deleted:
python-language-server/trunk/jedi15.patch
--------------+
PKGBUILD | 13 +++-----
jedi15.patch | 86 ---------------------------------------------------------
2 files changed, 6 insertions(+), 93 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-10-12 10:16:01 UTC (rev 515213)
+++ PKGBUILD 2019-10-12 11:03:02 UTC (rev 515214)
@@ -3,7 +3,7 @@
# Contributor: fenuks
pkgname=python-language-server
-pkgver=0.28.3
+pkgver=0.29.0
pkgrel=1
pkgdesc="An implementation of the Language Server Protocol for Python"
arch=("any")
@@ -13,6 +13,7 @@
optdepends=("python-mccabe: for complexity checking"
"python-rope: for completions and renaming"
"python-pyflakes: for linter to detect various errors"
+ "flake8: for code linting"
"python-pycodestyle: for style checking"
"python-pylint: for code linting"
"autopep8: for code formatting"
@@ -19,20 +20,18 @@
"yapf: for code formatting (preferred over autopep8)"
"python-pydocstyle: for docstring style checking")
makedepends=("python" "python-setuptools")
-checkdepends=("python-pytest" "python-pytest-runner" "python-pytest-cov" "python-pyflakes"
+checkdepends=("python-pytest" "python-pytest-runner" "python-pytest-cov" "python-pyflakes" "flake8"
"python-mock" "python-jedi" "python-future" "yapf" "python-mccabe" "python-pycodestyle"
"autopep8" "python-rope" "python-pydocstyle" "python-pylint" "python-jsonrpc-server")
-source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz"
- jedi15.patch)
-sha256sums=('bf172c9c21fc5c2baa293155ddcb27712905f1ea1ebc0ba90985f7fd13039550'
- 'eaf656ed8400e0ebd8a2cc52311be018029f9c46b5dc23c4bb1a0a5067da7356')
+source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz")
+sha256sums=('008a1d4eac857f1b01cea3224503b6656d10833d2e08d6a9da7bde43c55ee33d')
build() {
cd "${pkgname}-${pkgver}"
- patch -Np1 -i "${srcdir}/jedi15.patch"
python setup.py build
}
+# TODO waiting for pylint 2.4 in repos
# check() {
# cd "${pkgname}-${pkgver}"
# py.test
Deleted: jedi15.patch
===================================================================
--- jedi15.patch 2019-10-12 10:16:01 UTC (rev 515213)
+++ jedi15.patch 2019-10-12 11:03:02 UTC (rev 515214)
@@ -1,86 +0,0 @@
-From c3cab77a85b1de4af1aec1bafea6a7320d6baec5 Mon Sep 17 00:00:00 2001
-From: Mykhailo Panarin <31699470+mpanarin at users.noreply.github.com>
-Date: Wed, 11 Sep 2019 16:39:03 +0300
-Subject: [PATCH] Separate signature from docstring on hover (#623)
-
----
- pyls/_utils.py | 1 -
- pyls/plugins/hover.py | 27 ++++++++++++++++++++++-----
- setup.py | 2 +-
- test/plugins/test_hover.py | 2 +-
- 4 files changed, 24 insertions(+), 8 deletions(-)
-
-diff --git a/pyls/_utils.py b/pyls/_utils.py
-index 1ce2195..48216b8 100644
---- a/pyls/_utils.py
-+++ b/pyls/_utils.py
-@@ -136,7 +136,6 @@ def format_docstring(contents):
- """
- contents = contents.replace('\t', u'\u00A0' * 4)
- contents = contents.replace(' ', u'\u00A0' * 2)
-- contents = contents.replace('*', '\\*')
- return contents
-
-
-diff --git a/pyls/plugins/hover.py b/pyls/plugins/hover.py
-index 605ba89..86f80c3 100644
---- a/pyls/plugins/hover.py
-+++ b/pyls/plugins/hover.py
-@@ -10,9 +10,26 @@ def pyls_hover(document, position):
- definitions = document.jedi_script(position).goto_definitions()
- word = document.word_at_position(position)
-
-- # Find an exact match for a completion
-- for d in definitions:
-- if d.name == word:
-- return {'contents': _utils.format_docstring(d.docstring()) or ''}
-+ # Find first exact matching definition
-+ definition = next((x for x in definitions if x.name == word), None)
-
-- return {'contents': ''}
-+ if not definition:
-+ return {'contents': ''}
-+
-+ # raw docstring returns only doc, without signature
-+ doc = _utils.format_docstring(definition.docstring(raw=True))
-+
-+ # Find first exact matching signature
-+ signature = next((x.to_string() for x in definition.get_signatures() if x.name == word), '')
-+
-+ contents = []
-+ if signature:
-+ contents.append({
-+ 'language': 'python',
-+ 'value': signature,
-+ })
-+ if doc:
-+ contents.append(doc)
-+ if not contents:
-+ return {'contents': ''}
-+ return {'contents': contents}
-diff --git a/setup.py b/setup.py
-index d0f7f7d..fcd3727 100755
---- a/setup.py
-+++ b/setup.py
-@@ -36,7 +36,7 @@
- 'future>=0.14.0',
- 'futures; python_version<"3.2"',
- 'backports.functools_lru_cache; python_version<"3.2"',
-- 'jedi>=0.14.1,<0.15',
-+ 'jedi>=0.15.0,<0.16',
- 'python-jsonrpc-server>=0.1.0',
- 'pluggy'
- ],
-diff --git a/test/plugins/test_hover.py b/test/plugins/test_hover.py
-index 5d3baf8..9b56d2e 100644
---- a/test/plugins/test_hover.py
-+++ b/test/plugins/test_hover.py
-@@ -21,7 +21,7 @@ def test_hover():
- doc = Document(DOC_URI, DOC)
-
- assert {
-- 'contents': 'main()\n\nhello world'
-+ 'contents': [{'language': 'python', 'value': 'main()'}, 'hello world']
- } == pyls_hover(doc, hov_position)
-
- assert {'contents': ''} == pyls_hover(doc, no_hov_position)
More information about the arch-commits
mailing list