X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/dbe26161fa68632d608a440666a0960a32630902..7ae084aaa13b8c1b66410de44f0b9f86ab798c5c:/docs/conf.py diff --git a/docs/conf.py b/docs/conf.py index aeb57f9..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): @@ -161,12 +163,13 @@ html_theme_options = { "show_related": False, "description": "“Any color you like.”", "github_button": True, - "github_user": "ambv", + "github_user": "psf", "github_repo": "black", "github_type": "star", "show_powered_by": True, "fixed_sidebar": True, "logo": "logo2.png", + "travis_button": True, }