summaryrefslogtreecommitdiff
path: root/dev-python/python-language-server/files/pyls-numpy-1.20.patch
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2021-04-07 01:52:55 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2021-04-07 01:52:55 +0000
commite0f0cfbd0b5786b9576a76b717018b5bdcafbde8 (patch)
tree2f3a28d6cbf0e0a6cd119e07bda0297b1ccb647d /dev-python/python-language-server/files/pyls-numpy-1.20.patch
parent1b9c706bdbbcaa877c2d7ba7d7a984beda2c5163 (diff)
downloadbaldeagleos-repo-e0f0cfbd0b5786b9576a76b717018b5bdcafbde8.tar.gz
baldeagleos-repo-e0f0cfbd0b5786b9576a76b717018b5bdcafbde8.tar.xz
baldeagleos-repo-e0f0cfbd0b5786b9576a76b717018b5bdcafbde8.zip
Adding metadata
Diffstat (limited to 'dev-python/python-language-server/files/pyls-numpy-1.20.patch')
-rw-r--r--dev-python/python-language-server/files/pyls-numpy-1.20.patch63
1 files changed, 63 insertions, 0 deletions
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
+
+
+