From 2345d90e0e862bf57b423f305b5d4e4f37d517c1 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Tue, 9 Jun 2020 13:03:48 +0200 Subject: [PATCH] Fix docs building on Windows --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 0af84cf..5a47bfa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,6 +18,7 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # import os +import platform import subprocess import sys import typing @@ -50,8 +51,9 @@ intersphinx_mapping = {'python': ('https://docs.python.org/3', None), 'requests': ('https://requests.kennethreitz.org/en/master/', None)} current_release = subprocess.check_output(["git", "describe", "--abbrev=0"]).decode("ascii")[1:-1] +date_format = "%e %b %Y" if platform.system() != "Windows" else "%d %b %Y" current_release_date = subprocess.check_output( - ["git", "log", "-1", "--tags", "--format=%ad", "--date=format:%e %b %Y"]).decode("ascii")[:-1] + ["git", "log", "-1", "--tags", "--format=%ad", "--date=format:"+date_format]).decode("ascii")[:-1] html_context = {'current_release': current_release, 'current_release_date': current_release_date}