blob: 25cb62bc4b1f5e0fe06624ae5644ca2407dd18cc [file] [log] [blame]
Éric Araujo3a9f58f2011-06-01 20:42:49 +02001:mod:`packaging.dist` --- The Distribution class
2================================================
3
4.. module:: packaging.dist
5 :synopsis: Core Distribution class.
6
7
8This module provides the :class:`Distribution` class, which represents the
9module distribution being built/packaged/distributed/installed.
10
11.. class:: Distribution(arguments)
12
13 A :class:`Distribution` describes how to build, package, distribute and
14 install a Python project.
15
16 The arguments accepted by the constructor are laid out in the following
17 table. Some of them will end up in a metadata object, the rest will become
18 data attributes of the :class:`Distribution` instance.
19
20 .. TODO improve constructor to take a Metadata object + named params?
21 (i.e. Distribution(metadata, cmdclass, py_modules, etc)
22 .. TODO also remove obsolete(?) script_name, etc. parameters? see what
23 py2exe and other tools need
24
25 +--------------------+--------------------------------+-------------------------------------------------------------+
26 | argument name | value | type |
27 +====================+================================+=============================================================+
Éric Araujob008d3d2011-08-26 01:23:20 +020028 | *name* | The name of the project | a string |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020029 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020030 | *version* | The version number of the | a string |
31 | | release; see | |
32 | | :mod:`packaging.version` | |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020033 +--------------------+--------------------------------+-------------------------------------------------------------+
34 | *summary* | A single line describing the | a string |
35 | | project | |
36 +--------------------+--------------------------------+-------------------------------------------------------------+
37 | *description* | Longer description of the | a string |
38 | | project | |
39 +--------------------+--------------------------------+-------------------------------------------------------------+
40 | *author* | The name of the project author | a string |
41 +--------------------+--------------------------------+-------------------------------------------------------------+
42 | *author_email* | The email address of the | a string |
43 | | project author | |
44 +--------------------+--------------------------------+-------------------------------------------------------------+
45 | *maintainer* | The name of the current | a string |
46 | | maintainer, if different from | |
47 | | the author | |
48 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020049 | *maintainer_email* | The email address of the | a string |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020050 | | current maintainer, if | |
51 | | different from the author | |
52 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020053 | *home_page* | A URL for the proejct | a string |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020054 | | (homepage) | |
55 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020056 | *download_url* | A URL to download the project | a string |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020057 +--------------------+--------------------------------+-------------------------------------------------------------+
58 | *packages* | A list of Python packages that | a list of strings |
59 | | packaging will manipulate | |
60 +--------------------+--------------------------------+-------------------------------------------------------------+
61 | *py_modules* | A list of Python modules that | a list of strings |
62 | | packaging will manipulate | |
63 +--------------------+--------------------------------+-------------------------------------------------------------+
64 | *scripts* | A list of standalone scripts | a list of strings |
65 | | to be built and installed | |
66 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020067 | *ext_modules* | A list of Python extensions to | a list of instances of |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020068 | | be built | :class:`packaging.compiler.extension.Extension` |
69 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020070 | *classifiers* | A list of categories for the | a list of strings; valid classifiers are listed on `PyPi |
71 | | distribution | <http://pypi.python.org/pypi?:action=list_classifiers>`_. |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020072 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020073 | *distclass* | the :class:`Distribution` | a subclass of |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020074 | | class to use | :class:`packaging.dist.Distribution` |
75 +--------------------+--------------------------------+-------------------------------------------------------------+
76 | *script_name* | The name of the setup.py | a string |
77 | | script - defaults to | |
78 | | ``sys.argv[0]`` | |
79 +--------------------+--------------------------------+-------------------------------------------------------------+
80 | *script_args* | Arguments to supply to the | a list of strings |
81 | | setup script | |
82 +--------------------+--------------------------------+-------------------------------------------------------------+
83 | *options* | default options for the setup | a string |
84 | | script | |
85 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020086 | *license* | The license for the | a string |
87 | | distribution; should be used | |
88 | | when there is no suitable | |
89 | | License classifier, or to | |
90 | | refine a classifier | |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020091 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020092 | *keywords* | Descriptive keywords; used by | a list of strings or a comma-separated string |
93 | | catalogs such as PyPI | |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020094 +--------------------+--------------------------------+-------------------------------------------------------------+
Éric Araujob008d3d2011-08-26 01:23:20 +020095 | *platforms* | Platforms compatible with this | a list of strings or a comma-separated string |
96 | | distribution; should be used | |
97 | | when there is no suitable | |
98 | | Platform classifier | |
Éric Araujo3a9f58f2011-06-01 20:42:49 +020099 +--------------------+--------------------------------+-------------------------------------------------------------+
100 | *cmdclass* | A mapping of command names to | a dictionary |
101 | | :class:`Command` subclasses | |
102 +--------------------+--------------------------------+-------------------------------------------------------------+
103 | *data_files* | A list of data files to | a list |
104 | | install | |
105 +--------------------+--------------------------------+-------------------------------------------------------------+
106 | *package_dir* | A mapping of Python packages | a dictionary |
107 | | to directory names | |
108 +--------------------+--------------------------------+-------------------------------------------------------------+