Skip to content

Commit f59b921

Browse files
Chg to project name retrieval from pyproject.toml (#332)
Replaced the hardcoded project name with dynamic retrieval from `pyproject.toml` using `tomllib`. This ensures consistency and reduces manual updates for project metadata.
1 parent 5b6e617 commit f59b921

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/conf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313

1414
import importlib.metadata
1515
import os
16+
from pathlib import Path
1617
import sys
18+
import tomllib
1719

1820
sys.path.insert(0, os.path.abspath(".."))
1921

2022

2123
# -- Project information -----------------------------------------------------
2224

23-
project = "SalishSeaNowcast"
25+
with Path("../pyproject.toml").open("rb") as f:
26+
pkg_info = tomllib.load(f)
27+
project = pkg_info["project"]["name"]
2428
author = "SalishSeaCast Project Contributors and The University of British Columbia"
2529
pkg_creation_year = 2013
2630
copyright = f"{pkg_creation_year} – present, {author}"

0 commit comments

Comments
 (0)