Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

344
Visualizações
Which files are binaries in a python wheel?

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?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Therefore, my guess was that the bin folder would contain binaries of the package.

That's incorrect. Django just happens to have a bin directory, since it houses the django-admin command line tool.

Does python wheel actually contain a binary? If yes, then how to locate the binary within the .whl file?

Yes, if there is something that needs to be a compiled binary. For instance, a NumPy wheel would have multiple .so (Linux/macOS) or .pyd (Windows) files (Python extension modules). Their location within the .whl depends on the package.

You can tell whether a .whl contains binary Pyt .whl does not contain binary modules from the name: Django-3.2.9-py3-none-any.whl. Compare to e.g. Numpy's numpy-1.21.4-cp310-cp310-win_amd64.whl (containing binary modules for CPython 3.10 on Windows, AMD64 architecture).

If there's other binary package data, such as an image that the package requires, that would be in the .whl too. For Django, you will likely find Gettext .mo files.

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?

Source code for binary modules is just generally not included in .whls.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda