Skip to content

Commit

Permalink
Ensure keys are sorted by versions
Browse files Browse the repository at this point in the history
So far it seems consistent, but if more are added, this might not be
guaranteed.
  • Loading branch information
joshuaboniface committed Nov 21, 2024
1 parent efa1e92 commit a1b09d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from git import Repo
from os import getenv
import os.path
from packaging.version import Version
from subprocess import run, PIPE
import sys
from yaml import load, SafeLoader
Expand Down Expand Up @@ -62,7 +63,9 @@ def _determine_framework_versions():
if submodule.name in configurations["frameworks"].keys():
for framework_arg in configurations["frameworks"][submodule.name].keys():
framework_args[framework_arg] = None
for commit_hash in configurations["frameworks"][submodule.name][framework_arg].keys():
def sort_versions(input_dict):
return dict(sorted(input_dict.items(), key=lambda item: Version(str(item[1]))))
for commit_hash in sort_versions(configurations["frameworks"][submodule.name][framework_arg]):
try:
commit = submodule.module().commit(commit_hash)
if commit in submodule.module().iter_commits('HEAD'):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
GitPython
pyyaml
packaging

0 comments on commit a1b09d2

Please sign in to comment.