Debian Python Policy

Neil Schemenauer

Matthias Klose

Gregor Hoffleit

Josselin Mouette

Joe Wreschnig

Loïc Minier

Scott Kitterman

Barry Warsaw

Ben Finney

Neil Williams

This manual is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License version 2 is available as /usr/share/common-licences/GPL-2 in the Debian GNU/Linux system, or on the World Wide Web at GNU General Public License, version 2.

You can also obtain it by writing to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

Abstract

This document describes the packaging of Python within the Debian GNU/Linux distribution and the policy requirements for packaged Python programs and modules.


Table of Contents

1. Completing the move to Python 3
2. Python Packaging
2.1. Versions
2.2. Main packages
2.3. Minimal packages
2.4. Python Interpreter
2.4.1. Interpreter Name
2.4.2. Interpreter Location
2.5. Module Path
2.6. Hooks for updates to installed runtimes
2.7. Documentation
3. Packaged Modules
3.1. Types of Python Modules
3.2. Wheels
3.3. Module Package Names
3.4. Specifying Supported Versions
3.5. Dependencies
3.6. Provides
3.7. Modules Byte-Compilation
4. Python Programs
4.1. Interpreter directive (“Shebang”)
4.2. Programs using the default Python
4.2.1. Programs Shipping Private Modules
4.3. Programs Using a Particular Python Version
5. Programs Embedding Python
5.1. Building Embedded Programs
5.2. Embedded Python Dependencies
6. Interaction with Locally Installed Python Versions
A. Build Dependencies
B. Packaging Tools
B.1. distutils
B.2. setuptools
B.3. dh-python
B.4. pybuild
B.5. CDBS
B.6. python-support (removed)
B.7. python-central (removed)
C. Upgrade Procedure