X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/77b6ed1b70bd07f058bc551906bc880022847964..c4d2db43231cb927c89a403e2837b7fee92a6ad5:/setup.py diff --git a/setup.py b/setup.py index 3ad639b..32329d3 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,7 @@ # Copyright (C) 2018 Łukasz Langa -import ast -import re from setuptools import setup import sys +import versioneer assert sys.version_info >= (3, 6, 0), "black requires Python 3.6+" from pathlib import Path # noqa E402 @@ -16,18 +15,10 @@ def get_long_description() -> str: return ld_file.read() -def get_version() -> str: - black_py = CURRENT_DIR / "black.py" - _version_re = re.compile(r"__version__\s+=\s+(?P.*)") - with open(black_py, "r", encoding="utf8") as f: - match = _version_re.search(f.read()) - version = match.group("version") if match is not None else '"unknown"' - return str(ast.literal_eval(version)) - - setup( name="black", - version=get_version(), + version=versioneer.get_version(), + cmdclass=versioneer.get_cmdclass(), description="The uncompromising code formatter.", long_description=get_long_description(), long_description_content_type="text/markdown", @@ -36,7 +27,7 @@ setup( author_email="lukasz@langa.pl", url="https://github.com/psf/black", license="MIT", - py_modules=["black", "blackd"], + py_modules=["black", "blackd", "_version"], packages=["blib2to3", "blib2to3.pgen2"], package_data={"blib2to3": ["*.txt"]}, python_requires=">=3.6",