From 1b69c3588134c45a08184fbdba7afbd32d8fd4c8 Mon Sep 17 00:00:00 2001 From: Niels Bantilan Date: Wed, 10 Jan 2024 10:28:48 -0500 Subject: [PATCH] monodocs: do not use beta releases when importing projects Signed-off-by: Niels Bantilan --- docs/_ext/import_projects.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/_ext/import_projects.py b/docs/_ext/import_projects.py index b4fa6310d7..df223ee760 100644 --- a/docs/_ext/import_projects.py +++ b/docs/_ext/import_projects.py @@ -53,6 +53,8 @@ class Project: ``` """ +VERSION_PATTERN = r"^v[0-9]+.[0-9]+.[0-9]+$" + class ListTableToc(SphinxDirective): """Custom directive to convert list-table into both list-table and toctree.""" @@ -146,7 +148,10 @@ def import_projects(app: Sphinx, config: Config): dest_docs_dir = srcdir / project.dest if repo: - tags = sorted(repo.tags, key=lambda t: t.commit.committed_datetime) + tags = sorted( + [t for t in repo.tags if re.match(VERSION_PATTERN, t.name)], + key=lambda t: t.commit.committed_datetime + ) if not tags: # If tags don't exist just use the current commit. This occurs # when the git repo is a shallow clone.