Skip to content

Commit d3acc5e

Browse files
authored
Upgrade Jedi to 0.12.0 (#340)
1 parent f83f6b5 commit d3acc5e

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

pyls/workspace.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44
import os
55
import re
6-
import sys
76
import imp
87
import pkgutil
98

@@ -268,11 +267,8 @@ def sys_path(self):
268267
# Copy our extra sys path
269268
path = list(self._extra_sys_path)
270269

271-
# Check to see if we're in a virtualenv
272-
if 'VIRTUAL_ENV' in os.environ:
273-
log.info("Using virtualenv %s", os.environ['VIRTUAL_ENV'])
274-
path.extend(jedi.evaluate.sys_path.get_venv_path(os.environ['VIRTUAL_ENV']))
275-
else:
276-
path.extend(sys.path)
270+
# TODO(gatesn): #339 - make better use of jedi environments, they seem pretty powerful
271+
environment = jedi.api.environment.get_default_environment()
272+
path.extend(environment.get_sys_path())
277273

278274
return path

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
'configparser; python_version<"3.0"',
3636
'future>=0.14.0',
3737
'futures; python_version<"3.2"',
38-
'jedi>=0.10,<0.12',
38+
'jedi>=0.12',
3939
'pluggy'
4040
],
4141

test/test_document.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Copyright 2017 Palantir Technologies, Inc.
2-
import sys
32
from test.fixtures import DOC_URI, DOC
43
from pyls.workspace import Document
54

@@ -42,14 +41,6 @@ def test_word_at_position(doc):
4241
assert doc.word_at_position({'line': 4, 'character': 0}) == ''
4342

4443

45-
def test_document_sys_path(doc):
46-
"""Test the document's sys path is updated."""
47-
assert 'foo' not in doc.sys_path()
48-
sys.path.append('foo')
49-
# Check that the new sys path is included in the doc's sys path
50-
assert 'foo' in doc.sys_path()
51-
52-
5344
def test_document_empty_edit():
5445
doc = Document('file:///uri', u'')
5546
doc.apply_change({

0 commit comments

Comments
 (0)