Skip to content

Commit

Permalink
Doc: Fix cleaning of version for RTD
Browse files Browse the repository at this point in the history
  • Loading branch information
DerWeh committed Jun 1, 2021
1 parent 18c3bd7 commit 0d771f6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@
# The full version, including alpha/beta/rc tags.
release = gftool.__version__

commits = gftool.__version__.split('+', maxsplit=1)[1].split('.', maxsplit=1)[0]
try:
commits = int(commits)
except ValueError:
pass
else:
if not commits: # this is a taged version, let's just state the tag
version = gftool.__version__.split('+', maxsplit=1)[0]

try: # clean the version if it gets dirtied e.g. by RTD
commits = gftool.__version__.split('+', maxsplit=1)[1].split('.', maxsplit=1)[0]
try:
commits = int(commits)
except ValueError:
pass
else:
if not commits: # this is a tagged version, let's just state the tag
version = gftool.__version__.split('+', maxsplit=1)[0]
except IndexError:
pass # apparently we have already only the tag

# -- General configuration ---------------------------------------------------

Expand Down

0 comments on commit 0d771f6

Please sign in to comment.