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.
This commit is contained in:
Krystine Sherwin 2024-05-04 16:51:29 +12:00
parent 0f9ee20ea2
commit bb0be8c7a2
No known key found for this signature in database
1 changed files with 8 additions and 0 deletions

View File

@ -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')