New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Companion changes for tm.tl/#7945 -- do not merge #135

Closed
wants to merge 5 commits into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+70 −167
Diff settings

Always

Just for now

@@ -42,7 +42,7 @@ from twisted_factories import (
TwistedVirtualenvReactorsBuildFactory,
TwistedJythonReactorsBuildFactory,
Win32RemovePYCs,
TwistedBdistMsiFactory,
TwistedCextsWheelBuildFactory,
TwistedCoveragePyFactory,
TwistedCheckerBuildFactory,
PyFlakesBuildFactory,
@@ -199,21 +199,22 @@ builders.append({
'name': 'winxp32-py2.7',
'builddir': 'winxp32-py2.7',
'slavenames': ['tomprince-socrates-winxp-1'],
'factory': TwistedReactorsBuildFactory(git_update,
'factory': TwistedReactorsBuildFactory(source=git_update,
RemovePYCs=Win32RemovePYCs,
python="c:\\python27\python.exe",
reactors=["select", "iocp"],
uncleanWarnings=True),
'category': 'supported'})
builders.append({
'name': "winxp32-py2.7-msi",
'builddir': "winxp32-py2.7-msi",
'name': "winxp32-py2.7-whl",
'builddir': "winxp32-py2.7-whl",
'slavenames': ['tomprince-socrates-winxp-1'],
'factory': TwistedBdistMsiFactory(git_update,
uncleanWarnings=True,
arch="win32",
pyVersion="2.7"),
'factory': TwistedCextsWheelBuildFactory(source=git_update,
python="C:\\Python27\\python.exe",
uncleanWarnings=True,
arch="win32",
pyVersion="2.7"),
'category': 'supported'})
@@ -232,13 +233,14 @@ builders.append({
'category': 'supported'})
builders.append({
'name': "windows7-64-py2.7-msi",
'builddir': "windows7-64-py2.7-msi",
'name': "windows7-64-py2.7-whl",
'builddir': "windows7-64-py2.7-whl",
'slavenames': ['bot-glyph-6'],
'factory': TwistedBdistMsiFactory(git_update,
uncleanWarnings=True,
arch="win-amd64",
pyVersion="2.7"),
'factory': TwistedCextsWheelBuildFactory(source=git_update,
python="C:\\Python27\\python.exe",
uncleanWarnings=True,
arch="win-amd64",
pyVersion="2.7"),
'category': 'supported'})
@@ -358,7 +360,8 @@ builders.append({
'builddir': 'fedora22-py2.7',
'slavenames': fedora22_slaves,
'factory': TwistedVirtualenvReactorsBuildFactory(
git_update, python="python", reactors=["select", "poll", "epoll"]),
source=git_update, python="python",
reactors=["select", "poll", "epoll"]),
'category': 'supported'})
builders.append({
@@ -524,6 +527,18 @@ builders.append({
uncleanWarnings=False),
'category': 'unsupported'})
builders.append({
'slavenames': ['egh-osx-1'],
'locks': [twoCPULock.access('counting')],
'name': 'osx10.10-py2.7-whl',
'builddir': 'osx10.10-py2.7-whl',
'factory': TwistedCextsWheelBuildFactory(source=git_update,
python="python",
uncleanWarnings=True,
arch="macosx_10_10_x86_64",
pyVersion="2.7"),
'category': 'supported'})
#
# FreeBSD 10.1
@@ -258,12 +258,6 @@ def __init__(self, source, python="python",
command=['pip', 'install'] + dependencies
)
# Build our extensions, in case any API documentation wants to link to
# them.
self.addVirtualEnvStep(
shell.Compile,
command=[python, "setup.py", "build_ext", "-i"])
self.addVirtualEnvStep(CheckDocumentation)
self.addVirtualEnvStep(ProcessDocs)
self.addStep(
@@ -311,16 +305,13 @@ class TwistedReactorsBuildFactory(TwistedBaseFactory):
treeStableTimer = 5*60
def __init__(self, source, RemovePYCs=RemovePYCs,
python="python", compileOpts=[], compileOpts2=[],
reactors=["select"], uncleanWarnings=True):
python="python", reactors=["select"], uncleanWarnings=True):
TwistedBaseFactory.__init__(self, python, source, uncleanWarnings)
assert isinstance(compileOpts, list)
assert isinstance(compileOpts2, list)
cmd = (self.python + compileOpts + ["setup.py", "build_ext"]
+ compileOpts2 + ["-i"])
self.addStep(shell.Compile, command=cmd, warnOnFailure=True)
self.addVirtualEnvStep(shell.ShellCommand,
description="installing CExts".split(" "),
command=['pip', 'install', 'cexts/'],
warnOnFailure=True)
for reactor in reactors:
self.addStep(RemovePYCs)
@@ -358,8 +349,10 @@ def __init__(self, source, RemovePYCs=RemovePYCs, python="python",
self._reportVersions(virtualenv=True)
cmd = (self.python + ["setup.py", "build_ext", "-i"])
self.addVirtualEnvStep(shell.Compile, command=cmd, warnOnFailure=True)
self.addVirtualEnvStep(shell.ShellCommand,
description="installing CExts".split(" "),
command=['pip', 'install', 'cexts/'],
warnOnFailure=True)
for reactor in reactors:
self.addStep(RemovePYCs)
@@ -373,8 +366,7 @@ def __init__(self, source, RemovePYCs=RemovePYCs, python="python",
class TwistedJythonReactorsBuildFactory(TwistedBaseFactory):
treeStableTimer = 5*60
def __init__(self, source, RemovePYCs=RemovePYCs,
compileOpts=[], compileOpts2=[], python="jython",
def __init__(self, source, RemovePYCs=RemovePYCs, python="jython",
reactors=["select"], uncleanWarnings=True):
TwistedBaseFactory.__init__(
@@ -451,85 +443,50 @@ def __init__(self, source, RemovePYCs=RemovePYCs,
class TwistedBdistMsiFactory(TwistedBaseFactory):
class TwistedCextsWheelBuildFactory(TwistedBaseFactory):
"""
Build the _twistedextensions package.
"""
treeStableTimer = 5*60
uploadBase = 'build_products/'
def __init__(self, source, uncleanWarnings, arch, pyVersion):
python = self.python(pyVersion)
def __init__(self, python, source, uncleanWarnings, arch, pyVersion):
TwistedBaseFactory.__init__(self, python, source, uncleanWarnings)
self.addStep(
LearnVersion, python=python, package='twisted', workdir='Twisted')
def transformVersion(build):
return build.getProperty("version").split("+")[0].split("pre")[0]
self.addStep(SetBuildProperty,
property_name='versionMsi', value=transformVersion)
self.addStep(shell.ShellCommand,
name='write-copyright-file',
description=['Update', 'twisted/copyright.py'],
descriptionDone=['Updated', 'twisted/copyright.py'],
command=[python, "-c", WithProperties(
'version = \'%(versionMsi)s\'; '
'f = file(\'twisted\copyright.py\', \'at\'); '
'f.write(\'version = \' + repr(version)); '
'f.close()')],
haltOnFailure=True)
property_name="versionWhl",
value=transformVersion)
self.addStep(shell.ShellCommand,
name='build-msi',
description=['Build', 'msi'],
descriptionDone=['Built', 'msi'],
command=[python, "setup.py", "bdist_msi"],
haltOnFailure=True)
self.addStep(
transfer.FileUpload,
name='upload-msi',
slavesrc=WithProperties('dist/Twisted-%(versionMsi)s.' + arch + '-py' + pyVersion + '.msi'),
masterdest=WithProperties(
self.uploadBase + 'twisted-packages/Twisted-%%(version)s.%s-py%s.msi' % (arch, pyVersion)),
url=WithProperties(
'/build/twisted-packages/Twisted-%%(version)s.%s-py%s.msi' % (arch, pyVersion)))
wheelPythonVersion = 'cp' + pyVersion.replace('.','') + '-none-' + arch.replace('-','_')
self.addStep(shell.ShellCommand,
name='build-exe',
description=['Build', 'exe'],
descriptionDone=['Built', 'exe'],
command=[python, "setup.py", "bdist_wininst"],
haltOnFailure=True)
self.addStep(
transfer.FileUpload,
name='upload-exe',
slavesrc=WithProperties('dist/Twisted-%(versionMsi)s.' + arch + '-py' + pyVersion + '.exe'),
masterdest=WithProperties(
self.uploadBase + 'twisted-packages/Twisted-%%(version)s.%s-py%s.exe' % (arch, pyVersion)),
url=WithProperties(
'/build/twisted-packages/Twisted-%%(version)s.%s-py%s.exe' % (arch, pyVersion)))
shell.ShellCommand,
workdir="cexts",
name='build-whl',
description=['Build', 'wheel'],
descriptionDone=['Built', 'wheel'],
command=[python, "setup.py", "bdist_wheel"],
haltOnFailure=True
)
wheelPythonVersion = 'cp' + pyVersion.replace('.','') + '-none-' + arch.replace('-','_')
self.addStep(shell.ShellCommand,
name='build-whl',
description=['Build', 'wheel'],
descriptionDone=['Built', 'wheel'],
command=[python, "setup.py", "--command-package", "wheel", "bdist_wheel"],
haltOnFailure=True)
self.addStep(
transfer.FileUpload,
name='upload-whl',
slavesrc=WithProperties('dist/Twisted-%(versionMsi)s-' + wheelPythonVersion + '.whl'),
slavesrc=WithProperties(
'cexts/dist/_twistedextensions-%(versionWhl)s-' + wheelPythonVersion + '.whl'),
masterdest=WithProperties(
self.uploadBase + 'twisted-packages/Twisted-%(version)s-'
self.uploadBase + 'twisted-packages/_twistedextensions-%(version)s-'
+ wheelPythonVersion + '.whl'),
url=WithProperties(
'/build/twisted-packages/Twisted-%(version)s-'
'/build/twisted-packages/_twistedextensions-%(version)s-'
+ wheelPythonVersion + '.whl'),
)
def python(self, pyVersion):
return (
"c:\\python%s\\python.exe" % (
pyVersion.replace('.', ''),))
)
@@ -554,14 +511,16 @@ def __init__(self, python, source, buildID=None, trial="./bin/trial",
)
self.addVirtualEnvStep(
shell.ShellCommand,
description = "installing dependencies".split(" "),
description="installing dependencies".split(" "),
command=['pip', 'install'] + dependencies + COVERAGE_DEPENDENCIES
)
self._reportVersions(virtualenv=True)
cmd = (self.python + ["setup.py", "build_ext", "-i"])
self.addVirtualEnvStep(shell.Compile, command=cmd, warnOnFailure=True)
self.addVirtualEnvStep(shell.ShellCommand,
description="installing CExts".split(" "),
command=['pip', 'install', 'cexts/'],
warnOnFailure=True)
self.addTrialStep(
flunkOnFailure=True,
@@ -598,11 +598,8 @@ def getText2(self, cmd, results):
class ProcessDocs(ShellCommand):
"""
I build all docs. This requires some LaTeX packages to be
installed. It will result in the full documentation book (dvi,
pdf, etc).
I build all docs. This requires Sphinx.
"""
name = "process-docs"
warnOnWarnings = 1
command = [
@@ -738,75 +735,6 @@ def evaluateCommand(self, cmd):
return SUCCESS
class BuildDebs(ShellCommand):
"""I build the .deb packages."""
name = "debuild"
flunkOnFailure = 1
command = ["debuild", "-uc", "-us"]
description = ["building", "debs"]
descriptionDone = ["debs"]
def __init__(self, **kwargs):
"""
@type workdir: string
@keyword workdir: the workdir to start from (must be the base of the
Twisted tree)
@type results: double of [int, string]
@keyword results: [rc, output].
- rc == 0 if all .debs were created successfully
- output: string with any errors or warnings
"""
ShellCommand.__init__(self, **kwargs)
def commandComplete(self, cmd):
errors, warnings = 0, 0
output = cmd.logs['stdio'].getText()
summary = ""
sio = StringIO.StringIO(output)
for line in sio.readlines():
if line.find("E: ") == 0:
summary += line
errors += 1
if line.find("W: ") == 0:
summary += line
warnings += 1
if summary:
self.addCompleteLog("problems", summary)
self.errors = errors
self.warnings = warnings
def evaluateCommand(self, cmd):
if cmd.rc != 0:
return FAILURE
if self.errors:
return FAILURE
if self.warnings:
return WARNINGS
return SUCCESS
def getText(self, cmd, results):
text = ["debuild"]
if cmd.rc != 0:
text.append("failed")
errors, warnings = self.errors, self.warnings
if warnings or errors:
text.append("lintian:")
if warnings:
text.append("%d warnin%s" % (warnings,
warnings == 1 and 'g' or 'gs'))
if errors:
text.append("%d erro%s" % (errors,
errors == 1 and 'r' or 'rs'))
return text
def getText2(self, cmd, results):
if cmd.rc != 0:
return ["debuild"]
if self.errors or self.warnings:
return ["%d lintian" % (self.errors + self.warnings)]
return []
class RemovePYCs(ShellCommand):
name = "remove-.pyc"
@@ -815,6 +743,7 @@ class RemovePYCs(ShellCommand):
descriptionDone = ["remove", "bytecode"]
class RemoveTrialTemp(ShellCommand):
name = "remove-_trial_temp"
description = ["removing", "_trial_temp"]
ProTip! Use n and p to navigate between commits in a pull request.