GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing peps.python.org — PEP 425 – Compatibility Tags for Built Distributions | peps.python.org
PEP 425 – Compatibility Tags for Built Distributions
PEP 425 – Compatibility Tags for Built Distributions
Important This PEP is a historical document. The up-to-date, canonical spec, Platform compatibility tags, is maintained on the PyPA specs page. × See the PyPA specification update process for how to propose changes. AbstractThis PEP specifies a tagging system to indicate with which versions of Python a built or binary distribution is compatible. A set of three tags indicate which Python implementation and language version, ABI, and platform a built distribution requires. The tags are terse because they will be included in filenames. PEP AcceptanceThis PEP was accepted by Alyssa Coghlan on 17th February, 2013. RationaleToday “python setup.py bdist” generates the same filename on PyPy and CPython, but an incompatible archive, making it inconvenient to share built distributions in the same folder or index. Instead, built distributions should have a file naming convention that includes enough information to decide whether or not a particular archive is compatible with a particular implementation. Previous efforts come from a time where CPython was the only important implementation and the ABI was the same as the Python language release. This specification improves upon the older schemes by including the Python implementation, language version, ABI, and platform as a set of tags. By comparing the tags it supports with the tags listed by the distribution, an installer can make an educated decision about whether to download a particular built distribution without having to read its full metadata. OverviewThe tag format is {python tag}-{abi tag}-{platform tag}
For example, the tag py27-none-any indicates compatible with Python 2.7 (any Python 2.7 implementation) with no abi requirement, on any platform. UseThe DetailsPython TagThe Python tag indicates the implementation and version required by a distribution. Major implementations have abbreviated codes, initially:
Other Python implementations should use The version is The version can be just the major version Importantly, major-version-only tags like A single-source Python 2/3 compatible distribution can use the compound
tag ABI TagThe ABI tag indicates which Python ABI is required by any included
extension modules. For implementation-specific ABIs, the implementation
is abbreviated in the same way as the Python Tag, e.g. The CPython stable ABI is Implementations with a very unstable ABI may use the first 6 bytes (as 8 base64-encoded characters) of the SHA-256 hash of their source code revision and compiler flags, etc, but will probably not have a great need to distribute binary distributions. Each implementation’s community may decide how to best use the ABI tag. Platform TagThe platform tag is simply
UseThe tags are used by installers to decide which built distribution
(if any) to download from a list of potential built distributions.
The installer maintains a list of (pyver, abi, arch) tuples that it
will support. If the built distribution’s tag is It is recommended that installers try to choose the most feature complete
built distribution available (the one most specific to the installation
environment) by default before falling back to pure Python versions
published for older Python releases. Installers are also recommended to
provide a way to configure and re-order the list of allowed compatibility
tags; for example, a user might accept only the Another desirable installer feature might be to include “re-compile from source if possible” as more preferable than some of the compatible but legacy pre-built options. This example list is for an installer running under CPython 3.3 on a linux_x86_64 system. It is in order from most-preferred (a distribution with a compiled extension module, built for the current version of Python) to least-preferred (a pure-Python distribution built with an older version of Python):
Sometimes there will be more than one supported built distribution for a
particular version of a package. For example, a packager could release
a package tagged Compressed Tag SetsTo allow for compact filenames of bdists that work with more than
one compatibility tag triple, each tag in a filename can instead be a
‘.’-separated, sorted, set of tags. For example, pip, a pure-Python
package that is written to run under Python 2 and 3 with the same source
code, could distribute a bdist with the tag for x in pytag.split('.'): for y in abitag.split('.'): for z in archtag.split('.'): yield '-'.join((x, y, z)) A bdist format that implements this scheme should include the expanded tags in bdist-specific metadata. This compression scheme can generate large numbers of unsupported tags and “impossible” tags that are supported by no Python implementation e.g. “cp33-cp31u-win64”, so use it sparingly. FAQ
References[1] Egg Filename-Embedded Metadata (http://peak.telecommunity.com/DevCenter/EggFormats#filename-embedded-metadata) [2] Creating Built Distributions (https://docs.python.org/3.4/distutils/builtdist.html) AcknowledgementsThe author thanks Paul Moore, Alyssa Coghlan, Marc Abramowitz, and Mr. Michele Lacchia for their valuable help and advice. CopyrightThis document has been placed in the public domain. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |