Mercurial > hg > autobot
view autobot/process/factory.py @ 2:a3374cdd116d
stub out more needed for python projects
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 06 Jan 2011 11:28:28 -0800 |
parents | 8e14b6322cc7 |
children | 6abe5fb1fafc |
line wrap: on
line source
from autobot.steps import CreateVirtualenv from buildbot.process.factory import BuildFactory """ generic factories """ class VirtualenvFactory(BuildFactory): """ create a virtualenv """ def __init__(self, name='env', hg_sources=()): """ - name : of the virtualenv - hg_sources : sources of python packages with setuptools setup.pys """ BuildFactory.__init__(self) self.addStep(CreateVirtualenv(name)) self.addStep(ShellCommand(command=['mkdir', 'src'], directory=name)) # TODO: set properities: # - python location # - virtualenv location # clone hg repositories for hg_source in hg_sources: self.addStep(ShellCommand(command=['hg', 'clone', hg_source], directory=name + '/src')) class PythonSourceFactory(VirtualenvFactory): """ setup several python packages """ def __init__(self, name='env', hg_sources=()): # setup the environment VirtualenvFactory.__init__(self, name=name, hg_sources=hg_sources) # install the packages # python sources: # [{'source': 'http://hg.mozilla.org/....', # 'type': 'hg', # or git, # }]