1+ .. highlight :: text
12
23.. _binary-distribution-format :
34
45==========================
56Binary distribution format
67==========================
78
8- The binary distribution format (:term: `wheel <Wheel> `) was originally defined
9- in :pep: `427 `. The current version of the specification is here.
10-
11-
12- Abstract
13- ========
14-
15- This PEP describes a built-package format for Python called "wheel".
9+ This page specifies the binary distribution format for Python packages,
10+ also called the wheel format.
1611
1712A wheel is a ZIP-format archive with a specially formatted file name and
1813the ``.whl `` extension. It contains a single distribution nearly as it
@@ -23,31 +18,6 @@ may be installed by simply unpacking into site-packages with the standard
2318out onto their final paths at any later time.
2419
2520
26- PEP Acceptance
27- ==============
28-
29- This PEP was accepted, and the defined wheel version updated to 1.0, by
30- Nick Coghlan on 16th February, 2013 [1 ]_
31-
32-
33- Rationale
34- =========
35-
36- Python needs a package format that is easier to install than sdist.
37- Python's sdist packages are defined by and require the distutils and
38- setuptools build systems, running arbitrary code to build-and-install,
39- and re-compile, code just so it can be installed into a new
40- virtualenv. This system of conflating build-install is slow, hard to
41- maintain, and hinders innovation in both build systems and installers.
42-
43- Wheel attempts to remedy these problems by providing a simpler
44- interface between the build system and the installer. The wheel
45- binary package format frees installers from having to know about the
46- build system, saves time by amortizing compile time over many
47- installations, and removes the need to install a build system in the
48- target environment.
49-
50-
5121Details
5222=======
5323
@@ -316,7 +286,9 @@ or the installation will fail.
316286If JSON web signatures are used, one or more JSON Web Signature JSON
317287Serialization (JWS-JS) signatures is stored in a file RECORD.jws adjacent
318288to RECORD. JWS is used to sign RECORD by including the SHA-256 hash of
319- RECORD as the signature's JSON payload::
289+ RECORD as the signature's JSON payload:
290+
291+ .. code-block :: json
320292
321293 { "hash" : " sha256=ADD-r2urObZHcxBW3Cr-vDCu5RJwT4CaRTHiFmbcIYY" }
322294
338310- https://datatracker.ietf.org/doc/html/draft-jones-jose-json-private-key-01
339311
340312
341- Comparison to .egg
342- ------------------
343-
344- #. Wheel is an installation format; egg is importable. Wheel archives
345- do not need to include .pyc and are less tied to a specific Python
346- version or implementation. Wheel can install (pure Python) packages
347- built with previous versions of Python so you don't always have to
348- wait for the packager to catch up.
349- #. Wheel uses .dist-info directories; egg uses .egg-info. Wheel is
350- compatible with the new world of Python packaging and the new
351- concepts it brings.
352- #. Wheel has a richer file naming convention for today's
353- multi-implementation world. A single wheel archive can indicate
354- its compatibility with a number of Python language versions and
355- implementations, ABIs, and system architectures. Historically the
356- ABI has been specific to a CPython release, wheel is ready for the
357- stable ABI.
358- #. Wheel is lossless. The first wheel implementation bdist_wheel
359- always generates egg-info, and then converts it to a .whl. It is
360- also possible to convert existing eggs and bdist_wininst
361- distributions.
362- #. Wheel is versioned. Every wheel file contains the version of the
363- wheel specification and the implementation that packaged it.
364- Hopefully the next migration can simply be to Wheel 2.0.
365- #. Wheel is a reference to the other Python.
366-
367-
368313FAQ
369314===
370315
@@ -469,20 +414,16 @@ Is it possible to import Python code directly from a wheel file?
469414 aware that many projects will require a failure to be reproduced with
470415 a fully installed package before accepting it as a genuine bug.
471416
472- Changes
473- =======
474417
475- Since :pep: `427 `, this specification has changed as follows:
476-
477- - The rules on escaping in wheel filenames were revised, to bring them into line
478- with what popular tools actually do (February 2021).
418+ History
419+ =======
479420
421+ This specification was originally approved as :pep: `427 `.
480422
481- References
482- ==========
423+ The following changes were applied since the initial version:
483424
484- .. [ 1 ] PEP acceptance
485- (https://mail.python.org/pipermail/python-dev/2013- February/124103.html)
425+ - The rules on escaping in wheel filenames were revised, to bring them
426+ into line with what popular tools actually do ( February 2021).
486427
487428
488429Appendix
@@ -499,9 +440,3 @@ Example urlsafe-base64-nopad implementation::
499440 def urlsafe_b64decode_nopad(data):
500441 pad = b'=' * (4 - (len(data) & 3))
501442 return base64.urlsafe_b64decode(data + pad)
502-
503-
504- Copyright
505- =========
506-
507- This document has been placed into the public domain.
0 commit comments