OpenQuizz
Une application de gestion des contenus pédagogiques
Distribution Class Reference
Inheritance diagram for Distribution:
Collaboration diagram for Distribution:

Public Member Functions

def patch_missing_pkg_info (self, attrs)
 
def __init__ (self, attrs=None)
 
def warn_dash_deprecation (self, opt, section)
 
def make_option_lowercase (self, opt, section)
 
def parse_config_files (self, filenames=None, ignore_option_errors=False)
 
def fetch_build_eggs (self, requires)
 
def finalize_options (self)
 
def get_egg_cache_dir (self)
 
def fetch_build_egg (self, req)
 
def get_command_class (self, command)
 
def print_commands (self)
 
def get_command_list (self)
 
def include (self, **attrs)
 
def exclude_package (self, package)
 
def has_contents_for (self, package)
 
def exclude (self, **attrs)
 
def get_cmdline_options (self)
 
def iter_distribution_names (self)
 
def handle_display_options (self, option_order)
 

Data Fields

 package_data
 
 dist_files
 
 src_root
 
 dependency_links
 
 setup_requires
 
 install_requires
 
 extras_require
 
 convert_2to3_doctests
 
 packages
 
 py_modules
 
 ext_modules
 
 global_options
 
 negative_opt
 

Detailed Description

Distribution with support for 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.

 '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.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  attrs = None 
)

Member Function Documentation

◆ exclude()

def exclude (   self,
**  attrs 
)
Remove items from distribution that are named in keyword arguments

For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
the distribution's 'py_modules' attribute.  Excluding packages uses
the 'exclude_package()' method, so all of the package's contained
packages, modules, and extensions are also excluded.

Currently, this method only supports exclusion from attributes that are
lists or tuples.  If you need to add support for excluding from other
attributes in this or a subclass, you can add an '_exclude_X' method,
where 'X' is the name of the attribute.  The method will be called with
the value passed to 'exclude()'.  So, 'dist.exclude(foo={"bar":"baz"})'
will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
handle whatever special exclusion logic is needed.

◆ exclude_package()

def exclude_package (   self,
  package 
)
Remove packages, modules, and extensions in named package

◆ fetch_build_egg()

def fetch_build_egg (   self,
  req 
)
Fetch an egg needed for building

◆ fetch_build_eggs()

def fetch_build_eggs (   self,
  requires 
)
Resolve pre-setup requirements

Reimplemented in Distribution.

◆ finalize_options()

def finalize_options (   self)
Allow plugins to apply arbitrary operations to the
distribution. Each hook may optionally define a 'order'
to influence the order of execution. Smaller numbers
go first and the default is 0.

◆ get_cmdline_options()

def get_cmdline_options (   self)
Return a '{cmd: {opt:val}}' map of all command-line options

Option names are all long, but do not include the leading '--', and
contain dashes rather than underscores.  If the option doesn't take
an argument (e.g. '--quiet'), the 'val' is 'None'.

Note that options provided by config files are intentionally excluded.

◆ get_command_class()

def get_command_class (   self,
  command 
)
Pluggable version of get_command_class()

◆ get_command_list()

def get_command_list (   self)

◆ get_egg_cache_dir()

def get_egg_cache_dir (   self)

◆ handle_display_options()

def handle_display_options (   self,
  option_order 
)
If there were any non-global "display-only" options
(--help-commands or the metadata display options) on the command
line, display the requested info and return true; else return
false.

◆ has_contents_for()

def has_contents_for (   self,
  package 
)
Return true if 'exclude_package(package)' would do something

◆ include()

def include (   self,
**  attrs 
)
Add items to distribution that are named in keyword arguments

For example, 'dist.include(py_modules=["x"])' would add 'x' to
the distribution's 'py_modules' attribute, if it was not already
there.

Currently, this method only supports inclusion for attributes that are
lists or tuples.  If you need to add support for adding to other
attributes in this or a subclass, you can add an '_include_X' method,
where 'X' is the name of the attribute.  The method will be called with
the value passed to 'include()'.  So, 'dist.include(foo={"bar":"baz"})'
will try to call 'dist._include_foo({"bar":"baz"})', which can then
handle whatever special inclusion logic is needed.

◆ iter_distribution_names()

def iter_distribution_names (   self)
Yield all packages, modules, and extension names in distribution

◆ make_option_lowercase()

def make_option_lowercase (   self,
  opt,
  section 
)

◆ parse_config_files()

def parse_config_files (   self,
  filenames = None,
  ignore_option_errors = False 
)
Parses configuration files from various levels
and loads configuration.

◆ patch_missing_pkg_info()

def patch_missing_pkg_info (   self,
  attrs 
)

◆ print_commands()

def print_commands (   self)

◆ warn_dash_deprecation()

def warn_dash_deprecation (   self,
  opt,
  section 
)

Field Documentation

◆ convert_2to3_doctests

convert_2to3_doctests

◆ dependency_links

dependency_links

◆ dist_files

dist_files

◆ ext_modules

ext_modules

◆ extras_require

extras_require

◆ global_options

global_options

◆ install_requires

install_requires

◆ negative_opt

negative_opt

◆ package_data

package_data

◆ packages

packages

◆ py_modules

py_modules

◆ setup_requires

setup_requires

◆ src_root

src_root

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