Skip to content

Commit

Permalink
scenarios: add test ensuring sibling dependencies get filtered in a fork
Browse files Browse the repository at this point in the history
This test is a reproduction of the issue observed in
astral-sh/uv#4414, but "minimized" to a packse
scenario.
  • Loading branch information
BurntSushi committed Jun 19, 2024
1 parent 0954dc3 commit 84c02c6
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions scenarios/fork/filter-sibling-dependencies.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name = "fork-filter-sibling-dependencies"
description = '''
This tests that sibling dependencies of a package that provokes a
fork are correctly filtered out of forks where they are otherwise
impossible.
In this case, a previous version of the universal resolver would
include both `b` and `c` in *both* of the forks produced by the
conflicting dependency specifications on `a`. This in turn led to
transitive dependency specifications on both `d==1.0.0` and `d==2.0.0`.
Since the universal resolver only forks based on local conditions, this
led to a failed resolution.
The correct thing to do here is to ensure that `b` is only part of the
`a==4.4.0` fork and `c` is only par of the `a==4.3.0` fork.
'''

[resolver_options]
universal = true

[expected]
satisfiable = true

[root]
requires = [
"a==4.4.0 ; sys_platform == 'linux'",
"a==4.3.0 ; sys_platform == 'darwin'",
"b==1.0.0 ; sys_platform == 'linux'",
"c==1.0.0 ; sys_platform == 'darwin'",
]

[packages.a.versions."4.3.0"]
[packages.a.versions."4.4.0"]
[packages.b.versions."1.0.0"]
requires = ["d==1.0.0"]
[packages.c.versions."1.0.0"]
requires = ["d==2.0.0"]
[packages.d.versions."1.0.0"]
[packages.d.versions."2.0.0"]

0 comments on commit 84c02c6

Please sign in to comment.