1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import warnings
17
18 from twisted.python import deprecate, versions
19
20 from buildbot import util
21 from buildbot.process.build import Build
22 from buildbot.process.buildstep import BuildStep
23 from buildbot.steps.source import CVS, SVN
24 from buildbot.steps.shell import Configure, Compile, Test, PerlModuleTest
25
26
27 @deprecate.deprecated(versions.Version("buildbot", 0, 8, 6))
28 -def s(steptype, **kwargs):
29
30
31 return (steptype, kwargs)
32
34 """When calling BuildFactory.addStep(stepinstance), addStep() only takes
35 one argument. You passed extra arguments to addStep(), which you probably
36 intended to pass to your BuildStep constructor instead. For example, you
37 should do::
38
39 f.addStep(ShellCommand(command=['echo','stuff'], haltOnFailure=True))
40
41 instead of::
42
43 f.addStep(ShellCommand(command=['echo','stuff']), haltOnFailure=True)
44 """
45
47 """
48 @cvar buildClass: class to use when creating builds
49 @type buildClass: L{buildbot.process.build.Build}
50 """
51 buildClass = Build
52 useProgress = 1
53 workdir = "build"
54 compare_attrs = ['buildClass', 'steps', 'useProgress', 'workdir']
55
60
62 if isinstance(step_or_factory, BuildStep):
63 return step_or_factory.getStepFactory()
64 warnings.warn(
65 "Passing a BuildStep subclass to factory.addStep is deprecated. " +
66 "Please pass a BuildStep instance instead. Support will be dropped in v0.8.7.",
67 DeprecationWarning, stacklevel=3)
68 return step_or_factory
69
81
82 - def addStep(self, step_or_factory, **kwargs):
83 if isinstance(step_or_factory, BuildStep):
84 if kwargs:
85 raise ArgumentsInTheWrongPlace()
86 s = step_or_factory.getStepFactory()
87 elif type(step_or_factory) == type(BuildStep) and \
88 issubclass(step_or_factory, BuildStep):
89 s = (step_or_factory, dict(kwargs))
90 warnings.warn(
91 "Passing a BuildStep subclass to factory.addStep is deprecated. " +
92 "Please pass a BuildStep instance instead. Support will be dropped in v0.8.7.",
93 DeprecationWarning, stacklevel=2)
94
95 else:
96 raise ValueError('%r is not a BuildStep nor BuildStep subclass' % step_or_factory)
97 self.steps.append(s)
98
102
106 - def __init__(self, source, configure="./configure",
107 configureEnv={},
108 configureFlags=[],
109 compile=["make", "all"],
110 test=["make", "check"]):
130
131 -class CPAN(BuildFactory):
132 - def __init__(self, source, perl="perl"):
137
139 - def __init__(self, source, python="python", test=None):
144
145 -class Trial(BuildFactory):
146 """Build a python module that uses distutils and trial. Set 'tests' to
147 the module in which the tests can be found, or set useTestCaseNames=True
148 to always have trial figure out which tests to run (based upon which
149 files have been changed).
150
151 See docs/factories.xhtml for usage samples. Not all of the Trial
152 BuildStep options are available here, only the most commonly used ones.
153 To get complete access, you will need to create a custom
154 BuildFactory."""
155
156 trial = "trial"
157 randomly = False
158 recurse = False
159
160 - def __init__(self, source,
161 buildpython=["python"], trialpython=[], trial=None,
162 testpath=".", randomly=None, recurse=None,
163 tests=None, useTestCaseNames=False, env=None):
164 BuildFactory.__init__(self, [source])
165 assert tests or useTestCaseNames, "must use one or the other"
166 if trial is not None:
167 self.trial = trial
168 if randomly is not None:
169 self.randomly = randomly
170 if recurse is not None:
171 self.recurse = recurse
172
173 from buildbot.steps.python_twisted import Trial
174 buildcommand = buildpython + ["./setup.py", "build"]
175 self.addStep(Compile, command=buildcommand, env=env)
176 self.addStep(Trial,
177 python=trialpython, trial=self.trial,
178 testpath=testpath,
179 tests=tests, testChanges=useTestCaseNames,
180 randomly=self.randomly,
181 recurse=self.recurse,
182 env=env,
183 )
184
185
186
187
188
189
190 ConfigurableBuildFactory = BuildFactory
193
194
195 - def __init__(self, cvsroot, cvsmodule,
196 configure=None, configureEnv={},
197 compile="make all",
198 test="make check", cvsCopy=False):
207
209 useProgress = False
210
211 - def __init__(self, cvsroot, cvsmodule,
212 configure=None, configureEnv={},
213 compile="make all",
214 test="make check", cvsCopy=False):
221
223
224 - def __init__(self, svnurl,
225 configure=None, configureEnv={},
226 compile="make all",
227 test="make check"):
233