Skip to content

Feature/directed graph#9

Merged
allRisc merged 4 commits into
mainfrom
feature/directedGraph
Apr 15, 2026
Merged

Feature/directed graph#9
allRisc merged 4 commits into
mainfrom
feature/directedGraph

Conversation

@allRisc
Copy link
Copy Markdown
Member

@allRisc allRisc commented Apr 15, 2026

Changed the output of the resolution algorithm to a directed graph which enables dependency order tracking.

Ben Davis and others added 4 commits April 15, 2026 11:28
resolve() previously returned a plain dict, discarding the dependency
graph that resolvelib computed. Callers like _create_library_filelist()
had to rebuild the graph by re-reading manifests from disk.

ResolveResult now wraps the mapping with a graph (dict[str, set[str]])
and the set of direct dependencies, while providing dict-like
convenience methods for backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move topological sort logic into ResolveResult so users can get
dependency-ordered package names directly. Remove the private
_topological_sort from install.py in favor of the new public method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 14 tests covering the dict-like interface and topological ordering.
The tests caught a bug in topological_order() which was producing
dependents-first instead of dependencies-first order. Fixed by
reversing the traversal direction in Kahn's algorithm.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@allRisc allRisc merged commit 3e4c14c into main Apr 15, 2026
4 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.

1 participant