# Distributing Python Modules

Greg Ward

Email: distutils-sig@python.org

### Abstract:

This document describes the Python Distribution Utilities (``Distutils'') from the module developer's point of view, describing how to use the Distutils to make Python modules and extensions easily available to a wider audience with very little overhead for build/release/install mechanics.

- 1 Introduction
- 2 Concepts & Terminology
  - 2.1 A Simple Example
  - 2.2 General Python terminology
  - 2.3 Distutils-specific terminology
- 3 Writing the Setup Script
  - 3.1 Listing whole packages
  - 3.2 Listing individual modules
  - 3.3 Describing extension modules
    - 3.3.1 Extension names and packages
    - 3.3.2 Extension source files
    - 3.3.3 Preprocessor options
    - 3.3.4 Library options
    - 3.3.5 Other options
  - 3.4 Installing Scripts
  - 3.5 Installing Additional Files
  - 3.6 Additional meta-data
  - 3.7 Debugging the setup script
- 4 Writing the Setup Configuration File
- 5 Creating a Source Distribution
  - 5.1 Specifying the files to distribute
  - 5.2 Manifest-related options
- 6 Creating Built Distributions
  - 6.1 Creating dumb built distributions
  - 6.2 Creating RPM packages
  - 6.3 Creating Windows Installers
    - 6.3.1 The Postinstallation script
- 7 Registering with the Package Index
- 8 Examples
  - 8.1 Pure Python distribution (by module)
  - 8.2 Pure Python distribution (by package)
  - 8.3 Single extension module
- 9 Reference
  - 9.1 Installing modules: the `install` command family
    - 9.1.1 `install_data`
    - 9.1.2 `install_scripts`
  - 9.2 Creating a source distribution: the `sdist` command
- 10 `distutils.sysconfig` -- System configuration information
- About this document ...