Skip to content

Commit

Permalink
Reverse direction of dependencies when determining target packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Jun 2, 2017
1 parent 85fd45a commit 78b8271
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test_utils/scripts/get_target_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
'speech': {'storage'},
'vision': {'storage'},
}
REVERSE_DEPS = {}
for pkg, deps in PKG_DEPENDENCIES.items():
for dep in deps:
REVERSE_DEPS.setdefault(dep, set()).add(pkg)
del pkg, deps


def get_baseline():
Expand Down Expand Up @@ -147,7 +152,7 @@ def get_changed_packages(file_list):
# Add the package, as well as any dependencies this package has.
# NOTE: For now, dependencies only go down one level.
answer.add(package)
answer = answer.union(PKG_DEPENDENCIES.get(package, set()))
answer = answer.union(REVERSE_DEPS.get(package, set()))

# We got this far without being short-circuited; return the final answer.
return answer
Expand Down

0 comments on commit 78b8271

Please sign in to comment.