|
9 | 9 | import sysconfig
|
10 | 10 | import warnings
|
11 | 11 |
|
12 |
| -from pip._vendor.packaging.tags import Tag, mac_platforms |
| 12 | +from pip._vendor.packaging.tags import Tag, compatible_tags, mac_platforms |
13 | 13 |
|
14 | 14 | import pip._internal.utils.glibc
|
15 | 15 | from pip._internal.utils.compat import get_extension_suffixes
|
@@ -369,22 +369,26 @@ def get_supported(
|
369 | 369 | ("%s%s" % (impl, other_version), abi, arch)
|
370 | 370 | )
|
371 | 371 |
|
372 |
| - # Has binaries, does not use the Python API: |
373 |
| - for arch in arches: |
374 |
| - supported.append(('py%s' % (current_version[0]), 'none', arch)) |
| 372 | + if len(current_version) == 1: |
| 373 | + # XXX: Fake minor version to satisfy requirements of current interface. |
| 374 | + python_version = (int(current_version[0]), 9) |
| 375 | + else: |
| 376 | + python_version = int(current_version[0]), int(current_version[1:]) |
375 | 377 |
|
376 |
| - # No abi / arch, but requires our implementation: |
377 |
| - supported.append(('%s%s' % (impl, current_version), 'none', 'any')) |
| 378 | + interpreter = "{}{}".format(impl, current_version) |
378 | 379 |
|
379 |
| - # No abi / arch, generic Python |
380 |
| - supported.append(('py%s' % (current_version,), 'none', 'any')) |
381 |
| - supported.append(('py%s' % (current_version[0]), 'none', 'any')) |
382 |
| - for other_version in other_versions: |
383 |
| - supported.append( |
384 |
| - ('py%s' % (other_version,), 'none', 'any') |
| 380 | + supported.extend( |
| 381 | + compatible_tags( |
| 382 | + python_version=python_version, |
| 383 | + interpreter=interpreter, |
| 384 | + platforms=arches, |
385 | 385 | )
|
| 386 | + ) |
386 | 387 |
|
387 |
| - return [Tag(*parts) for parts in supported] |
| 388 | + return [ |
| 389 | + Tag(*parts) if not isinstance(parts, Tag) else parts |
| 390 | + for parts in supported |
| 391 | + ] |
388 | 392 |
|
389 | 393 |
|
390 | 394 | implementation_tag = get_impl_tag()
|
0 commit comments