Skip to content

Commit

Permalink
all notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Jul 25, 2024
1 parent e0f127f commit ac2feb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .actions/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def group_folders(
fpath_drop_folders: str = "dropped-folders.txt",
fpath_actual_dirs: Sequence[str] = tuple(),
strict: bool = True,
root_path: str = ".",
root_path: str = "",
) -> None:
"""Parsing the raw git diff and group changes by folders.
Expand All @@ -560,16 +560,21 @@ def group_folders(
--fpath_actual_dirs "['../dirs-main.txt', '../dirs-publication.txt']"
"""
dirs = []
# replace here notation with path, so later it does not fall to ignore
if root_path == ".":
root_path = os.getcwd()
# loading the generated changes with git diff
with open(fpath_gitdiff) as fopen:
changed = [ln.strip() for ln in fopen.readlines()]
dirs_changed = [os.path.dirname(ln) for ln in changed]
# in case of ay key component changed, rebuild all notebooks
if any(p_key in p_changed for p_key in (PATH_DEV_SCRIPT, PATH_DEV_REQUIREMENTS) for p_changed in dirs_changed):
dirs_changed += [p for p in os.listdir(_PATH_ROOT) if os.path.isdir(p) and p[0] not in (".", "_")]
# append a path to root in case you call this from other path then root
if root_path:
dirs_changed = [os.path.join(root_path, d) for d in dirs_changed]
# append all subfolders in case of parent requirements has been changed all related notebooks shall be updated
dirs = []
for dir in dirs_changed:
# in case that the diff item comes from removed folder
if not os.path.isdir(dir):
Expand Down

0 comments on commit ac2feb6

Please sign in to comment.