Skip to content

Commit

Permalink
DOC: prevent ReadTheDocs to build without a release
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaBlengino committed Apr 13, 2024
1 parent 596188f commit f2485c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down

0 comments on commit f2485c6

Please sign in to comment.