Respect Requires-Python in universal resolution (#3998)

## Summary

Closes #3982.
This commit is contained in:
Charlie Marsh 2024-06-04 09:56:08 -04:00 committed by GitHub
parent 63c84ed4a6
commit 6afb659c9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 419 additions and 17 deletions

View file

@ -467,7 +467,7 @@ impl VersionMapLazy {
// _installed_ Python version (to build successfully)
if let Some(requires_python) = requires_python {
if let Some(target) = self.python_requirement.target() {
if !requires_python.contains(target) {
if !target.subset_of(&requires_python) {
return SourceDistCompatibility::Incompatible(
IncompatibleSource::RequiresPython(
requires_python,
@ -531,10 +531,10 @@ impl VersionMapLazy {
}
}
// Check for a Python version incompatibility`
// Check for a Python version incompatibility
if let Some(requires_python) = requires_python {
if let Some(target) = self.python_requirement.target() {
if !requires_python.contains(target) {
if !target.subset_of(&requires_python) {
return WheelCompatibility::Incompatible(IncompatibleWheel::RequiresPython(
requires_python,
PythonRequirementKind::Target,