File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed
Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change 3434 # Additional versions added below
3535]
3636
37- # Used for determining the latest stable release so the banner can be added to older releases.
38- _stable = None
3937# Use tags to determine versions - a stable version will have a branch before it's released, but not a tag.
4038tags = check_output (("git" , "tag" )).decode ().splitlines ()
41- for _tag in reversed (tags ):
42- if _tag .startswith ("v" ) and _tag .count ("." ) == 1 :
43- # this version is released
44- _ver = _tag [1 :]
45- if not _stable :
46- _stable = _ver
47- if Version (_ver ) >= MIN_DOC_VERSION :
48- simpleversioning_versions .append ({"id" : f"release_{ _ver } " , "name" : _ver })
39+ found_versions = []
40+ for _tag in sorted (tags , reverse = True ):
41+ if not _tag .startswith ("v" ):
42+ continue
43+ _ver_parts = _tag [1 :].split ("." )
44+ if len (_ver_parts ) == 1 :
45+ # No "."
46+ continue
47+ # Keep only major and minor version numbers
48+ _ver = "." .join (_ver_parts [:2 ])
49+ if Version (_ver ) < MIN_DOC_VERSION :
50+ continue
51+ if _ver in found_versions :
52+ continue
53+ found_versions .append (_ver )
54+ simpleversioning_versions .append ({"id" : f"release_{ _ver } " , "name" : _ver })
55+
56+ # The latest stable release
57+ _stable = found_versions [0 ] if found_versions else None
4958
5059if re .fullmatch (r"release_\d{2}\.\d{1,2}" , TARGET_GIT_BRANCH ):
5160 if _stable :
You can’t perform that action at this time.
0 commit comments