Skip to content

Conversation

@dhellmann
Copy link
Member

The graph why command is a tool for developers to understand the
dependency graph. This change improves its output to be more useful and
clearer.

The output now includes the requirement specifier from the parent package
along with the parent package name. This makes it easier to understand
not just which package is pulling in a dependency, but which version or
range of versions it requires.

The output for top-level dependencies specified on the command line or
in a requirements file is also improved to clearly label them as such.

Cycle detection is included to prevent infinite loops and make it clear
where circular dependencies exist.

@dhellmann dhellmann requested a review from a team as a code owner July 11, 2025 19:46
@dhellmann dhellmann requested a review from rd4398 July 11, 2025 19:46
The `graph why` command is a tool for developers to understand the
dependency graph. This change improves its output to be more useful and
clearer.

The output now includes the requirement specifier from the parent package
along with the parent package name. This makes it easier to understand
not just which package is pulling in a dependency, but which version or
range of versions it requires.

The output for top-level dependencies specified on the command line or
in a requirements file is also improved to clearly label them as such.

Cycle detection is included to prevent infinite loops and make it clear
where circular dependencies exist.

Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
@dhellmann dhellmann force-pushed the improve-graph-why-output branch from aac361c to 504cbf5 Compare July 11, 2025 19:47
Copy link
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@dhellmann
Copy link
Member Author

I should have included some sample output:

$ fromager graph why --depth 5 ./e2e/graph-with-dependency-conflict.json docling-parse

docling-parse==4.0.0
 * docling-parse==4.0.0 is a toplevel dependency with req docling-parse==4.0.0
 * docling-parse==4.0.0 is an install dependency of docling==2.28.4 with req docling-parse<5.0.0,>=4.0.0
   * docling==2.28.4 is a toplevel dependency with req docling==2.28.4

docling-parse==2.1.2
 * docling-parse==2.1.2 is an install dependency of instructlab-sdg==0.7.2 with req docling-parse<3.0.0,>=2.0.0
   * instructlab-sdg==0.7.2 is a toplevel dependency with req instructlab-sdg==0.7.2
   * instructlab-sdg==0.7.2 is an install dependency of instructlab==0.23.5 with req instructlab-sdg<0.8.0,>=0.7.2
     * instructlab==0.23.5 is a toplevel dependency with req instructlab[cuda]==0.23.5
 * docling-parse==2.1.2 is an install dependency of docling==2.8.3 with req docling-parse<3.0.0,>=2.0.5
   * docling==2.8.3 is an install dependency of instructlab-sdg==0.7.2 with req docling[tesserocr]<=2.8.3,>=2.4.2; sys_platform != "darwin"
     * instructlab-sdg==0.7.2 is a toplevel dependency with req instructlab-sdg==0.7.2
     * instructlab-sdg==0.7.2 is an install dependency of instructlab==0.23.5 with req instructlab-sdg<0.8.0,>=0.7.2
       * instructlab==0.23.5 is a toplevel dependency with req instructlab[cuda]==0.23.5

@mergify mergify bot merged commit 8ae931f into python-wheel-build:main Jul 11, 2025
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants