1
0
forked from VimPlug/jedi

Merge branch 'master' into virtualenv

This commit is contained in:
Dave Halter
2017-12-18 01:41:29 +01:00
13 changed files with 47 additions and 12 deletions

View File

@@ -8,11 +8,14 @@ python:
- 3.5 - 3.5
- 3.6 - 3.6
- pypy - pypy
- "3.7-dev"
matrix: matrix:
allow_failures: allow_failures:
- python: pypy - python: pypy
- env: TOXENV=cov - env: TOXENV=cov
- env: TOXENV=sith - env: TOXENV=sith
- python: 3.7-dev
include: include:
- python: 3.5 - python: 3.5
env: TOXENV=cov env: TOXENV=cov
@@ -27,4 +30,3 @@ after_script:
pip install --quiet coveralls; pip install --quiet coveralls;
coveralls; coveralls;
fi fi

View File

@@ -44,6 +44,7 @@ Mathias Rav (@Mortal) <rav@cs.au.dk>
Daniel Fiterman (@dfit99) <fitermandaniel2@gmail.com> Daniel Fiterman (@dfit99) <fitermandaniel2@gmail.com>
Simon Ruggier (@sruggier) Simon Ruggier (@sruggier)
Élie Gouzien (@ElieGouzien) Élie Gouzien (@ElieGouzien)
Robin Roth (@robinro)
Malte Plath (@langsamer)
Note: (@user) means a github user name. Note: (@user) means a github user name.

View File

@@ -3,6 +3,12 @@
Changelog Changelog
--------- ---------
0.11.1 (2017-12-14)
+++++++++++++++++++
- Parso update - the caching layer was broken
- Better usages - a lot of internal code was ripped out and improved.
0.11.0 (2017-09-20) 0.11.0 (2017-09-20)
+++++++++++++++++++ +++++++++++++++++++

0
deploy-master.sh Normal file → Executable file
View File

View File

@@ -222,7 +222,7 @@ A little history
The Star Wars Jedi are awesome. My Jedi software tries to imitate a little bit The Star Wars Jedi are awesome. My Jedi software tries to imitate a little bit
of the precognition the Jedi have. There's even an awesome `scene of the precognition the Jedi have. There's even an awesome `scene
<http://www.youtube.com/watch?v=5BDO3pyavOY>`_ of Monty Python Jedis :-). <https://youtu.be/yHRJLIf7wMU>`_ of Monty Python Jedis :-).
But actually the name hasn't so much to do with Star Wars. It's part of my But actually the name hasn't so much to do with Star Wars. It's part of my
second name. second name.

View File

@@ -36,7 +36,7 @@ As you see Jedi is pretty simple and allows you to concentrate on writing a
good text editor, while still having very good IDE features for Python. good text editor, while still having very good IDE features for Python.
""" """
__version__ = '0.11.0' __version__ = '0.12.0'
from jedi.api import Script, Interpreter, set_debug_function, \ from jedi.api import Script, Interpreter, set_debug_function, \
preload_module, names preload_module, names

View File

@@ -258,6 +258,8 @@ class Evaluator(object):
else: else:
i = trailer.parent.children.index(trailer) i = trailer.parent.children.index(trailer)
to_evaluate = trailer.parent.children[:i] to_evaluate = trailer.parent.children[:i]
if to_evaluate[0] == 'await':
to_evaluate.pop(0)
context_set = context.eval_node(to_evaluate[0]) context_set = context.eval_node(to_evaluate[0])
for trailer in to_evaluate[1:]: for trailer in to_evaluate[1:]:
context_set = eval_trailer(context, context_set, trailer) context_set = eval_trailer(context, context_set, trailer)

View File

