From b9131c607005722e7c36eea24ead835f34fab5aa Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Thu, 28 May 2020 15:26:48 +0300 Subject: [PATCH] Upgrade setup.py's version parsing for 3.8+ --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index cafb8b75..62096af5 100755 --- a/setup.py +++ b/setup.py @@ -1,17 +1,15 @@ #!/usr/bin/env python from setuptools import setup, find_packages +from setuptools.depends import get_module_constant import os -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[int(not hasattr(tree, 'docstring'))].value.s +version = get_module_constant("jedi", "__version__") readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read() with open('requirements.txt') as f: