-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scenarios: add tests involving "local" versions
None of these currently pass on `uv pip install` but they all should. (Or at least, I believe they all work with `pip install`.)
- Loading branch information
1 parent
c5b8ccf
commit 99c2356
Showing
1 changed file
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
[ | ||
{ | ||
"name": "local-simple", | ||
"description": "A simple version constraint should not exclude published versions with local segments.", | ||
"root": { | ||
"requires": [ | ||
"a==1.2.3" | ||
] | ||
}, | ||
"packages": { | ||
"a": { | ||
"versions": { | ||
"1.2.3+foo": {} | ||
} | ||
} | ||
}, | ||
"expected": { | ||
"satisfiable": true, | ||
"packages": { | ||
"a": "1.2.3+foo" | ||
}, | ||
"explanation": "The verison '1.2.3+foo' satisfies the constraint '==1.2.3'." | ||
} | ||
}, | ||
{ | ||
"name": "local-not-used-with-sdist", | ||
"description": "If there is a 1.2.3 version with an sdist published and no compatible wheels, then the sdist will be used.", | ||
"root": { | ||
"requires": [ | ||
"a==1.2.3" | ||
] | ||
}, | ||
"packages": { | ||
"a": { | ||
"versions": { | ||
"1.2.3": { | ||
"wheel_tags": [ | ||
"py3-any-macosx_10_0_ppc64" | ||
], | ||
"sdist": true | ||
}, | ||
"1.2.3+foo": {} | ||
} | ||
} | ||
}, | ||
"expected": { | ||
"satisfiable": true, | ||
"packages": { | ||
"a": "1.2.3" | ||
}, | ||
"explanation": "The verison '1.2.3' with an sdist satisfies the constraint '==1.2.3'." | ||
} | ||
}, | ||
{ | ||
"name": "local-used-without-sdist", | ||
"description": "Even if there is a 1.2.3 version published, if it is unavailable for some reason (no sdist and no compatible wheels in this case), a 1.2.3 version with a local segment should be usable instead.", | ||
"root": { | ||
"requires": [ | ||
"a==1.2.3" | ||
] | ||
}, | ||
"packages": { | ||
"a": { | ||
"versions": { | ||
"1.2.3": { | ||
"wheel_tags": [ | ||
"py3-any-macosx_10_0_ppc64" | ||
], | ||
"sdist": false | ||
}, | ||
"1.2.3+foo": {} | ||
} | ||
} | ||
}, | ||
"expected": { | ||
"satisfiable": true, | ||
"packages": { | ||
"a": "1.2.3+foo" | ||
}, | ||
"explanation": "The verison '1.2.3+foo' satisfies the constraint '==1.2.3'." | ||
} | ||
}, | ||
{ | ||
"name": "local-not-latest", | ||
"description": "Tests that we can select an older version with a local segment when newer versions are incompatible.", | ||
"root": { | ||
"requires": [ | ||
"a>=1" | ||
] | ||
}, | ||
"packages": { | ||
"a": { | ||
"versions": { | ||
"1.2.3": { | ||
"wheel_tags": [ | ||
"py3-any-macosx_10_0_ppc64" | ||
], | ||
"sdist": false | ||
}, | ||
"1.2.2+foo": { | ||
"wheel_tags": [ | ||
"py3-any-macosx_10_0_ppc64" | ||
], | ||
"sdist": false | ||
}, | ||
"1.2.1+foo": { | ||
"sdist": true | ||
} | ||
} | ||
} | ||
}, | ||
"expected": { | ||
"satisfiable": true, | ||
"packages": { | ||
"a": "1.2.1+foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "local-transitive", | ||
"description": "A simple version constraint should not exclude published versions with local segments.", | ||
"root": { | ||
"requires": [ | ||
"a", | ||
"b==2.0.0+foo" | ||
] | ||
}, | ||
"packages": { | ||
"a": { | ||
"versions": { | ||
"1.0.0": { | ||
"requires": [ | ||
"b==2.0.0" | ||
] | ||
} | ||
} | ||
}, | ||
"b": { | ||
"versions": { | ||
"2.0.0+foo": {} | ||
} | ||
} | ||
}, | ||
"expected": { | ||
"satisfiable": true, | ||
"packages": { | ||
"a": "1.0.0", | ||
"b": "2.0.0+foo" | ||
}, | ||
"explanation": "The verison '2.0.0+foo' satisfies both ==2.0.0 and ==2.0.0+foo." | ||
} | ||
}, | ||
{ | ||
"name": "local-transitive-confounding", | ||
"description": "A transitive dependency has both a non-local and local version published, but the non-local version is unuable.", | ||
"root": { | ||
"requires": [ | ||
"a" | ||
] | ||
}, | ||
"packages": { | ||
"a": { | ||
"versions": { | ||
"1.0.0": { | ||
"requires": [ | ||
"b==2.0.0" | ||
] | ||
} | ||
} | ||
}, | ||
"b": { | ||
"versions": { | ||
"2.0.0": { | ||
"wheel_tags": [ | ||
"py3-any-macosx_10_0_ppc64" | ||
], | ||
"sdist": false | ||
}, | ||
"2.0.0+foo": {} | ||
} | ||
} | ||
}, | ||
"expected": { | ||
"satisfiable": true, | ||
"packages": { | ||
"a": "2.0.0+foo" | ||
}, | ||
"explanation": "The verison '1.2.3+foo' satisfies the constraint '==1.2.3'." | ||
} | ||
} | ||
] |