Skip to content

Commit fcb9bee

Browse files
authored
Merge pull request #7 from bnavigator/numpy_hover
Unpin numpy
2 parents 8e41c8a + e037314 commit fcb9bee

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
'yapf': ['yapf'],
7676
'test': ['versioneer',
7777
'pylint>=2.5.0' if sys.version_info.major >= 3 else 'pylint',
78-
'pytest', 'mock', 'pytest-cov', 'coverage', 'numpy<1.20', 'pandas',
78+
'pytest', 'mock', 'pytest-cov', 'coverage', 'numpy', 'pandas',
7979
'matplotlib', 'pyqt5;python_version>="3"', 'flaky'],
8080
},
8181

test/plugins/test_completion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ def test_completion_with_class_objects(config, workspace):
216216

217217

218218
def test_snippet_parsing(config, workspace):
219-
doc = 'import numpy as np\nnp.logical_and'
220-
completion_position = {'line': 1, 'character': 14}
219+
doc = 'divmod'
220+
completion_position = {'line': 0, 'character': 6}
221221
doc = Document(DOC_URI, workspace, doc)
222222
config.capabilities['textDocument'] = {
223223
'completion': {'completionItem': {'snippetSupport': True}}}
224224
config.update({'plugins': {'jedi_completion': {'include_params': True}}})
225225
completions = pyls_jedi_completions(config, doc, completion_position)
226-
out = 'logical_and(${1:x1}, ${2:x2})$0'
226+
out = 'divmod(${1:a}, ${2:b})$0'
227227
assert completions[0]['insertText'] == out
228228

229229

test/plugins/test_hover.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ def test_numpy_hover(workspace):
4646
contents = 'NumPy\n=====\n\nProvides\n'
4747
assert contents in pyls_hover(doc, numpy_hov_position_3)['contents'][0]
4848

49-
contents = 'Trigonometric sine, element-wise.\n\n'
50-
assert contents in pyls_hover(
51-
doc, numpy_sin_hov_position)['contents'][0]
49+
# https://github.com/davidhalter/jedi/issues/1746
50+
import numpy as np
51+
52+
if np.lib.NumpyVersion(np.__version__) < '1.20.0':
53+
contents = 'Trigonometric sine, element-wise.\n\n'
54+
assert contents in pyls_hover(
55+
doc, numpy_sin_hov_position)['contents'][0]
5256

5357

5458
def test_hover(workspace):

0 commit comments

Comments
 (0)