From d1601feec1dcaa536537f9dd74cd4a99527a859a Mon Sep 17 00:00:00 2001 From: Frithjof Gressmann Date: Fri, 26 Jan 2024 11:27:46 -0600 Subject: [PATCH] Ensure stable file order during mechanism hashing --- src/miv_simulator/mechanisms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miv_simulator/mechanisms.py b/src/miv_simulator/mechanisms.py index 810ce3d..99dffc6 100644 --- a/src/miv_simulator/mechanisms.py +++ b/src/miv_simulator/mechanisms.py @@ -51,7 +51,7 @@ def compile( mod_files = glob(os.path.join(src, "**/*.mod"), recursive=True) else: mod_files = glob(os.path.join(src, "*.mod")) - for m in mod_files: + for m in sorted(mod_files, key=lambda x: x.replace(src, "")): with open(m, "r") as fm: data = fm.read() hash_object.update(data.encode())