The documentation says that Python Wheel is a binary distribution format. To understand the difference between the source code and binaries distributed within a Python wheel, I am manually inspecting a .whl file from the package django. The specific .whl I am looking at is this. I decompressed the wheel file and the top-level directory of the file looks like this:
.
├── Django-3.2.9.data
├── Django-3.2.9.dist-info
└── django
The Django-3.2.9.data file contains a script called admin.py. The directory structure for Django-3.2.9.dist-info looks like this:
.
├── AUTHORS
├── LICENSE
├── LICENSE.python
├── METADATA
├── RECORD
├── WHEEL
├── entry_points.txt
└── top_level.txt
The WHEEL file in this directory seems to contain information of the WHEEL version that was used to build this .whl.
The top-level directory structure for the django file looks like this:
.
├── __init__.py
├── __main__.py
├── apps
├── bin
├── conf
├── contrib
├── core
├── db
├── dispatch
├── forms
├── http
├── middleware
├── shortcuts.py
├── template
├── templatetags
├── test
├── urls
├── utils
└── views
Here, except the bin folder, all the other files are source code files that are present on the django repository. Therefore, my guess was that the bin folder would contain binaries of the package. However, the folder only contains another python file named django-admin.py.
Therefore, my question is:
(1) Does python wheel actually contain a binary? If yes, then how to locate the binary within the .whl file?
(2) If the python wheel distributes a binary, then how does wheel distribution ensure that the binary is built from the same source code present in the .whl file? For this question, my guess is the source-to-binary integrity is ensured through checksums for each file stored in the Django-3.2.9.dist-info/RECORD file. Is that correct?