From 8e793885a60610ec71613d418218ee259d2b67eb Mon Sep 17 00:00:00 2001 From: Max Grover Date: Thu, 31 Oct 2024 12:52:23 -0500 Subject: [PATCH] FIX: Fix version of ACT at top of page (#868) * FIX: Fix version of ACT at top of page * FIX: Fix when version is empty --- docs/source/conf.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c27f0bab3a..473e9c81a6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -93,11 +93,20 @@ # built documents. # import act # noqa +import re # noqa + +# Extrac the version info and parse it +verinfo = act.__version__ + +if verinfo is None: + verinfo = "" + +parsed_version = re.search(r"(?P(?P\d+\.\d+)\.?\w*)", verinfo).groupdict() # The short X.Y version. -version = act.__version__ -# The full version, including alpha/beta/rc tags. -release = act.__version__ +version = parsed_version["base"] +if "+" in verinfo: + version += "dev" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.