2011-06-01 15:42:49 -03:00
|
|
|
:mod:`packaging.dist` --- The Distribution class
|
|
|
|
================================================
|
|
|
|
|
|
|
|
.. module:: packaging.dist
|
|
|
|
:synopsis: Core Distribution class.
|
|
|
|
|
|
|
|
|
|
|
|
This module provides the :class:`Distribution` class, which represents the
|
|
|
|
module distribution being built/packaged/distributed/installed.
|
|
|
|
|
|
|
|
.. class:: Distribution(arguments)
|
|
|
|
|
|
|
|
A :class:`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 :class:`Distribution` instance.
|
|
|
|
|
|
|
|
.. TODO improve constructor to take a Metadata object + named params?
|
|
|
|
(i.e. Distribution(metadata, cmdclass, py_modules, etc)
|
|
|
|
.. TODO also remove obsolete(?) script_name, etc. parameters? see what
|
|
|
|
py2exe and other tools need
|
|
|
|
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| argument name | value | type |
|
|
|
|
+====================+================================+=============================================================+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *name* | The name of the project | a string |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *version* | The version number of the | a string |
|
|
|
|
| | release; see | |
|
|
|
|
| | :mod:`packaging.version` | |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *summary* | A single line describing the | a string |
|
|
|
|
| | project | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *description* | Longer description of the | a string |
|
|
|
|
| | project | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *author* | The name of the project author | a string |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *author_email* | The email address of the | a string |
|
|
|
|
| | project author | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *maintainer* | The name of the current | a string |
|
|
|
|
| | maintainer, if different from | |
|
|
|
|
| | the author | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *maintainer_email* | The email address of the | a string |
|
2011-06-01 15:42:49 -03:00
|
|
|
| | current maintainer, if | |
|
|
|
|
| | different from the author | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *home_page* | A URL for the proejct | a string |
|
2011-06-01 15:42:49 -03:00
|
|
|
| | (homepage) | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *download_url* | A URL to download the project | a string |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *packages* | A list of Python packages that | a list of strings |
|
|
|
|
| | packaging will manipulate | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *py_modules* | A list of Python modules that | a list of strings |
|
|
|
|
| | packaging will manipulate | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *scripts* | A list of standalone scripts | a list of strings |
|
|
|
|
| | to be built and installed | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *ext_modules* | A list of Python extensions to | a list of instances of |
|
2011-06-01 15:42:49 -03:00
|
|
|
| | be built | :class:`packaging.compiler.extension.Extension` |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *classifiers* | A list of categories for the | a list of strings; valid classifiers are listed on `PyPi |
|
|
|
|
| | distribution | <http://pypi.python.org/pypi?:action=list_classifiers>`_. |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *distclass* | the :class:`Distribution` | a subclass of |
|
2011-06-01 15:42:49 -03:00
|
|
|
| | class to use | :class:`packaging.dist.Distribution` |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *script_name* | The name of the setup.py | a string |
|
|
|
|
| | script - defaults to | |
|
|
|
|
| | ``sys.argv[0]`` | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *script_args* | Arguments to supply to the | a list of strings |
|
|
|
|
| | setup script | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *options* | default options for the setup | a string |
|
|
|
|
| | script | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *license* | The license for the | a string |
|
|
|
|
| | distribution; should be used | |
|
|
|
|
| | when there is no suitable | |
|
|
|
|
| | License classifier, or to | |
|
|
|
|
| | refine a classifier | |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *keywords* | Descriptive keywords; used by | a list of strings or a comma-separated string |
|
|
|
|
| | catalogs such as PyPI | |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
2011-08-25 20:23:20 -03:00
|
|
|
| *platforms* | Platforms compatible with this | a list of strings or a comma-separated string |
|
|
|
|
| | distribution; should be used | |
|
|
|
|
| | when there is no suitable | |
|
|
|
|
| | Platform classifier | |
|
2011-06-01 15:42:49 -03:00
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *cmdclass* | A mapping of command names to | a dictionary |
|
|
|
|
| | :class:`Command` subclasses | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *data_files* | A list of data files to | a list |
|
|
|
|
| | install | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|
|
|
|
| *package_dir* | A mapping of Python packages | a dictionary |
|
|
|
|
| | to directory names | |
|
|
|
|
+--------------------+--------------------------------+-------------------------------------------------------------+
|