Skip to content

Commit

Permalink
Upgrade Jedi to 0.12.0 (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn authored Apr 24, 2018
1 parent f83f6b5 commit d3acc5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
10 changes: 3 additions & 7 deletions pyls/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import os
import re
import sys
import imp
import pkgutil

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

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

return path
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'configparser; python_version<"3.0"',
'future>=0.14.0',
'futures; python_version<"3.2"',
'jedi>=0.10,<0.12',
'jedi>=0.12',
'pluggy'
],

Expand Down
9 changes: 0 additions & 9 deletions test/test_document.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright 2017 Palantir Technologies, Inc.
import sys
from test.fixtures import DOC_URI, DOC
from pyls.workspace import Document

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


def test_document_sys_path(doc):
"""Test the document's sys path is updated."""
assert 'foo' not in doc.sys_path()
sys.path.append('foo')
# Check that the new sys path is included in the doc's sys path
assert 'foo' in doc.sys_path()


def test_document_empty_edit():
doc = Document('file:///uri', u'')
doc.apply_change({
Expand Down

0 comments on commit d3acc5e

Please sign in to comment.