Wheel files in python

20-05-2025

Introduced in PEP 427:

What are wheel files:

Benefits:

  • smaller in size
  • allows for faster installation for pure python and native C extension packages
  • avoids arbitrary code execution for installation
    • everything is run inside setup.py when using sdist
  • more consistent installs across platforms and machines
    • does not require a compiler for C extensions
    • pip generates .pyc files in the wheel that match the right interpreter

Types of wheels:

  • universal wheel (python 2 AND python 3 AND any OS)
  • pure-python wheel (python 2 OR python 3)
  • platform wheel ([python 2 or python 3] AND platform)

Tools to build wheels for all: