bdist and wheels

To be able to distribute a prebuilt distribution, distutils provides the build command. This commands compiles the package in the following four steps:

  • build_py: This builds pure Python modules by byte-compiling them and copying them into the build folder.
  • build_clib: This builds C libraries, when the package contains any, using Python compiler and creating a static library in the build folder.
  • build_ext: This builds C extensions and puts the result in the build folder like build_clib.
  • build_scripts: This builds the modules that are marked as scripts. It also changes the interpreter path when the first line was set (using !# prefix) and fixes the file mode so that it is executable.

Each of these steps is a command that ...

Get Expert Python Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.