Skip to content

Commit

Permalink
fix displayed version in docs
Browse files Browse the repository at this point in the history
for some reason setuptools_scm doesn't play nice with
github actions. as a result we need to remove a trailing
dev0 (i.e. zero distance from last release) annotation
that can show up in the release string when deploying
the docs
  • Loading branch information
rmorshea committed Oct 23, 2020
1 parent 62c6f1f commit d587a43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@
copyright = "2019, Ryan Morshead"
author = "Ryan Morshead"

dist = get_distribution("idom")
release = get_distribution("idom").version.split("+")[0]

# Hack because setuptools_scm doesn't play nice with github actions
# dev0 indicates we're zero distance away from the last release
# but setuptools_scm still seems to think we're developing. This
# we need to remedy this misunderstanding.
if release.endswith(".dev0"):
major, minor, patch, *_ = release.split(".")
release = f"{major}.{minor}.{int(patch) - 1}"

# for example take major/minor
version = ".".join(release.split(".")[:2])

Expand Down

0 comments on commit d587a43

Please sign in to comment.