diff --git a/docs/source/conf.py b/docs/source/conf.py index 687ef9e..b62362f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,10 @@ project = 'gearpy' copyright = '2024, Andrea Blengino' author = 'Andrea Blengino' -release = subprocess.run(['git', 'describe', '--tags'], stdout = subprocess.PIPE).stdout.decode('utf-8').split('-')[0] +release = subprocess.run(['git', 'describe', '--tags'], stdout = subprocess.PIPE).stdout.decode('utf-8') + +if not release.startswith('v') or not release.endswith('\n') or '-' in release or release.count('.') != 2: + raise ValueError(f"Invalid release name {release}.") # -- General configuration ---------------------------------------------------