Package bitten :: Package build :: Module pythontools

Module pythontools

Recipe commands for tools commonly used by Python projects.
Functions
 
distutils(ctxt, file_='setup.py', command='build', options=None, timeout=None)
Execute a distutils command.
 
exec_(ctxt, file_=None, module=None, function=None, output=None, args=None, timeout=None)
Execute a Python script.
 
pylint(ctxt, file_=None)
Extract data from a pylint run written to a file.
 
coverage(ctxt, summary=None, coverdir=None, include=None, exclude=None)
Extract data from a coverage.py run.
 
trace(ctxt, summary=None, coverdir=None, include=None, exclude=None)
Extract data from a trace.py run.
 
figleaf(ctxt, summary=None, include=None, exclude=None)
Extract data from a Figleaf run.
 
unittest(ctxt, file_=None)
Extract data from a unittest results file in XML format.
Variables
  log = logging.getLogger('bitten.build.pythontools')
  __package__ = 'bitten.build'
Function Details

distutils(ctxt, file_='setup.py', command='build', options=None, timeout=None)

 
Execute a distutils command.
Parameters:
  • ctxt (Context) - the build context
  • file_ - name of the file defining the distutils setup
  • command - the setup command to execute
  • options - additional options to pass to the command
  • timeout - the number of seconds before the external process should be aborted (has same constraints as CommandLine)

exec_(ctxt, file_=None, module=None, function=None, output=None, args=None, timeout=None)

 

Execute a Python script.

Either the file_ or the module parameter must be provided. If specified using the file_ parameter, the file must be inside the project directory. If specified as a module, the module must either be resolvable to a file, or the function parameter must be provided

Parameters:
  • ctxt (Context) - the build context
  • file_ - name of the script file to execute
  • module - name of the Python module to execute
  • function - name of the Python function to run
  • output - name of the file to which output should be written
  • args - extra arguments to pass to the script
  • timeout - the number of seconds before the external process should be aborted (has same constraints as CommandLine)

pylint(ctxt, file_=None)

 
Extract data from a pylint run written to a file.
Parameters:
  • ctxt (Context) - the build context
  • file_ - name of the file containing the Pylint output

coverage(ctxt, summary=None, coverdir=None, include=None, exclude=None)

 
Extract data from a coverage.py run.
Parameters:
  • ctxt (Context) - the build context
  • summary - path to the file containing the coverage summary
  • coverdir - name of the directory containing the per-module coverage details
  • include - patterns of files or directories to include in the report
  • exclude - patterns of files or directories to exclude from the report

trace(ctxt, summary=None, coverdir=None, include=None, exclude=None)

 
Extract data from a trace.py run.
Parameters:
  • ctxt (Context) - the build context
  • summary - path to the file containing the coverage summary
  • coverdir - name of the directory containing the per-module coverage details
  • include - patterns of files or directories to include in the report
  • exclude - patterns of files or directories to exclude from the report

figleaf(ctxt, summary=None, include=None, exclude=None)

 
Extract data from a Figleaf run.
Parameters:
  • ctxt (Context) - the build context
  • summary - path to the file containing the coverage summary
  • include - patterns of files or directories to include in the report
  • exclude - patterns of files or directories to exclude from the report

unittest(ctxt, file_=None)

 
Extract data from a unittest results file in XML format.
Parameters:
  • ctxt (Context) - the build context
  • file_ - name of the file containing the test results