Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 1 | :mod:`packaging.dist` --- The Distribution class |
| 2 | ================================================ |
| 3 | |
| 4 | .. module:: packaging.dist |
| 5 | :synopsis: Core Distribution class. |
| 6 | |
| 7 | |
| 8 | This module provides the :class:`Distribution` class, which represents the |
| 9 | module 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 Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 28 | | *name* | The name of the project | a string | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 29 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 30 | | *version* | The version number of the | a string | |
| 31 | | | release; see | | |
| 32 | | | :mod:`packaging.version` | | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 33 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
| 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 Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 49 | | *maintainer_email* | The email address of the | a string | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 50 | | | current maintainer, if | | |
| 51 | | | different from the author | | |
| 52 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 53 | | *home_page* | A URL for the proejct | a string | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 54 | | | (homepage) | | |
| 55 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 56 | | *download_url* | A URL to download the project | a string | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 57 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
| 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 Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 67 | | *ext_modules* | A list of Python extensions to | a list of instances of | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 68 | | | be built | :class:`packaging.compiler.extension.Extension` | |
| 69 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 70 | | *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 Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 72 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 73 | | *distclass* | the :class:`Distribution` | a subclass of | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 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 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 86 | | *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 Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 91 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 92 | | *keywords* | Descriptive keywords; used by | a list of strings or a comma-separated string | |
| 93 | | | catalogs such as PyPI | | |
Éric Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 94 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
Éric Araujo | b008d3d | 2011-08-26 01:23:20 +0200 | [diff] [blame] | 95 | | *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 Araujo | 3a9f58f | 2011-06-01 20:42:49 +0200 | [diff] [blame] | 99 | +--------------------+--------------------------------+-------------------------------------------------------------+ |
| 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 | +--------------------+--------------------------------+-------------------------------------------------------------+ |