File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,28 @@ def platform_to_version(platform: str) -> str:
190190 for tag in tags :
191191 if tag .abi in abis :
192192 abi_incompatible = False
193- break
193+ break
194194 if abi_incompatible :
195195 abis_string = "," .join ({tag .abi for tag in tags })
196196 raise ValueError (
197197 f"Wheel abi '{ abis_string } ' is not supported. Supported abis are 'abi3' and 'cp{ version } '."
198198 )
199+
200+ # Check interpreter compatibility
201+ current_version = int (version )
202+ for tag in tags :
203+ try :
204+ wheel_version = int (tag .interpreter .removeprefix ("cp" ))
205+ # abi3: forward compatible (wheel_version <= current_version)
206+ # non-abi3: exact match required (wheel_version == current_version)
207+ if (tag .abi == "abi3" and wheel_version <= current_version ) or \
208+ (tag .abi != "abi3" and wheel_version == current_version ):
209+ return
210+ except ValueError :
211+ continue
199212
200- raise ValueError (f"Wheel interpreter version '{ tag .interpreter } ' is not supported." )
213+ interpreters_string = "," .join ({tag .interpreter for tag in tags })
214+ raise ValueError (f"Wheel interpreter version '{ interpreters_string } ' is not supported." )
201215
202216
203217def validate_constraints (
You can’t perform that action at this time.
0 commit comments