Merge lp:~mwhudson/launchpad/upgrade-to-twisted-9 into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/upgrade-to-twisted-9
Merge into: lp:launchpad
Diff against target: 167 lines (+31/-9)
7 files modified
lib/canonical/librarian/web.py (+1/-5)
lib/canonical/twistedsupport/tests/test_processmonitor.py (+8/-1)
lib/lp/buildmaster/tests/test_manager.py (+6/-1)
lib/lp/codehosting/codeimport/tests/test_workermonitor.py (+6/-1)
lib/lp/codehosting/puller/tests/test_scheduler.py (+6/-1)
setup.py (+2/-0)
versions.cfg (+2/-0)
To merge this branch: bzr merge lp:~mwhudson/launchpad/upgrade-to-twisted-9
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+15229@code.launchpad.net

Commit message

Switch to getting Twisted from an egg and upgrade to Twisted 9

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi Tim,

This branch moves us to using Twisted from an egg, upgrades to Twisted 9 and skirts around a Twisted bug that interferes with some tests.

Cheers,
mwh

Revision history for this message
Tim Penhey (thumper) wrote :

Looks fine to me.

  merge approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/librarian/web.py'
2--- lib/canonical/librarian/web.py 2009-07-17 00:26:05 +0000
3+++ lib/canonical/librarian/web.py 2009-11-25 03:10:42 +0000
4@@ -7,10 +7,6 @@
5 import time
6
7 from twisted.web import resource, static, util, server, proxy
8-try:
9- NoResource = resource.NoResource
10-except AttributeError:
11- from twisted.web.error import NoResource
12 from twisted.internet.threads import deferToThread
13
14 from canonical.librarian.client import quote
15@@ -30,7 +26,7 @@
16 <!-- kthxbye. -->
17 </body></html>
18 """, type='text/html')
19-fourOhFour = NoResource('No such resource')
20+fourOhFour = resource.NoResource('No such resource')
21
22
23 class NotFound(Exception):
24
25=== modified file 'lib/canonical/twistedsupport/tests/test_processmonitor.py'
26--- lib/canonical/twistedsupport/tests/test_processmonitor.py 2009-07-26 14:19:49 +0000
27+++ lib/canonical/twistedsupport/tests/test_processmonitor.py 2009-11-25 03:10:42 +0000
28@@ -10,7 +10,7 @@
29
30 import unittest
31
32-from twisted.internet import defer, error, task
33+from twisted.internet import defer, error, reactor, task
34 from twisted.python import failure
35 from twisted.trial.unittest import TestCase as TrialTestCase
36
37@@ -318,6 +318,13 @@
38
39 layer = TwistedLayer
40
41+ def setUp(self):
42+ # XXX 2009-11-23, MichaelHudson,
43+ # bug=http://twistedmatrix.com/trac/ticket/2078: This is a hack to
44+ # make sure the reactor is running when the test method is executed to
45+ # work around the linked Twisted bug.
46+ return task.deferLater(reactor, 0, lambda: None)
47+
48 def test_run_process_with_timeout_invalid_args(self):
49 # `run_process_with_timeout` expects the process 'args' to be a
50 # tuple.
51
52=== modified file 'lib/lp/buildmaster/tests/test_manager.py'
53--- lib/lp/buildmaster/tests/test_manager.py 2009-09-07 13:02:02 +0000
54+++ lib/lp/buildmaster/tests/test_manager.py 2009-11-25 03:10:42 +0000
55@@ -7,7 +7,7 @@
56 import transaction
57 import unittest
58
59-from twisted.internet import defer
60+from twisted.internet import defer, task, reactor
61 from twisted.internet.error import (
62 ConnectionClosed, ProcessTerminated, TimeoutError)
63 from twisted.python.failure import Failure
64@@ -43,6 +43,11 @@
65 TrialTestCase.setUp(self)
66 self.slave = RecordingSlave(
67 'foo', 'http://foo:8221/rpc', 'foo.host')
68+ # XXX 2009-11-23, MichaelHudson,
69+ # bug=http://twistedmatrix.com/trac/ticket/2078: This is a hack to
70+ # make sure the reactor is running when the test method is executed to
71+ # work around the linked Twisted bug.
72+ return task.deferLater(reactor, 0, lambda: None)
73
74 def test_representation(self):
75 """`RecordingSlave` has a custom representation.
76
77=== modified file 'lib/lp/codehosting/codeimport/tests/test_workermonitor.py'
78--- lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2009-11-23 19:56:19 +0000
79+++ lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2009-11-25 03:10:42 +0000
80@@ -17,7 +17,7 @@
81 from bzrlib.branch import Branch
82 from bzrlib.tests import TestCase as BzrTestCase
83
84-from twisted.internet import defer, error, protocol, reactor
85+from twisted.internet import defer, error, protocol, reactor, task
86 from twisted.trial.unittest import TestCase as TrialTestCase
87
88 from zope.component import getUtility
89@@ -597,6 +597,11 @@
90 def setUp(self):
91 TestWorkerMonitorIntegration.setUp(self)
92 self._protocol = None
93+ # XXX 2009-11-23, MichaelHudson,
94+ # bug=http://twistedmatrix.com/trac/ticket/2078: This is a hack to
95+ # make sure the reactor is running when the test method is executed to
96+ # work around the linked Twisted bug.
97+ return task.deferLater(reactor, 0, lambda: None)
98
99 def performImport(self, job_id):
100 """Perform the import job with ID job_id.
101
102=== modified file 'lib/lp/codehosting/puller/tests/test_scheduler.py'
103--- lib/lp/codehosting/puller/tests/test_scheduler.py 2009-11-21 01:47:27 +0000
104+++ lib/lp/codehosting/puller/tests/test_scheduler.py 2009-11-25 03:10:42 +0000
105@@ -17,7 +17,7 @@
106 from bzrlib.branch import Branch
107 from bzrlib.bzrdir import BzrDir
108
109-from twisted.internet import defer, error
110+from twisted.internet import defer, error, reactor, task
111 from twisted.protocols.basic import NetstringParseError
112 from twisted.python import failure
113 from twisted.trial.unittest import TestCase as TrialTestCase
114@@ -660,6 +660,11 @@
115 self.bzr_tree.commit('rev1')
116 self.pushToBranch(self.db_branch, self.bzr_tree)
117 self.client = FakePullerEndpointProxy()
118+ # XXX 2009-11-23, MichaelHudson,
119+ # bug=http://twistedmatrix.com/trac/ticket/2078: This is a hack to
120+ # make sure the reactor is running when the test method is executed to
121+ # work around the linked Twisted bug.
122+ return task.deferLater(reactor, 0, lambda: None)
123
124 def run(self, result):
125 # We want to use Trial's run() method so we can return Deferreds.
126
127=== removed symlink 'lib/twisted'
128=== target was u'../sourcecode/twisted/twisted/'
129=== modified file 'setup.py'
130--- setup.py 2009-10-31 12:07:16 +0000
131+++ setup.py 2009-11-25 03:10:42 +0000
132@@ -43,6 +43,7 @@
133 'mocker',
134 'oauth',
135 'paramiko',
136+ 'pyasn1',
137 'python-openid',
138 'pytz',
139 # This appears to be a broken indirect dependency from zope.security:
140@@ -51,6 +52,7 @@
141 'sourcecodegen',
142 'storm',
143 'transaction',
144+ 'Twisted',
145 'wadllib',
146 'z3c.pt',
147 'z3c.ptcompat',
148
149=== modified file 'versions.cfg'
150--- versions.cfg 2009-11-21 00:03:53 +0000
151+++ versions.cfg 2009-11-25 03:10:42 +0000
152@@ -38,6 +38,7 @@
153 paramiko = 1.7.4
154 Paste = 1.7.2
155 PasteDeploy = 1.3.3
156+pyasn1 = 0.0.9a
157 pycrypto = 2.0.1
158 python-openid = 2.2.1
159 pytz = 2009l
160@@ -50,6 +51,7 @@
161 sourcecodegen = 0.6.9
162 storm = 0.15
163 transaction = 1.0.0
164+Twisted = 9.0.0
165 uuid = 1.30
166 van.testing = 2.0.1
167 wadllib = 1.1.4