|
303 | 303 |
|
304 | 304 | The tags are used by installers to decide which built distribution |
305 | 305 | (if any) to download from a list of potential built distributions. |
306 | | -The installer maintains a list of (pyver, abi, arch) tuples that it |
307 | | -will support. If the built distribution's tag is ``in`` the list, then |
308 | | -it can be installed. |
| 306 | +The installer maintains an ordered list of tags supported by the target |
| 307 | +environment. A wheel is tag-compatible if at least one of its tags appears in |
| 308 | +that list. A matching tag does not by itself guarantee installation: the |
| 309 | +installer can also consider metadata such as ``Requires-Python``. |
309 | 310 |
|
310 | 311 | It is recommended that installers try to choose the most feature complete |
311 | 312 | built distribution available (the one most specific to the installation |
@@ -348,9 +349,24 @@ Sometimes there will be more than one supported built distribution for a |
348 | 349 | particular version of a package. For example, a packager could release |
349 | 350 | a package tagged ``cp33-abi3-linux_x86_64`` that contains an optional C |
350 | 351 | extension and the same distribution tagged ``py3-none-any`` that does not. |
351 | | -The index of the tag in the supported tags list breaks the tie, and the |
352 | | -package with the C extension is installed in preference to the package |
353 | | -without because that tag appears first in the list. |
| 352 | +When otherwise equivalent wheels both match, the wheel with the earliest |
| 353 | +matching tag in the supported list is preferred. This compares each wheel's |
| 354 | +best match, not the order of the tags in its filename. |
| 355 | + |
| 356 | +The CPython 3.3 list above is historical. To see the first few supported |
| 357 | +tags for the interpreter you are running, use |
| 358 | +`packaging.tags.sys_tags() <https://packaging.pypa.io/en/stable/tags.html#packaging.tags.sys_tags>`_: |
| 359 | + |
| 360 | +.. code-block:: python |
| 361 | +
|
| 362 | + from itertools import islice |
| 363 | +
|
| 364 | + from packaging.tags import sys_tags |
| 365 | +
|
| 366 | + for tag in islice(sys_tags(), 5): |
| 367 | + print(tag) |
| 368 | +
|
| 369 | +The output depends on the Python implementation, ABI, and platform. |
354 | 370 |
|
355 | 371 | Compressed Tag Sets |
356 | 372 | =================== |
|
0 commit comments