Skip to content

Commit

Permalink
Fix doc version sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Nov 20, 2023
1 parent 8942df9 commit f97607c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
- name: Update versions.json file
shell: python
run: |
from distutils.version import StrictVersion
import json
import pathlib
import os
Expand All @@ -133,6 +134,13 @@ jobs:
versions.remove("latest")
os.system("rm latest")
# Sort versions, ignoring the initial 'v'
def sort_version(version):
if "x" in version:
version = version.replace("x", "1000")
return StrictVersion(version[1:])
versions = sorted(versions, key=sort_version, reverse=True)
list_of_dicts = []
latest = None
for version in versions:
Expand Down

0 comments on commit f97607c

Please sign in to comment.