diff --git a/doc/sphinx/source/conf.py b/doc/sphinx/source/conf.py index 0620a585..6aa70864 100644 --- a/doc/sphinx/source/conf.py +++ b/doc/sphinx/source/conf.py @@ -61,8 +61,23 @@ # The short X.Y version. version = '.'.join(packageversion.split('.')[:2]) + # The full version, including alpha/beta/rc tags. -release = packageversion +##release = packageversion +# +# clean up for RTD: +# 0.7.0+5.g8afad4b.dirty --> 0.7.0+5.g8afad4b +# 0.7.0+0.g43485dd.dirty --> 0.7.0 +try: + ver, rc = packageversion.split("+") +except ValueError: + ver, rc = packageversion, None + +if not rc or rc.startswith('0'): + release = ver +else: + release = ver + "+" + rc.replace(".dirty", "") + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.