Skip to content

Commit d587a43

Browse files
committed
fix displayed version in docs
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
1 parent 62c6f1f commit d587a43

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: docs/source/conf.py

+10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@
2727
copyright = "2019, Ryan Morshead"
2828
author = "Ryan Morshead"
2929

30+
dist = get_distribution("idom")
3031
release = get_distribution("idom").version.split("+")[0]
32+
33+
# Hack because setuptools_scm doesn't play nice with github actions
34+
# dev0 indicates we're zero distance away from the last release
35+
# but setuptools_scm still seems to think we're developing. This
36+
# we need to remedy this misunderstanding.
37+
if release.endswith(".dev0"):
38+
major, minor, patch, *_ = release.split(".")
39+
release = f"{major}.{minor}.{int(patch) - 1}"
40+
3141
# for example take major/minor
3242
version = ".".join(release.split(".")[:2])
3343

0 commit comments

Comments
 (0)