@@ -58,8 +58,11 @@ def evaluate_call_of_leaf(context, leaf, cut_own_trailer=False):
If you're using the leaf, e.g. the bracket `)` it will return ``list([])``. If you're using the leaf, e.g. the bracket `)` it will return ``list([])``.
# TODO remove cut_own_trailer option, since its always used with it. Just We use this function for two purposes. Given an expression ``bar.foo``,
# ignore it, It's not what we want anyway. Or document it better? we may want to
- infer the type of ``foo`` to offer completions after foo
- infer the type of ``bar`` to be able to jump to the definition of foo
The option ``cut_own_trailer`` must be set to true for the second purpose.
""" """
trailer = leaf.parent trailer = leaf.parent
# The leaf may not be the last or first child, because there exist three # The leaf may not be the last or first child, because there exist three
@@ -89,6 +92,10 @@ def evaluate_call_of_leaf(context, leaf, cut_own_trailer=False):
base = power.children[0] base = power.children[0]
trailers = power.children[1:cut] trailers = power.children[1:cut]
if base == 'await':
base = trailers[0]
trailers = trailers[1:]
values = context.eval_node(base) values = context.eval_node(base)
from jedi.evaluate.syntax_tree import eval_trailer from jedi.evaluate.syntax_tree import eval_trailer
for trailer in trailers: for trailer in trailers:

View File

@@ -1 +1 @@
parso==0.1.0 parso==0.1.1

View File

@@ -3,7 +3,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
import ast import ast
import sys
__AUTHOR__ = 'David Halter' __AUTHOR__ = 'David Halter'
__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com' __AUTHOR_EMAIL__ = 'davidhalter88@gmail.com'
@@ -11,7 +11,10 @@ __AUTHOR_EMAIL__ = 'davidhalter88@gmail.com'
# Get the version from within jedi. It's defined in exactly one place now. # Get the version from within jedi. It's defined in exactly one place now.
with open('jedi/__init__.py') as f: with open('jedi/__init__.py') as f:
tree = ast.parse(f.read()) tree = ast.parse(f.read())
version = tree.body[1].value.s if sys.version_info > (3, 7):
version = tree.body[0].value.s
else:
version = tree.body[1].value.s
readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read() readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read()
with open('requirements.txt') as f: with open('requirements.txt') as f:
@@ -31,6 +34,7 @@ setup(name='jedi',
long_description=readme, long_description=readme,
packages=find_packages(exclude=['test']), packages=find_packages(exclude=['test']),
install_requires=install_requires, install_requires=install_requires,
extras_require={'dev': ['docopt']},
package_data={'jedi': ['evaluate/compiled/fake/*.pym']}, package_data={'jedi': ['evaluate/compiled/fake/*.pym']},
platforms=['any'], platforms=['any'],
classifiers=[ classifiers=[
@@ -46,6 +50,8 @@ setup(name='jedi',
'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Editors :: Integrated Development Environments (IDE)', 'Topic :: Text Editors :: Integrated Development Environments (IDE)',
'Topic :: Utilities', 'Topic :: Utilities',

View File

@@ -23,3 +23,14 @@ async def x2():
async with open('asdf') as f: async with open('asdf') as f:
#? ['readlines'] #? ['readlines']
f.readlines f.readlines
class A():
@staticmethod
async def b(c=1, d=2):
return 1
#! 9 ['def b']
await A.b()
#! 11 ['param d=2']
await A.b(d=3)

View File

@@ -158,7 +158,7 @@ class IntegrationTestCase(object):
return self.line_nr - 1 return self.line_nr - 1
def __repr__(self): def __repr__(self):
return '<%s: %s:%s:%s>' % (self.__class__.__name__, self.module_name, return '<%s: %s:%s %r>' % (self.__class__.__name__, self.path,
self.line_nr_test, self.line.rstrip()) self.line_nr_test, self.line.rstrip())
def script(self): def script(self):

View File

@@ -1,8 +1,8 @@
[tox] [tox]
envlist = py26, py27, py33, py34, py35, py36 envlist = py27, py33, py34, py35, py36
[testenv] [testenv]
deps = deps =
pytest>=2.3.5 pytest>=2.3.5, < 3.3
pytest-cache pytest-cache
# docopt for sith doctests # docopt for sith doctests
docopt docopt