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

Class BuildPython

source code

                         object --+    
                                  |    
                          _GitMixin --+
                                      |
                         object --+   |
                                  |   |
                   _RegressionMixin --+
                                      |
          distutils.cmd.Command --+   |
                                  |   |
distutils.command.build_py.build_py --+
                                      |
                                     BuildPython

Customize the command preparing python modules in order to skip copying original py files if compile is specified. Additionally we allow the python interpreter to be specified as the bytecode is incompatible between the versions
Instance Methods [hide private]
 
_build_dir(self)
Returns: directory into which all files will be put
source code
 
_exclude_items(self, package_name)
Exclude the given package name from our packages and datafiles :param package_name: The name of the package, i.e.
source code
 
_filter_by_token(self, token, array)
Use a simple filter function and return all array items which do not contain the token
source code
 
_filtered_module_list(self, modules)
Because things multiply in our base class ...
source code
 
_test_abspath(self)
Returns: First the executable in our build dir, then the one our distro deems best
source code
 
byte_compile(self, files, **kwargs)
If we are supposed to compile, remove the original file afterwards
source code
 
finalize_options(self)
Assure our args are of the correct type
source code
 
find_all_modules(self)
Same as above, but ...
source code
 
find_data_files(self, package, src_dir)
Fixes the underlying method by allowing to specify whole directories whose files will be copied recursively.
source code
 
find_package_modules(self, package, package_dir)
Overridden to filter return value using our exludes
source code
 
fix_scripts(self)
Check what the user classified as script and fix the first line to point to the right python interpreter version (only if we are compiling).
source code
 
handle_exclusion(self)
Apply the exclusion patterns
source code
 
initialize_options(self)
Set default values for all the options that this command supports.
source code
 
run(self)
Perform the main operation, and handle git afterwards :note: It is done at a point where the py modules as well as the executables are available.
source code

Inherited from _GitMixin: __init__, add_files_and_commit, branch_name, item_chooser, push_to_remotes, set_head_to, update_git

Inherited from _RegressionMixin: post_regression_test

Inherited from _RegressionMixin (private): _find_test_modules

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

Inherited from distutils.command.build_py.build_py: build_module, build_modules, build_package_data, build_packages, check_module, check_package, find_modules, get_data_files, get_module_outfile, get_outputs, get_package_dir, get_source_files

Inherited from distutils.cmd.Command: __getattr__, announce, copy_file, copy_tree, debug_print, dump_options, ensure_dirname, ensure_filename, ensure_finalized, ensure_string, ensure_string_list, execute, get_command_name, get_finalized_command, get_sub_commands, make_archive, make_file, mkpath, move_file, reinitialize_command, run_command, set_undefined_options, spawn, warn

Inherited from distutils.cmd.Command (private): _ensure_stringlike, _ensure_tested_string

Class Methods [hide private]

Inherited from _GitMixin: adjust_user_options

Static Methods [hide private]

Inherited from _GitMixin: __new__

Class Variables [hide private]
  description = 'Implements byte-compilation with different pyth...
  remove_tests_if_optimize = True
  rename_pyo_to_pyc = True

Inherited from _GitMixin: branch_suffix, prev_head_name

Inherited from _RegressionMixin: test_sub_dir

Inherited from distutils.command.build_py.build_py: boolean_options, negative_opt, user_options

Inherited from distutils.cmd.Command: sub_commands

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_build_dir(self)

source code 
Returns:
directory into which all files will be put

_exclude_items(self, package_name)

source code 
Exclude the given package name from our packages and datafiles :param package_name: The name of the package, i.e. '.test'

_filtered_module_list(self, modules)

source code 
Because things multiply in our base class ... argh

_test_abspath(self)

source code 
Returns:
First the executable in our build dir, then the one our distro deems best

byte_compile(self, files, **kwargs)

source code 
If we are supposed to compile, remove the original file afterwards
Overrides: distutils.command.build_py.build_py.byte_compile

finalize_options(self)

source code 
Assure our args are of the correct type
Overrides: distutils.cmd.Command.finalize_options
(inherited documentation)

find_all_modules(self)

source code 
Same as above, but ... different. Instaed of using the find_package_modules method, it reimplements the same functionality ... wtf ??
Overrides: distutils.command.build_py.build_py.find_all_modules

find_data_files(self, package, src_dir)

source code 
Fixes the underlying method by allowing to specify whole directories whose files will be copied recursively. Thanks python for not even providing the bare mininum so people end up reimplementing parts of the 'distribution system'
Overrides: distutils.command.build_py.build_py.find_data_files

find_package_modules(self, package, package_dir)

source code 
Overridden to filter return value using our exludes
Overrides: distutils.command.build_py.build_py.find_package_modules

fix_scripts(self)

source code 
Check what the user classified as script and fix the first line to point to the right python interpreter version (only if we are compiling). Additionally, make the file executable on linux

initialize_options(self)

source code 

Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments.

This method must be implemented by all command classes.

Overrides: distutils.cmd.Command.initialize_options
(inherited documentation)

run(self)

source code 
Perform the main operation, and handle git afterwards :note: It is done at a point where the py modules as well as the executables are available. In case there are c-modules, these wouldn't be availble here.
Overrides: distutils.cmd.Command.run

Class Variable Details [hide private]

description

Value:
'Implements byte-compilation with different python interpreter version\
s'