Forward the call to mrv’s setup routine
Return a list all Python packages found within directory ‘where’
‘where’ should be supplied as a “cross-platform” (i.e. URL-style) path; it will be converted to the appropriate local path syntax. ‘exclude’ is a sequence of package names to exclude; ‘*’ can be used as a wildcard in the names, such that ‘foo.*’ will exclude all subpackages of ‘foo’ (but not ‘foo’ itself).
The gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; find and parse config files; parse the command line; run each Distutils command found there, customized by the options supplied to ‘setup()’ (as keyword arguments), in config files, and on the command line.
The Distribution instance might be an instance of a class supplied via the ‘distclass’ keyword argument to ‘setup’; if no such class is supplied, then the Distribution class (in dist.py) is instantiated. All other arguments to ‘setup’ (except for ‘cmdclass’) are used to set attributes of the Distribution instance.
The ‘cmdclass’ argument, if supplied, is a dictionary mapping command names to command classes. Each command encountered on the command line will be turned into a command class, which is in turn instantiated; any class found in ‘cmdclass’ is used in place of the default, which is (for command ‘foo_bar’) class ‘foo_bar’ in module ‘distutils.command.foo_bar’. The command class must provide a ‘user_options’ attribute which is a list of option specifiers for ‘distutils.fancy_getopt’. Any command-line options between the current and the next command are used to set attributes of the current command object.
When the entire command-line has been successfully parsed, calls the ‘run()’ method on each command object in turn. This method will be driven entirely by the Distribution object (which each command object has a reference to, thanks to its constructor), and the command-specific options that became attributes of each command object.
Epydoc: animio.setup.Distribution
Bases: object, distutils.dist.Distribution
Customize available options and behaviour to work with mrv and derived projects
Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions).
There are three possible config files: distutils.cfg in the Distutils installation directory (ie. where the top-level Distutils __inst__.py file lives), a file in the user’s home directory named .pydistutils.cfg on Unix and pydistutils.cfg on Windows/Mac, and setup.cfg in the current directory.
Return the class that implements the Distutils command named by ‘command’. First we check the ‘cmdclass’ dictionary; if the command is mentioned there, we fetch the class object from the dictionary and return it. Otherwise we load the command module (“distutils.command.” + command) and fetch the command class from the module. The loaded class is also stored in ‘cmdclass’ to speed future calls to ‘get_command_class()’.
Raises DistutilsModuleError if the expected module could not be found, or if that module does not define the expected class.
Returns: | Full name, including the python version we are compiling the code |
---|
Returns: | list of all packages in rootpackage in __import__ compatible form |
---|
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 |
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 |
---|
Reinitializes a command to the state it was in when first returned by ‘get_command_obj()’: ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You’ll have to re-finalize the command object (by calling ‘finalize_options()’ or ‘ensure_finalized()’) before using it for real.
‘command’ should be a command name (string) or command object. If ‘reinit_subcommands’ is true, also reinitializes the command’s sub-commands, as declared by the ‘sub_commands’ class attribute (if it has one). See the “install” command for an example. Only reinitializes the sub-commands that actually matter, ie. those whose test predicates return true.
Returns the reinitialized command object.
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
Returns: | version string from the given version info which is assumed to |
---|
be in the default python version_info format ( sys.version_info )
Epydoc: animio.setup.BuildPython
Bases: animio.setup._GitMixin, animio.setup._RegressionMixin, distutils.command.build_py.build_py
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
Add all files recursively to the index as found below root_dir and commit the index.
As a special ability, we will rewrite their paths and thus add them relative to the root directory, even though the git repository might be on another level. It also sports a simple way to determine whether the commit already exists, so it will not recommit data that has just been committed.
Parameters: |
|
---|---|
Returns: | tuple(root_original_head, (Created)Commit object) The head to which the root repository pointed before we changed it to our distribution head, and the commit object we possible created in the distribution repository |
Returns: | name of the branch identifying our current release configuration |
---|
Perform a regression test for the maya version’s the user supplied. :param testexecutable: path to the tmrv-compatible executable - it is
expected to be inside a tree which allows the project to put itself into the path.
Parameter: | root_dir – root directory under which tests can be found |
---|---|
Raises EnvironmentError: | |
if started process returned non-0 |
et our head to point to the given head_name. If possible, update the index to represent the tree the head points to
Returns: | Head named head_name |
---|---|
Note: | In the worst case, the head points to non-existing ref, as the repository is still empty |
Epydoc: animio.setup.BuildScripts
Bases: distutils.command.build_scripts.build_scripts
Uses our way to adjust the first line of the script, additionally rename the executable to indicate the required interpreter. Otherwise scripts would override each other anyway.
Handle the given scripts to work for later installation :param scripts: paths to scripts to hanlde :param adjust_first_line: if True, the first line will receive the actual
python version to match the version of the this python interpreter
Parameter: | suffix – if given, the suffix is assumed to be a suffix for all scripts. If scripts want to execfile each other, the name of the script needs adjustment to actually work, which is unknown to the script in advance. Hence we fix the string ourselves. The suffix is assumed to be appended to all input script files, revealing the original script basename if the suffix is removed. The latter one is searched for in the script. |
---|
Abstract base class for defining command classes, the “worker bees” of the Distutils. A useful analogy for command classes is to think of them as subroutines with local variables called “options”. The options are “declared” in ‘initialize_options()’ and “defined” (given their final values, aka “finalized”) in ‘finalize_options()’, both of which must be defined by every command class. The distinction between the two is necessary because option values might come from the outside world (command line, config file, ...), and any options dependent on other options must be computed after these outside influences have been processed – hence ‘finalize_options()’. The “body” of the subroutine, where it does all its work based on the values of its options, is the ‘run()’ method, which must also be implemented by every command class.
Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if ‘foo’ depends on ‘bar’, then it is safe to set ‘foo’ from ‘bar’ as long as ‘foo’ still has the same value it was assigned in ‘initialize_options()’.
This method must be implemented by all command classes.
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.
A command’s raison d’etre: carry out the action it exists to perform, controlled by the options initialized in ‘initialize_options()’, customized by other commands, the setup script, the command-line, and config files, and finalized in ‘finalize_options()’. All terminal output and filesystem interaction should be done by ‘run()’.
This method must be implemented by all command classes.
Epydoc: animio.setup.Distribution
Bases: object, distutils.dist.Distribution
Customize available options and behaviour to work with mrv and derived projects
Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions).
There are three possible config files: distutils.cfg in the Distutils installation directory (ie. where the top-level Distutils __inst__.py file lives), a file in the user’s home directory named .pydistutils.cfg on Unix and pydistutils.cfg on Windows/Mac, and setup.cfg in the current directory.
Return the class that implements the Distutils command named by ‘command’. First we check the ‘cmdclass’ dictionary; if the command is mentioned there, we fetch the class object from the dictionary and return it. Otherwise we load the command module (“distutils.command.” + command) and fetch the command class from the module. The loaded class is also stored in ‘cmdclass’ to speed future calls to ‘get_command_class()’.
Raises DistutilsModuleError if the expected module could not be found, or if that module does not define the expected class.
Returns: | Full name, including the python version we are compiling the code |
---|
Returns: | list of all packages in rootpackage in __import__ compatible form |
---|
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 |
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 |
---|
Reinitializes a command to the state it was in when first returned by ‘get_command_obj()’: ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You’ll have to re-finalize the command object (by calling ‘finalize_options()’ or ‘ensure_finalized()’) before using it for real.
‘command’ should be a command name (string) or command object. If ‘reinit_subcommands’ is true, also reinitializes the command’s sub-commands, as declared by the ‘sub_commands’ class attribute (if it has one). See the “install” command for an example. Only reinitializes the sub-commands that actually matter, ie. those whose test predicates return true.
Returns the reinitialized command object.
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
Returns: | version string from the given version info which is assumed to |
---|
be in the default python version_info format ( sys.version_info )
Epydoc: animio.setup.DocDistro
Bases: animio.setup._GitMixin, distutils.cmd.Command
Build the documentation, and include everything into the git repository if required.
Add all files recursively to the index as found below root_dir and commit the index.
As a special ability, we will rewrite their paths and thus add them relative to the root directory, even though the git repository might be on another level. It also sports a simple way to determine whether the commit already exists, so it will not recommit data that has just been committed.
Parameters: |
|
---|---|
Returns: | tuple(root_original_head, (Created)Commit object) The head to which the root repository pointed before we changed it to our distribution head, and the commit object we possible created in the distribution repository |
Returns: | name of the branch identifying our current release configuration |
---|
Build the documentation with our current version tag - this allows it to be included in the release as it has been updated
Returns: | tuple(html_base, Bool) tuple with base directory containing all html files ( possibly with subdirectories ), and a boolean which is True if the documentation was build, False if it was still uptodate |
---|
et our head to point to the given head_name. If possible, update the index to represent the tree the head points to
Returns: | Head named head_name |
---|---|
Note: | In the worst case, the head points to non-existing ref, as the repository is still empty |
Epydoc: animio.setup.GitSourceDistribution
Bases: animio.setup._GitMixin, animio.setup._RegressionMixin, distutils.command.sdist.sdist
Instead of creating an archive, we put the source tree into a git repository
Warns if (README or README.txt) or setup.py are missing; everything else is optional.
Add all files recursively to the index as found below root_dir and commit the index.
As a special ability, we will rewrite their paths and thus add them relative to the root directory, even though the git repository might be on another level. It also sports a simple way to determine whether the commit already exists, so it will not recommit data that has just been committed.
Parameters: |
|
---|---|
Returns: | tuple(root_original_head, (Created)Commit object) The head to which the root repository pointed before we changed it to our distribution head, and the commit object we possible created in the distribution repository |
Returns: | name of the branch identifying our current release configuration |
---|
Perform a regression test for the maya version’s the user supplied. :param testexecutable: path to the tmrv-compatible executable - it is
expected to be inside a tree which allows the project to put itself into the path.
Parameter: | root_dir – root directory under which tests can be found |
---|---|
Raises EnvironmentError: | |
if started process returned non-0 |
Prune off branches that might slip into the file list as created by ‘read_template()’, but really don’t belong there:
- the build tree (typically “build”)
- the release tree itself (only an issue if we ran “sdist” previously with –keep-temp, or it aborted)
- any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
Read and parse manifest template file named by self.template.
(usually “MANIFEST.in”) The parsing and processing is done by ‘self.filelist’, which updates itself accordingly.
et our head to point to the given head_name. If possible, update the index to represent the tree the head points to
Returns: | Head named head_name |
---|---|
Note: | In the worst case, the head points to non-existing ref, as the repository is still empty |
Epydoc: animio.setup.InstallCommand
Bases: distutils.command.install.install
Assure compilation is done by build_py
Epydoc: animio.setup.InstallLibCommand
Bases: distutils.command.install_lib.install_lib
Makes sure the compilation does not happen - if the user wants it, it will only work in the build_py command.
Epydoc: animio.setup._GitMixin
Bases: object
Provides functionality to add files and folders within a base directory into the root of a git repository of our choice
Add all files recursively to the index as found below root_dir and commit the index.
As a special ability, we will rewrite their paths and thus add them relative to the root directory, even though the git repository might be on another level. It also sports a simple way to determine whether the commit already exists, so it will not recommit data that has just been committed.
Parameters: |
|
---|---|
Returns: | tuple(root_original_head, (Created)Commit object) The head to which the root repository pointed before we changed it to our distribution head, and the commit object we possible created in the distribution repository |
Returns: | name of the branch identifying our current release configuration |
---|
et our head to point to the given head_name. If possible, update the index to represent the tree the head points to
Returns: | Head named head_name |
---|---|
Note: | In the worst case, the head points to non-existing ref, as the repository is still empty |
Epydoc: animio.setup._RegressionMixin
Bases: object
Provides a simple interface allowing to perform a regression test
Perform a regression test for the maya version’s the user supplied. :param testexecutable: path to the tmrv-compatible executable - it is
expected to be inside a tree which allows the project to put itself into the path.
Parameter: | root_dir – root directory under which tests can be found |
---|---|
Raises EnvironmentError: | |
if started process returned non-0 |
Bases: distutils.cmd.Command
Bases: distutils.cmd.Command
Bases: object
chain(*iterables) –> chain object
Return a chain object whose .next() method returns elements from the first iterable until it is exhausted, then elements from the next iterable, until all of the iterables are exhausted.
chain.from_iterable(iterable) –> chain object
Alternate chain() contructor taking a single iterable argument that evaluates lazily.
Bases: distutils.cmd.Command
Bases: distutils.cmd.Command
Bases: distutils.cmd.Command
Warns if (README or README.txt) or setup.py are missing; everything else is optional.
Prune off branches that might slip into the file list as created by ‘read_template()’, but really don’t belong there:
- the build tree (typically “build”)
- the release tree itself (only an issue if we ran “sdist” previously with –keep-temp, or it aborted)
- any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
Read and parse manifest template file named by self.template.
(usually “MANIFEST.in”) The parsing and processing is done by ‘self.filelist’, which updates itself accordingly.