Skip to content

Commit aeda662

Browse files
dhellmannclaude
andcommitted
refactor(graph): remove dead code in extract_package_subset
Remove redundant ROOT node inclusion check in extract_package_subset function. The _collect_dependents function already handles ROOT inclusion automatically when traversing parent dependencies, making the explicit check unnecessary. This removes 7 lines of dead code while maintaining the same functionality. All tests continue to pass and ROOT is still properly included in subsets when target packages are top-level dependencies. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 672123b commit aeda662

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

src/fromager/commands/graph.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,6 @@ def extract_package_subset(
552552
for target_node in target_nodes:
553553
_collect_dependencies(target_node, related_nodes, visited_down)
554554

555-
# Always include ROOT if any target nodes are top-level dependencies
556-
for target_node in target_nodes:
557-
for parent_edge in target_node.parents:
558-
if parent_edge.destination_node.key == ROOT:
559-
related_nodes.add(ROOT)
560-
break
561-
562555
# Create new graph with only related nodes
563556
subset_graph = DependencyGraph()
564557
_build_subset_graph(graph, subset_graph, related_nodes)

0 commit comments

Comments
 (0)