Upgrade setup.py's version parsing for 3.8+

This commit is contained in:
Batuhan Taskaya
2020-05-28 15:26:48 +03:00
parent 2d672d2f28
commit b9131c6070

View File

@@ -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: