Packaging – Creating Your Own Libraries or Applications
The chapters thus far have covered how to write, test, and debug Python code. With all of that, there is only one thing that remains: packaging and distributing your Python libraries and applications. To create installable packages, we will use the setuptools
 package, which is bundled with Python these days. If you have created packages before, you might remember distribute
 and distutils2
, but it is very important to remember that these have been replaced by setuptools
 and distutils
 and you shouldn’t use them anymore!
We have several types of packages and packaging methods to cover:
- Building new-style packages using the PEP 517/518
pyproject.toml
file - Advanced package building using the
setup.py
file - Package types: wheels, eggs, source packages, and others
- Installing executables and customÂ
setuptools
 commands - Packages...