@@ -1146,43 +1146,31 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
1146
1146
}
1147
1147
CompatibleDist :: CompatibleWheel { wheel, .. } => wheel. file . requires_python . as_ref ( ) ,
1148
1148
} ?;
1149
- if python_requirement. installed ( ) == python_requirement. target ( ) {
1150
- if !python_requirement
1151
- . installed ( )
1152
- . is_contained_by ( requires_python)
1153
- {
1154
- return if matches ! ( dist, CompatibleDist :: CompatibleWheel { .. } ) {
1155
- Some ( IncompatibleDist :: Wheel ( IncompatibleWheel :: RequiresPython (
1156
- requires_python. clone ( ) ,
1157
- PythonRequirementKind :: Installed ,
1158
- ) ) )
1159
- } else {
1160
- Some ( IncompatibleDist :: Source (
1161
- IncompatibleSource :: RequiresPython (
1162
- requires_python. clone ( ) ,
1163
- PythonRequirementKind :: Installed ,
1164
- ) ,
1165
- ) )
1166
- } ;
1167
- }
1149
+ if python_requirement. target ( ) . is_contained_by ( requires_python) {
1150
+ None
1168
1151
} else {
1169
- if !python_requirement. target ( ) . is_contained_by ( requires_python) {
1170
- return if matches ! ( dist, CompatibleDist :: CompatibleWheel { .. } ) {
1171
- Some ( IncompatibleDist :: Wheel ( IncompatibleWheel :: RequiresPython (
1152
+ if matches ! ( dist, CompatibleDist :: CompatibleWheel { .. } ) {
1153
+ Some ( IncompatibleDist :: Wheel ( IncompatibleWheel :: RequiresPython (
1154
+ requires_python. clone ( ) ,
1155
+ if python_requirement. installed ( ) == python_requirement. target ( ) {
1156
+ PythonRequirementKind :: Installed
1157
+ } else {
1158
+ PythonRequirementKind :: Target
1159
+ } ,
1160
+ ) ) )
1161
+ } else {
1162
+ Some ( IncompatibleDist :: Source (
1163
+ IncompatibleSource :: RequiresPython (
1172
1164
requires_python. clone ( ) ,
1173
- PythonRequirementKind :: Target ,
1174
- ) ) )
1175
- } else {
1176
- Some ( IncompatibleDist :: Source (
1177
- IncompatibleSource :: RequiresPython (
1178
- requires_python. clone ( ) ,
1179
- PythonRequirementKind :: Target ,
1180
- ) ,
1181
- ) )
1182
- } ;
1165
+ if python_requirement. installed ( ) == python_requirement. target ( ) {
1166
+ PythonRequirementKind :: Installed
1167
+ } else {
1168
+ PythonRequirementKind :: Target
1169
+ } ,
1170
+ ) ,
1171
+ ) )
1183
1172
}
1184
1173
}
1185
- None
1186
1174
}
1187
1175
1188
1176
/// Given a candidate package and version, return its dependencies.
0 commit comments