Packaging and Distribution

Packaging and distributing your Python code can be a complex and sometimes confusing task, especially if your projects have lots of dependencies or involve components more exotic than straight Python code. However, for many cases it's very straightforward to make your code accessible to others in a standard way, and we'll see how to do that using the standard distutils module in this section. The main advantage of distutils is that it’s included in the Python Standard Library. For much beyond the simplest packaging requirements you'll probably want to look at setup tools instead, which has capabilities beyond those of distutils, but which is correspondingly more confusing.

The distutils module allows you to write a simple Python script which knows how to install your Python modules into any Python installation, including one hosted in a virtual environment. By convention this script is called setup.py and it exists at the top level of your project structure. This script can then be executed to perform the actual installation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset