Skip to content

Commit afe05ce

Browse files
update documentation versioning
1 parent 42e2fcd commit afe05ce

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

doc/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cython>=0.20
22
m2r2
33
docutils>=0.18.1,<0.21
4-
furo
4+
furo
5+
dunamai

doc/source/conf.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,27 @@
5656
# |version| and |release|, also used in various other places throughout the
5757
# built documents.
5858
#
59-
# The short X.Y version.
60-
version = "918.14"
61-
# The full version, including alpha/beta/rc tags.
62-
release = version
59+
# Get version dynamically from the same source as pyproject.toml
60+
try:
61+
# First, try to import from the generated ics module (same as pyproject.toml)
62+
sys.path.insert(0, os.path.abspath("../../gen"))
63+
import ics
64+
version = ics.__version__
65+
release = ics.__full_version__
66+
except ImportError:
67+
try:
68+
# Fallback: try dunamai directly (for build environments)
69+
import dunamai
70+
version = dunamai.Version.from_git().serialize(metadata=False)
71+
release = dunamai.Version.from_git().serialize(format="v{base}-{commit}-{timestamp}")
72+
except ImportError:
73+
# Fallback if neither is available
74+
version = "unknown"
75+
release = version
76+
except Exception:
77+
# Fallback if not in a git repository or other issues
78+
version = "unknown"
79+
release = version
6380

6481
# The language for content autogenerated by Sphinx. Refer to documentation
6582
# for a list of supported languages.

0 commit comments

Comments
 (0)