Skip to content

Commit 29f2e94

Browse files
authored
fix: fixed a problem with incorrect version being added to the tutori… (#14)
* fix: fixed a problem with incorrect version being added to the tutorials. Now the version is taken directly from the git tag. * revert accidental commit
1 parent 9210273 commit 29f2e94

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import os
22
import re
3-
import sys
43
import subprocess
4+
import sys
55
from datetime import datetime
66

7-
87
sys.path.insert(0, os.path.abspath("exts"))
98

109
tags: set
@@ -18,15 +17,14 @@
1817
def tagged_commit():
1918
"""Check if we are on a tagged commit"""
2019
try:
21-
subprocess.check_call(
20+
output = subprocess.check_output(
2221
["git", "describe", "--tags", "--exact-match", "HEAD"],
23-
stdout=subprocess.DEVNULL,
22+
text=True,
2423
stderr=subprocess.DEVNULL,
2524
)
2625
except subprocess.CalledProcessError:
2726
return False
28-
else:
29-
return True
27+
return output.strip()
3028

3129

3230
if tags.has("offline"):
@@ -201,10 +199,11 @@ def tagged_commit():
201199
# The short X.Y version.
202200
version = ams_version_short
203201
# The full version, including alpha/beta/rc tags.
204-
release = ams_version
205202

206-
if tags.has("draft"):
207-
release = release + "-dev"
203+
release = "Dev"
204+
if current_tag := tagged_commit():
205+
if current_tag.startswith("tutorials-"):
206+
release = current_tag.split("-", 1)[1]
208207

209208

210209
# -- Options for HTML output ----------------------------------------------

0 commit comments

Comments
 (0)