An enhanced version of core Distutils' Distribution class.
Currently supported features, for *all* Python (2.2+) versions:
(from Python 2.3+)
download_url, classifiers - PEP 314 metadata fields
(from Python 2.5+)
install_egg_info command - for setuptools
requires, provides, obsoletes - PEP 314 metadata fields
(only available in 4Suite)
requires_python - [PEP 345] a list of version restrictions for Python
requires_external - [PEP 345] a list of external requirements
command_mapping - maps command names to a module/class name that differs
from the actual command name
Methods
- __init__(self, attrs)
- Overrides: __init__ from class Distribution
- announce(self, msg, level=1)
-
If the current verbosity level is of greater than or equal to
'level' print 'msg' to stdout.
- Overrides: announce from class Distribution
- finalize_options(self)
- Overrides: finalize_options from class Distribution
- get_allfiles(self)
- get_command_class(self, command)
-
Extends Distribution.get_command_class() to search 'command_mapping'
for modules that implement that requested command.
- Overrides: get_command_class from class Distribution
- get_command_list(self)
-
Overridden to add the commands defined by 'command_mapping' to the
list of (command, description) tuples.
- Overrides: get_command_list from class Distribution
- get_source_files(self)
- has_bgen(self)
- has_devel(self)
- has_docs(self)
- has_l10n(self)
- has_localstate(self)
- has_sysconf(self)
- has_text(self)
- print_commands(self)
-
Overridden to add the commands defined by 'command_mapping' to the
list of "standard commands".
- Overrides: print_commands from class Distribution
- print_option_list(self, options, header, max_length)
Methods inherited from class distutils.dist.Distribution
dump_option_dicts, find_config_files, get_command_obj, get_command_packages, get_option_dict, handle_display_options, has_c_libraries, has_data_files, has_ext_modules, has_headers, has_modules, has_pure_modules, has_scripts, is_pure, parse_command_line, parse_config_files, print_command_list, reinitialize_command, run_command, run_commands
Members
- command_aliases = {'bdist_wininst': 'bdist_inno', 'install_docs': 'install_html'}
- command_mapping = {'bdist': 'BDist', 'bdist_dumb': None, 'bdist_egg': 'BDistEgg', 'bdist_inno': 'BDistInno', 'bdist_msi': None, 'bdist_rpm': 'BDistRpm', 'build': 'Build', 'build_clib': None, 'build_docs': 'BuildDocs', 'build_ext': 'BuildExt', ...}
- source_package = False
- standard_commands = ['config', 'build', 'clean', 'install', 'sdist', 'register', 'bdist', 'upload', 'generate']
- toplevel_options = [('source-package', 's', 'run as if from a source dist (developer testing)')]
Members inherited from class distutils.dist.Distribution
common_usage, display_option_names, display_options, global_options, negative_opt
Methods
- from_filename(...)
-
classmethod(function) -> method
Convert a function to be a class method.
A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:
class C:
def f(cls, arg1, arg2, ...): ...
f = classmethod(f)
It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()). The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.
Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.
- from_stream(...)
-
classmethod(function) -> method
Convert a function to be a class method.
A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:
class C:
def f(cls, arg1, arg2, ...): ...
f = classmethod(f)
It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()). The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.
Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.
- from_string(...)
-
classmethod(function) -> method
Convert a function to be a class method.
A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:
class C:
def f(cls, arg1, arg2, ...): ...
f = classmethod(f)
It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()). The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.
Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.
- get_requires_external(self)
- get_requires_python(self)
- set_requires_external(self, value)
- set_requires_python(self, value)
- write_pkg_file(self, file)
-
Write the PKG-INFO format data to a file object.
Supports metadata version 1.2 (PEP 345), 1.1 (PEP 314) and
1.0 (PEP 241) in a lowest common denominator fashion.
- Overrides: write_pkg_file from class DistributionMetadata
Methods inherited from class distutils.dist.DistributionMetadata
__init__, get_author, get_author_email, get_classifiers, get_contact, get_contact_email, get_description, get_download_url, get_fullname, get_keywords, get_licence, get_license, get_long_description, get_maintainer, get_maintainer_email, get_name, get_obsoletes, get_platforms, get_provides, get_requires, get_url, get_version, set_obsoletes, set_provides, set_requires, write_pkg_info
Members
- copyright = None
- requires_external = None
- requires_python = None