blob: fb05b69c706ae58289dd807bc0b420f00288b15e [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 +====================+================================+=============================================================+
28 | *name* | The name of the project | string |
29 +--------------------+--------------------------------+-------------------------------------------------------------+
30 | *version* | The version number of the | See :mod:`packaging.version` |
31 | | release | |
32 +--------------------+--------------------------------+-------------------------------------------------------------+
33 | *summary* | A single line describing the | a string |
34 | | project | |
35 +--------------------+--------------------------------+-------------------------------------------------------------+
36 | *description* | Longer description of the | a string |
37 | | project | |
38 +--------------------+--------------------------------+-------------------------------------------------------------+
39 | *author* | The name of the project author | a string |
40 +--------------------+--------------------------------+-------------------------------------------------------------+
41 | *author_email* | The email address of the | a string |
42 | | project author | |
43 +--------------------+--------------------------------+-------------------------------------------------------------+
44 | *maintainer* | The name of the current | a string |
45 | | maintainer, if different from | |
46 | | the author | |
47 +--------------------+--------------------------------+-------------------------------------------------------------+
48 | *maintainer_email* | The email address of the | |
49 | | current maintainer, if | |
50 | | different from the author | |
51 +--------------------+--------------------------------+-------------------------------------------------------------+
52 | *home_page* | A URL for the proejct | a URL |
53 | | (homepage) | |
54 +--------------------+--------------------------------+-------------------------------------------------------------+
55 | *download_url* | A URL to download the project | a URL |
56 +--------------------+--------------------------------+-------------------------------------------------------------+
57 | *packages* | A list of Python packages that | a list of strings |
58 | | packaging will manipulate | |
59 +--------------------+--------------------------------+-------------------------------------------------------------+
60 | *py_modules* | A list of Python modules that | a list of strings |
61 | | packaging will manipulate | |
62 +--------------------+--------------------------------+-------------------------------------------------------------+
63 | *scripts* | A list of standalone scripts | a list of strings |
64 | | to be built and installed | |
65 +--------------------+--------------------------------+-------------------------------------------------------------+
66 | *ext_modules* | A list of Python extensions to | A list of instances of |
67 | | be built | :class:`packaging.compiler.extension.Extension` |
68 +--------------------+--------------------------------+-------------------------------------------------------------+
69 | *classifiers* | A list of categories for the | The list of available |
70 | | distribution | categorizations is at |
71 | | | http://pypi.python.org/pypi?:action=list_classifiers. |
72 +--------------------+--------------------------------+-------------------------------------------------------------+
73 | *distclass* | the :class:`Distribution` | A subclass of |
74 | | 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 +--------------------+--------------------------------+-------------------------------------------------------------+
86 | *license* | The license for the | a string; should be used when there is no suitable License |
87 | | distribution | classifier, or to specify a classifier |
88 +--------------------+--------------------------------+-------------------------------------------------------------+
89 | *keywords* | Descriptive keywords | a list of strings; used by catalogs |
90 +--------------------+--------------------------------+-------------------------------------------------------------+
91 | *platforms* | Platforms compatible with this | a list of strings; should be used when there is no |
92 | | distribution | suitable Platform classifier |
93 +--------------------+--------------------------------+-------------------------------------------------------------+
94 | *cmdclass* | A mapping of command names to | a dictionary |
95 | | :class:`Command` subclasses | |
96 +--------------------+--------------------------------+-------------------------------------------------------------+
97 | *data_files* | A list of data files to | a list |
98 | | install | |
99 +--------------------+--------------------------------+-------------------------------------------------------------+
100 | *package_dir* | A mapping of Python packages | a dictionary |
101 | | to directory names | |
102 +--------------------+--------------------------------+-------------------------------------------------------------+