From bb0be8c7a20335f8e03597cfcf052609f8a1f4a4 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 4 May 2024 16:51:29 +1200 Subject: [PATCH] Docs: Set release to YOSYS_VER If building from read the docs, and the current build is "latest", add `-dev` to the version string. Requires `YOSYS_VER` to be exported by .readthedocs.yaml. --- docs/source/conf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 29d36d9c4..aed3fddff 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,6 +63,14 @@ latex_elements = { extensions.append('sphinx.ext.todo') todo_include_todos = False +# attempt to get version +env_yosys_ver = os.getenv("YOSYS_VER") +if env_yosys_ver: + if os.getenv("READTHEDOCS") and os.getenv("READTHEDOCS_VERSION") == "latest": + release = env_yosys_ver + "-dev" + else: + release = env_yosys_ver + # custom cmd-ref parsing/linking sys.path += [os.path.dirname(__file__) + "/../"] extensions.append('util.cmdref')