Skip to content

Commit 869a843

Browse files
authored
Add test cases for virtual package priorities (#238)
These test cases were intended for astral-sh/uv#10935. They still test the virtual package priorities, even though they are not observable in the resolution outcome in the current resolver usage. They can be used to observe virtual package prioritization in resolver verbose mode, so I'd keep them in case we have to follow-up to astral-sh/uv#10935
1 parent 6356622 commit 869a843

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name = "marker-variants-have-different-extras"
2+
description = "Check the prioritization for virtual extra and marker packages"
3+
4+
[expected]
5+
satisfiable = true
6+
7+
[environment]
8+
python = "3.12"
9+
10+
[root]
11+
requires = [
12+
"psycopg[binary] ; platform_python_implementation != 'PyPy'",
13+
"psycopg ; platform_python_implementation == 'PyPy'",
14+
]
15+
16+
[packages.psycopg.versions."1.0.0"]
17+
requires = ['tzdata; sys_platform == "win32"']
18+
19+
[packages.psycopg.versions."1.0.0".extras]
20+
binary = ["psycopg-binary; implementation_name != 'pypy'"]
21+
22+
[packages.psycopg-binary.versions."1.0.0"]
23+
[packages.tzdata.versions."1.0.0"]
24+
25+
[resolver_options]
26+
universal = true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name = "virtual-package-extra-priorities"
2+
description = "Check the prioritization for virtual marker packages"
3+
4+
[root]
5+
requires_python = ">=3.12"
6+
requires = ["a==1; python_version >= '3.8'", "b; python_version >= '3.9'"]
7+
8+
[expected]
9+
satisfiable = true
10+
11+
[packages.a.versions."1.0.0"]
12+
requires = ["b==1 ; python_version >= '3.10'"]
13+
[packages.a.versions."2.0.0"]
14+
requires = ["b==1 ; python_version >= '3.10'"]
15+
16+
[packages.b.versions."1.0.0"]
17+
[packages.b.versions."2.0.0"]
18+
19+
[resolver_options]
20+
universal = true
21+
22+
[environment]
23+
python = "3.12"

0 commit comments

Comments
 (0)