Skip to content

Commit

Permalink
Fix empty path inclusion, add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanzin committed Aug 28, 2023
1 parent 7c635e6 commit 4149e8b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/wily/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def build(config: WilyConfig, archiver: Archiver, operators: List[Operator]) ->

# Copy the ir from any unchanged files from the prev revision
if not seed:
# File names in result are platform dependent, so we convert
# to Path and back to str.
files = {str(pathlib.Path(f)) for f in revision.tracked_files}
missing_indices = files - indices
# TODO: Check existence of file path.
Expand All @@ -156,9 +158,13 @@ def build(config: WilyConfig, archiver: Archiver, operators: List[Operator]) ->
for deleted in revision.deleted_files:
result.pop(deleted, None)

# Add empty path for storing total aggregates
dirs = [""]
# Directory names in result are platform dependent, so we convert
# to Path and back to str.
dirs += [str(pathlib.Path(d)) for d in revision.tracked_dirs if d]
# Aggregate metrics across all root paths using the aggregate function in the metric
# Note assumption is that nested dirs are listed after parent..
dirs = {str(pathlib.Path(d)) for d in revision.tracked_dirs}
# Note assumption is that nested dirs are listed after parent, hence sorting.
for root in sorted(dirs):
# find all matching entries recursively
aggregates = [
Expand Down

0 comments on commit 4149e8b

Please sign in to comment.