From c9689b80fbb108316b0330fc1ed444ccab419b02 Mon Sep 17 00:00:00 2001 From: Zsolt Dollenstein Date: Wed, 21 Aug 2019 16:40:51 +0200 Subject: [PATCH] fix doc generation --- docs/conf.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 9eff25a..6421d53 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,11 +25,13 @@ CURRENT_DIR = Path(__file__).parent def get_version(): - black_py = CURRENT_DIR / ".." / "black.py" - _version_re = re.compile(r"__version__\s+=\s+(?P.*)") - with open(str(black_py), "r", encoding="utf8") as f: - version = _version_re.search(f.read()).group("version") - return str(ast.literal_eval(version)) + import sys + + sys.path.append(str(CURRENT_DIR.parent)) + from _version import get_versions + + v = get_versions() + return v.get("closest-tag", v["version"]) def make_pypi_svg(version): -- 2.39.5