Logo Search packages:      
Sourcecode: distribute version File versions  Download package

setuptools::dist::Distribution Class Reference

List of all members.


Detailed Description

Distribution with support for features, tests, and package data

This is an enhanced version of 'distutils.dist.Distribution' that
effectively adds the following new optional keyword arguments to 'setup()':

 'install_requires' -- a string or sequence of strings specifying project
    versions that the distribution requires when installed, in the format
    used by 'pkg_resources.require()'.  They will be installed
    automatically when the package is installed.  If you wish to use
    packages that are not available in PyPI, or want to give your users an
    alternate download location, you can add a 'find_links' option to the
    '[easy_install]' section of your project's 'setup.cfg' file, and then
    setuptools will scan the listed web pages for links that satisfy the
    requirements.

 'extras_require' -- a dictionary mapping names of optional "extras" to the
    additional requirement(s) that using those extras incurs. For example,
    this::

        extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])

    indicates that the distribution can optionally provide an extra
    capability called "reST", but it can only be used if docutils and
    reSTedit are installed.  If the user installs your package using
    EasyInstall and requests one of your extras, the corresponding
    additional requirements will be installed if needed.

 'features' -- a dictionary mapping option names to 'setuptools.Feature'
    objects.  Features are a portion of the distribution that can be
    included or excluded based on user options, inter-feature dependencies,
    and availability on the current system.  Excluded features are omitted
    from all setup commands, including source and binary distributions, so
    you can create multiple distributions from the same source tree.
    Feature names should be valid Python identifiers, except that they may
    contain the '-' (minus) sign.  Features can be included or excluded
    via the command line options '--with-X' and '--without-X', where 'X' is
    the name of the feature.  Whether a feature is included by default, and
    whether you are allowed to control this from the command line, is
    determined by the Feature object.  See the 'Feature' class for more
    information.

 'test_suite' -- the name of a test suite to run for the 'test' command.
    If the user runs 'python setup.py test', the package will be installed,
    and the named test suite will be run.  The format is the same as
    would be used on a 'unittest.py' command line.  That is, it is the
    dotted name of an object to import and call to generate a test suite.

 'package_data' -- a dictionary mapping package names to lists of filenames
    or globs to use to find data files contained in the named packages.
    If the dictionary has filenames or globs listed under '""' (the empty
    string), those names will be searched for in every package, in addition
    to any names for the specific package.  Data files found using these
    names/globs will be installed along with the package, in the same
    location as the package.  Note that globs are allowed to reference
    the contents of non-package subdirectories, as long as you use '/' as
    a path separator.  (Globs are automatically converted to
    platform-specific paths at runtime.)

In addition to these new keywords, this class also has several new methods
for manipulating the distribution's contents.  For example, the 'include()'
and 'exclude()' methods can be thought of as in-place add and subtract
commands that add or remove packages, modules, extensions, and so on from
the distribution.  They are used by the feature subsystem to configure the
distribution for the included and excluded features.

Definition at line 125 of file dist.py.


Public Member Functions

def __init__
def exclude
def exclude_package
def feature_is_included
def fetch_build_egg
def fetch_build_eggs
def finalize_options
def get_cmdline_options
def get_command_class
def has_contents_for
def include
def include_feature
def iter_distribution_names
def parse_command_line
def patch_missing_pkg_info
def print_commands

Public Attributes

 convert_2to3_doctests
 dependency_links
 dist_files
 ext_modules
 feature_negopt
 feature_options
 features
 global_options
 negative_opt
 package_data
 packages
 py_modules
 require_features
 src_root

Private Member Functions

def _exclude_misc
def _exclude_packages
def _feature_attrname
def _finalize_features
def _include_misc
def _parse_command_opts
def _set_feature
def _set_global_opts_from_features

Private Attributes

 _egg_fetcher

Static Private Attributes

 _patched_dist = None

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index