Skip to content

Commit eb39086

Browse files
author
Jan Sebastian Rothe
committed
List instead of set
1 parent b7914b6 commit eb39086

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fagfunksjoner/paths/versions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_version_number(filepath: str) -> int:
2929
"""
3030
# Ensure the input is a string and extract the version part.
3131
if not isinstance(filepath, str):
32-
raise ValueError(f"Expected a string for filepath, got {type(filepath)}")
32+
raise ValueError(f"Expected a string for filepath, got {filepath}")
3333

3434
# Extract the version number by splitting the string at '_v' and '.'
3535
version_str = filepath.split("_v")[-1].split(".")[0]
@@ -91,7 +91,7 @@ def get_latest_fileversions(glob_list_path: list[str]) -> list[str]:
9191
latest_files = get_latest_fileversions(all_files)
9292
"""
9393
# Extract unique base names by splitting before the version part
94-
uniques = set(file.rsplit("_v", 1)[0] for file in glob_list_path)
94+
uniques = [file.rsplit("_v", 1)[0] for file in glob_list_path]
9595
result = []
9696

9797
for unique in uniques:
@@ -117,7 +117,7 @@ def get_latest_fileversions(glob_list_path: list[str]) -> list[str]:
117117
# Sort the collected entries by version number and get the latest one
118118
if unique_sorter:
119119
latest_entry = max(unique_sorter, key=lambda x: x[0])[1]
120-
logger.info(f"Choosing: {latest_entry.rsplit('/', 1)[-1]}")
120+
logger.info(f"Latest version(s): {latest_entry.rsplit('/', 1)[-1]}")
121121
result.append(latest_entry)
122122

123123
return result

0 commit comments

Comments
 (0)