Skip to content

Commit 17e0e37

Browse files
committed
docs: release
1 parent e30d207 commit 17e0e37

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/docs/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from os import environ
1414
from pathlib import Path
1515

16+
from packaging.version import parse
17+
1618
if sys.version_info >= (3, 11):
1719
import tomllib as toml
1820
else:
@@ -29,7 +31,15 @@
2931
author = "Choi Min-yeong"
3032
kr_timezone = timezone(timedelta(hours=9))
3133
copyright = f"2024-{datetime.now(kr_timezone).year}, Choi Min-yeong"
32-
release = environ.get("READTHEDOCS_GIT_IDENTIFIER", dist.version)
34+
35+
parsed_version = parse(dist.version)
36+
version = parsed_version.base_version
37+
readthedocs = environ.get("READTHEDOCS_VERSION")
38+
if readthedocs and readthedocs in ["latest", "stable", "main", "dev"]:
39+
release = readthedocs
40+
else:
41+
release = parsed_version.public
42+
3343
repo_url: str = pyproject_dict["project"]["urls"]["Repository"]
3444

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

0 commit comments

Comments
 (0)