27.15.2.1. packaging.dist — The Distribution class

This module provides the Distribution class, which represents the module distribution being built/packaged/distributed/installed.

class packaging.dist.Distribution(arguments)

A Distribution describes how to build, package, distribute and install a Python project.

The arguments accepted by the constructor are laid out in the following table. Some of them will end up in a metadata object, the rest will become data attributes of the Distribution instance.

argument name value type
name The name of the project a string
version The version number of the release; see packaging.version a string
summary A single line describing the project a string
description Longer description of the project a string
author The name of the project author a string
author_email The email address of the project author a string
maintainer The name of the current maintainer, if different from the author a string
maintainer_email The email address of the current maintainer, if different from the author a string
home_page A URL for the proejct (homepage) a string
download_url A URL to download the project a string
packages A list of Python packages that packaging will manipulate a list of strings
py_modules A list of Python modules that packaging will manipulate a list of strings
scripts A list of standalone scripts to be built and installed a list of strings
ext_modules A list of Python extensions to be built a list of instances of packaging.compiler.extension.Extension
classifiers A list of categories for the distribution a list of strings; valid classifiers are listed on PyPi.
distclass the Distribution class to use a subclass of packaging.dist.Distribution
script_name The name of the setup.py script - defaults to sys.argv[0] a string
script_args Arguments to supply to the setup script a list of strings
options default options for the setup script a string
license The license for the distribution; should be used when there is no suitable License classifier, or to refine a classifier a string
keywords Descriptive keywords; used by catalogs such as PyPI a list of strings or a comma-separated string
platforms Platforms compatible with this distribution; should be used when there is no suitable Platform classifier a list of strings or a comma-separated string
cmdclass A mapping of command names to Command subclasses a dictionary
data_files A list of data files to install a list
package_dir A mapping of Python packages to directory names a dictionary

Previous topic

27.15.1.14. packaging.install — Installation tools

Next topic

27.15.2.2. packaging.command — Standard Packaging commands

This Page