TNO Intern

Commit 5c8061af authored by Arjo Segers's avatar Arjo Segers
Browse files

Read release tag for documentation from the pyproject.toml file.

parent 7e6c9485
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -24,8 +24,23 @@ project = "CSO"
copyright = "2020-2025, Arjo Segers"
author = "Arjo Segers"

# The full version, including alpha/beta/rc tags
release = "v2.12"
# extract the version id from the project file:
ppfile = os.path.join(os.pardir, os.pardir, "pyproject.toml")
# check ..
if not os.path.isfile(ppfile):
    # info ...
    print(f"WARNING - could not find '{ppfile}' to extract release tag ...")
    # dummy:
    release = "vx.y"
else:
    # modules:
    import toml
    # open file:
    with open(ppfile, "r") as f:
        config = toml.load(f)
    # extrract:
    release = config["project"]["version"]
#endif


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