1313from fromager import dependency_graph
1414from fromager .commands .graph import (
1515 _compute_collection_impact ,
16+ _find_common_dependencies_impl ,
1617 _find_customized_dependencies_for_node ,
1718 _find_shared_packages ,
1819 _get_collection_packages ,
19- _suggest_base_impl ,
2020 find_why ,
2121 show_explain_duplicates ,
2222)
@@ -561,14 +561,14 @@ def test_find_shared_packages_sorting() -> None:
561561# ---------------------------------------------------------------------------
562562
563563
564- def test_suggest_base_table_output (
564+ def test_find_common_dependencies_table_output (
565565 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
566566) -> None :
567- """suggest_base command produces table output with key strings."""
567+ """find_common_dependencies command produces table output with key strings."""
568568 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-shared" , "pkg-only-a" ])
569569 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-only-b" ])
570570
571- _suggest_base_impl (
571+ _find_common_dependencies_impl (
572572 collection_graphs = (path_a , path_b ),
573573 base_graph = None ,
574574 min_collections = 2 ,
@@ -584,7 +584,7 @@ def test_suggest_base_table_output(
584584 assert "pkg-only-b" in captured .out
585585
586586
587- def test_suggest_base_dynamic_default_min_collections (
587+ def test_find_common_dependencies_dynamic_default_min_collections (
588588 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
589589) -> None :
590590 """Default --min-collections is 50% of provided graphs (rounded up)."""
@@ -595,7 +595,7 @@ def test_suggest_base_dynamic_default_min_collections(
595595 path_c = _make_graph_file (tmp_path , "coll-c" , ["pkg-shared-abc" ])
596596 path_d = _make_graph_file (tmp_path , "coll-d" , ["pkg-only-d" ])
597597
598- _suggest_base_impl (
598+ _find_common_dependencies_impl (
599599 collection_graphs = (path_a , path_b , path_c , path_d ),
600600 base_graph = None ,
601601 min_collections = None , # dynamic default: ceil(4/2) = 2
@@ -611,14 +611,14 @@ def test_suggest_base_dynamic_default_min_collections(
611611 assert "pkg-only-d" not in packages
612612
613613
614- def test_suggest_base_json_output (
614+ def test_find_common_dependencies_json_output (
615615 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
616616) -> None :
617- """suggest_base command produces valid JSON output."""
617+ """find_common_dependencies command produces valid JSON output."""
618618 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-shared" , "pkg-only-a" ])
619619 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-only-b" ])
620620
621- _suggest_base_impl (
621+ _find_common_dependencies_impl (
622622 collection_graphs = (path_a , path_b ),
623623 base_graph = None ,
624624 min_collections = 2 ,
@@ -641,15 +641,15 @@ def test_suggest_base_json_output(
641641 assert "in_base" not in candidate
642642
643643
644- def test_suggest_base_with_base_graph (
644+ def test_find_common_dependencies_with_base_graph (
645645 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
646646) -> None :
647647 """--base flag marks packages that are already in the base graph."""
648648 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-shared" , "pkg-new" ])
649649 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-new" ])
650650 path_base = _make_graph_file (tmp_path , "base" , ["pkg-shared" ])
651651
652- _suggest_base_impl (
652+ _find_common_dependencies_impl (
653653 collection_graphs = (path_a , path_b ),
654654 base_graph = path_base ,
655655 min_collections = 2 ,
@@ -664,42 +664,44 @@ def test_suggest_base_with_base_graph(
664664 assert data ["metadata" ]["base_graph" ] == str (path_base )
665665
666666
667- def test_suggest_base_too_few_graphs (tmp_path : pathlib .Path ) -> None :
667+ def test_find_common_dependencies_too_few_graphs (tmp_path : pathlib .Path ) -> None :
668668 """Error raised when fewer than 2 graphs are provided."""
669669 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-a" ])
670670
671671 with pytest .raises (click .UsageError , match = "At least 2 collection graphs" ):
672- _suggest_base_impl (
672+ _find_common_dependencies_impl (
673673 collection_graphs = (path_a ,),
674674 base_graph = None ,
675675 min_collections = 2 ,
676676 output_format = "table" ,
677677 )
678678
679679
680- def test_suggest_base_invalid_min_collections (tmp_path : pathlib .Path ) -> None :
680+ def test_find_common_dependencies_invalid_min_collections (
681+ tmp_path : pathlib .Path ,
682+ ) -> None :
681683 """Error raised when --min-collections exceeds number of graphs."""
682684 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-a" ])
683685 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-b" ])
684686
685687 with pytest .raises (click .UsageError , match = "cannot exceed number of graphs" ):
686- _suggest_base_impl (
688+ _find_common_dependencies_impl (
687689 collection_graphs = (path_a , path_b ),
688690 base_graph = None ,
689691 min_collections = 3 ,
690692 output_format = "table" ,
691693 )
692694
693695
694- def test_suggest_base_all_but_one_empty (tmp_path : pathlib .Path ) -> None :
696+ def test_find_common_dependencies_all_but_one_empty (tmp_path : pathlib .Path ) -> None :
695697 """Error raised when all but one graph are empty after filtering."""
696698 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-a" ])
697699 path_b = _make_graph_file (tmp_path , "coll-b" , [])
698700
699701 with pytest .raises (
700702 click .UsageError , match = "At least 2 non-empty collection graphs"
701703 ):
702- _suggest_base_impl (
704+ _find_common_dependencies_impl (
703705 collection_graphs = (path_a , path_b ),
704706 base_graph = None ,
705707 min_collections = 2 ,
@@ -776,14 +778,14 @@ def test_compute_collection_impact_sorting() -> None:
776778 assert result [2 ]["collection" ] == "coll-m"
777779
778780
779- def test_suggest_base_table_includes_impact (
781+ def test_find_common_dependencies_table_includes_impact (
780782 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
781783) -> None :
782784 """Table output includes Collection Impact section."""
783785 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-shared" , "pkg-only-a" ])
784786 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-only-b" ])
785787
786- _suggest_base_impl (
788+ _find_common_dependencies_impl (
787789 collection_graphs = (path_a , path_b ),
788790 base_graph = None ,
789791 min_collections = 2 ,
@@ -800,14 +802,14 @@ def test_suggest_base_table_includes_impact(
800802 assert "Remaining Packages (not in proposed" in captured .out
801803
802804
803- def test_suggest_base_json_includes_impact (
805+ def test_find_common_dependencies_json_includes_impact (
804806 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
805807) -> None :
806808 """JSON output includes collection_impact key with correct structure."""
807809 path_a = _make_graph_file (tmp_path , "coll-a" , ["pkg-shared" , "pkg-only-a" ])
808810 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-only-b" ])
809811
810- _suggest_base_impl (
812+ _find_common_dependencies_impl (
811813 collection_graphs = (path_a , path_b ),
812814 base_graph = None ,
813815 min_collections = 2 ,
@@ -831,7 +833,7 @@ def test_suggest_base_json_includes_impact(
831833 assert len (entry ["remaining" ]) == 1
832834
833835
834- def test_suggest_base_json_base_only_packages (
836+ def test_find_common_dependencies_json_base_only_packages (
835837 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
836838) -> None :
837839 """Packages in --base that are not candidates appear in base_only_packages."""
@@ -840,7 +842,7 @@ def test_suggest_base_json_base_only_packages(
840842 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-only-b" ])
841843 path_base = _make_graph_file (tmp_path , "base" , ["pkg-shared" , "pkg-base-only" ])
842844
843- _suggest_base_impl (
845+ _find_common_dependencies_impl (
844846 collection_graphs = (path_a , path_b ),
845847 base_graph = path_base ,
846848 min_collections = 2 ,
@@ -857,7 +859,7 @@ def test_suggest_base_json_base_only_packages(
857859 assert "pkg-shared" not in data ["base_only_packages" ]
858860
859861
860- def test_suggest_base_json_base_only_impacts_collection_impact (
862+ def test_find_common_dependencies_json_base_only_impacts_collection_impact (
861863 capsys : pytest .CaptureFixture [str ], tmp_path : pathlib .Path
862864) -> None :
863865 """Base-only packages count toward collection impact when --base is provided."""
@@ -868,7 +870,7 @@ def test_suggest_base_json_base_only_impacts_collection_impact(
868870 path_b = _make_graph_file (tmp_path , "coll-b" , ["pkg-shared" , "pkg-only-b" ])
869871 path_base = _make_graph_file (tmp_path , "base" , ["pkg-shared" , "pkg-base-only" ])
870872
871- _suggest_base_impl (
873+ _find_common_dependencies_impl (
872874 collection_graphs = (path_a , path_b ),
873875 base_graph = path_base ,
874876 min_collections = 2 ,
0 commit comments