From d6f695b3bb288f10fd0c1cc47f65a0ed4bf7d7dc Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 20 May 2017 17:53:11 -0400 Subject: [PATCH] Use the ast module instead of a jedi import to get the jedi version. With dependencies it's not possible to do this with importing jedi anymore. It's now just a bit more complicated. Gosh I hate setup.py. --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index fc0bd637..b531d9d3 100755 --- a/setup.py +++ b/setup.py @@ -2,19 +2,24 @@ from setuptools import setup -import jedi +import ast __AUTHOR__ = 'David Halter' __AUTHOR_EMAIL__ = 'davidhalter88@gmail.com' +# Get the version from within jedi. It's defined in exactly one place now. +with open('jedi/__init__.py') as f: + tree = ast.parse(f.read()) +version = tree.body[1].value.s + readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read() packages = ['jedi', 'jedi.evaluate', 'jedi.evaluate.compiled', 'jedi.api'] with open('requirements.txt') as f: install_requires = f.read().splitlines() setup(name='jedi', - version=jedi.__version__, + version=version, description='An autocompletion tool for Python that can be used for text editors.', author=__AUTHOR__, author_email=__AUTHOR_EMAIL__,