Package animio :: Module setup :: Class Distribution
[hide private]
[frames] | no frames]

Class Distribution

source code

          object --+
                   |
BaseDistribution --+
                   |
                  Distribution

Customize available options and behaviour to work with mrv and derived projects
Instance Methods [hide private]
 
__del__(self)
undo monkey patches
source code
 
__init__(self, *args, **kwargs)
Initialize base and set some useful defaults
source code
 
_makedoc_relapath(self)
Returns: relative path to makedoc executable
source code
 
_query_user_token(self, tokens)
Read tokens from user and finally return a token he picked :raise Exception: if user failed in some point.
source code
 
_regressiontest_relapath(self)
Returns: tmrvr compatible test executable relative to the project root
source code
 
_rootpath(self)
and subpackages directly
source code
 
_test_relapath(self)
Returns: tmrv compatible test executable
source code
 
get_fullname(self)
Returns: Full name, including the python version we are compiling the code
source code
 
get_packages(self)
Returns: list of all packages in rootpackage in __import__ compatible form
source code
 
handle_version_and_tag(self)
Assure our current commit in the main repository is tagged properly If so, continue, if not, try to create a tag with the current version.
source code
 
parse_command_line(self)
Handle our custom options
source code
 
perform_regression_tests(self)
Run regression tests and fail with a report if one of the regression test fails
source code
 
postprocess_metadata(self)
Called after the commandline has been parsed.
source code
 
run_commands(self)
Perform required pre- and post-run actions
source code
 
spawn_python_interpreter(self, args, cwd=None)
Start the default python interpreter, and handle the windows special case...
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from BaseDistribution: announce, dump_option_dicts, finalize_options, find_config_files, get_command_class, get_command_list, 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_config_files, print_command_list, print_commands, reinitialize_command, run_command

Inherited from BaseDistribution (private): _get_toplevel_options, _parse_command_opts, _set_command_options, _show_help

Class Methods [hide private]
 
fixed_list_arg(cls, value)
As the comamndline parsing is as bad as it gets, it will not parse the correct types, nor will it split ',' separated items into a list correctly.
source code
 
modifiy_sys_args(cls)
Parse our own arguments off the args list and modify the argument stream accordingly.
source code
 
retrieve_project_info(cls)
import the project information module :return: package info module object
source code
 
retrieve_root_package(cls, basedir='.')
Make sure the root package is in the python path and is set as our root :return: root package object
source code
 
version_string(cls, version_info)
be in the default python version_info format ( sys.version_info )
source code
Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, *args, **kwargs)
Fix the objet.__new__ call with arguments that would occur.
source code
Class Variables [hide private]
  dist_dir = 'dist'
  ext_dir = 'ext'
  include_external = True
  opt_maya_version = 'maya-version'
  pinfo = None
  requires_map = {'bdist': [], 'sdist': ['nose', 'epydoc', 'sphi...
  rootpackage = None

Inherited from BaseDistribution: common_usage, display_option_names, display_options, global_options, negative_opt

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Initialize base and set some useful defaults
Overrides: BaseDistribution.__init__

__new__(cls, *args, **kwargs)
Static Method

source code 
Fix the objet.__new__ call with arguments that would occur. This is a serious issue, not only here but also for mixin classes that need initialization - types don't know who derives from them, and which hierarchy they are in, and they have to call super to pass on the __init__ call to possible mixins in the derived hierarchy
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

_makedoc_relapath(self)

source code 
Returns:
relative path to makedoc executable

_query_user_token(self, tokens)

source code 
Read tokens from user and finally return a token he picked :raise Exception: if user failed in some point. :return: tuple with version info in corresponding format

_regressiontest_relapath(self)

source code 
Returns:
tmrvr compatible test executable relative to the project root

_rootpath(self)

source code 
and subpackages directly
Returns:
path to the root of the rootpackage, which includes all modules

_test_relapath(self)

source code 
Returns:
tmrv compatible test executable

fixed_list_arg(cls, value)
Class Method

source code 
As the comamndline parsing is as bad as it gets, it will not parse the correct types, nor will it split ',' separated items into a list correctly. If options are provided via the comandline, they are generally screwed up as they are plain strings, so each and every command has to check and verify them by itself. Well done, could have been a nice base task job. We check value for a comman separated string, and return the parsed list if necessary, or the value itself if it is already a list or tuple

get_fullname(self)

source code 
Returns:
Full name, including the python version we are compiling the code

get_packages(self)

source code 
Returns:
list of all packages in rootpackage in __import__ compatible form

handle_version_and_tag(self)

source code 
Assure our current commit in the main repository is tagged properly If so, continue, if not, try to create a tag with the current version. If the version was already tagged before, help the user to adjust his version string in the root module, make a commit, and finally create the tag we were so desperate for. The main idea is to enforce a unique version each time we make a release, and to make that easy
Returns:
TagReference object created
Raises:
  • EnvironmentError - if we could not get a valid tag

modifiy_sys_args(cls)
Class Method

source code 
Parse our own arguments off the args list and modify the argument stream accordingly.

Note: needs to be called before setup of the distutils is called

parse_command_line(self)

source code 
Handle our custom options
Overrides: BaseDistribution.parse_command_line

postprocess_metadata(self)

source code 
Called after the commandline has been parsed. With all information available we can decide whether additional dependencies need to be specified

run_commands(self)

source code 
Perform required pre- and post-run actions
Overrides: BaseDistribution.run_commands

spawn_python_interpreter(self, args, cwd=None)

source code 
Start the default python interpreter, and handle the windows special case
:param args: passed to the python interpreter, must not include the executable
:param cwd: if not None, it will be set for the childs working directory
:return: Spawned Process
:note: All output channels of our process will be connected to the output channels 
        of the spawned one

version_string(cls, version_info)
Class Method

source code 
be in the default python version_info format ( sys.version_info )
Returns:
version string from the given version info which is assumed to

Class Variable Details [hide private]

requires_map

Value:
{'bdist': [], 'sdist': ['nose', 'epydoc', 'sphinx', 'gitpython']}