Skip to content

Commit 21c5bac

Browse files
committed
support glob patterns in artifact lists
1 parent f1c60f0 commit 21c5bac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/seml/utils/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,12 @@ def drop_typeddict_difference(obj: TD1, cls: type[TD1], cls2: type[TD2]) -> TD2:
791791

792792

793793
def recursively_list_files(path: Path | str) -> set[Path]:
794-
"""Recursively lists all (resolved) files in the directory."""
794+
"""Recursively lists all (resolved) files in the directory.
795+
796+
Also supports `glob` patterns.
797+
"""
798+
if any(c in str(path) for c in '*?[]'):
799+
return {p.expanduser() for p in Path().rglob(str(path))}
795800
path = Path(path)
796801
if path.expanduser().resolve().is_file():
797802
return {path.expanduser().resolve()}

0 commit comments

Comments
 (0)