Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 652d844

Browse files
committedMar 25, 2025·
Order dependants such that the project is on top
1 parent 713aef3 commit 652d844

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎crates/uv-resolver/src/lock/requirements_txt.rs

+7
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ impl<'lock> RequirementsTxtExport<'lock> {
316316
marker: reachability.remove(&index).unwrap_or_default(),
317317
dependents: graph
318318
.edges_directed(index, Direction::Incoming)
319+
.sorted_by_key(|edge| {
320+
graph
321+
.neighbors_directed(edge.source(), Direction::Incoming)
322+
.filter(|&node| node == root)
323+
.count()
324+
== 0
325+
})
319326
.filter_map(|edge| {
320327
let src = edge.source();
321328
if src == root {

‎crates/uv/tests/it/export.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2961,12 +2961,12 @@ fn complex_conflict_markers() -> Result<()> {
29612961
# via torch
29622962
torch==2.6.0 ; sys_platform == 'darwin'
29632963
# via
2964-
# torchvision
29652964
# project
2965+
# torchvision
29662966
torch==2.6.0+cpu ; sys_platform != 'darwin'
29672967
# via
2968-
# torchvision
29692968
# project
2969+
# torchvision
29702970
torchvision==0.21.0 ; (platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'
29712971
# via project
29722972
torchvision==0.21.0+cpu ; (platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')

0 commit comments

Comments
 (0)
Please sign in to comment.