File tree Expand file tree Collapse file tree 3 files changed +4
-17
lines changed Expand file tree Collapse file tree 3 files changed +4
-17
lines changed Original file line number Diff line number Diff line change 3
3
import logging
4
4
import os
5
5
import re
6
- import sys
7
6
import imp
8
7
import pkgutil
9
8
@@ -268,11 +267,8 @@ def sys_path(self):
268
267
# Copy our extra sys path
269
268
path = list (self ._extra_sys_path )
270
269
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 ())
277
273
278
274
return path
Original file line number Diff line number Diff line change 35
35
'configparser; python_version<"3.0"' ,
36
36
'future>=0.14.0' ,
37
37
'futures; python_version<"3.2"' ,
38
- 'jedi>=0.10,<0. 12' ,
38
+ 'jedi>=0.12' ,
39
39
'pluggy'
40
40
],
41
41
Original file line number Diff line number Diff line change 1
1
# Copyright 2017 Palantir Technologies, Inc.
2
- import sys
3
2
from test .fixtures import DOC_URI , DOC
4
3
from pyls .workspace import Document
5
4
@@ -42,14 +41,6 @@ def test_word_at_position(doc):
42
41
assert doc .word_at_position ({'line' : 4 , 'character' : 0 }) == ''
43
42
44
43
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
-
53
44
def test_document_empty_edit ():
54
45
doc = Document ('file:///uri' , u'' )
55
46
doc .apply_change ({
You can’t perform that action at this time.
0 commit comments