Merge ~cjwatson/launchpad-buildd:unsixify into launchpad-buildd:master
- Git
- lp:~cjwatson/launchpad-buildd
- unsixify
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 894faff97953dcc1fe013c4d160b48bae2bb887a |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad-buildd:unsixify |
Merge into: | launchpad-buildd:master |
Diff against target: |
485 lines (+49/-70) 24 files modified
bin/test_buildd_generatetranslationtemplates (+1/-2) bin/test_buildd_recipe (+1/-2) debian/changelog (+6/-0) debian/control (+0/-1) lpbuildd/builder.py (+4/-4) lpbuildd/ci.py (+4/-4) lpbuildd/debian.py (+4/-4) lpbuildd/livefs.py (+2/-3) lpbuildd/oci.py (+4/-5) lpbuildd/pottery/tests/test_intltool.py (+1/-1) lpbuildd/proxy.py (+4/-4) lpbuildd/snap.py (+2/-3) lpbuildd/target/build_snap.py (+1/-2) lpbuildd/target/chroot.py (+0/-6) lpbuildd/target/lxd.py (+0/-5) lpbuildd/target/snapstore.py (+3/-2) lpbuildd/target/tests/test_chroot.py (+1/-2) lpbuildd/target/tests/test_lxd.py (+1/-3) lpbuildd/tests/fakebuilder.py (+4/-5) lpbuildd/tests/test_buildd.py (+2/-2) lpbuildd/tests/test_builder.py (+1/-4) lpbuildd/tests/test_buildrecipe.py (+3/-4) setup.py (+0/-1) system-dependencies.txt (+0/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrey Fedoseev (community) | Approve | ||
Review via email: mp+429742@code.launchpad.net |
Commit message
Remove use of six
Description of the change
To post a comment you must log in.
Revision history for this message
Andrey Fedoseev (andrey-fedoseev) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/bin/test_buildd_generatetranslationtemplates b/bin/test_buildd_generatetranslationtemplates | |||
2 | index e981ef0..9cce305 100755 | |||
3 | --- a/bin/test_buildd_generatetranslationtemplates | |||
4 | +++ b/bin/test_buildd_generatetranslationtemplates | |||
5 | @@ -6,8 +6,7 @@ | |||
6 | 6 | # TranslationTemplatesBuildManager through XMLRPC. | 6 | # TranslationTemplatesBuildManager through XMLRPC. |
7 | 7 | 7 | ||
8 | 8 | import sys | 8 | import sys |
11 | 9 | 9 | from xmlrpc.client import ServerProxy | |
10 | 10 | from six.moves.xmlrpc_client import ServerProxy | ||
12 | 11 | 10 | ||
13 | 12 | if len(sys.argv) != 2: | 11 | if len(sys.argv) != 2: |
14 | 13 | print("Usage: %s <chroot_sha1>" % sys.argv[0]) | 12 | print("Usage: %s <chroot_sha1>" % sys.argv[0]) |
15 | diff --git a/bin/test_buildd_recipe b/bin/test_buildd_recipe | |||
16 | index 89803e6..9090688 100755 | |||
17 | --- a/bin/test_buildd_recipe | |||
18 | +++ b/bin/test_buildd_recipe | |||
19 | @@ -6,8 +6,7 @@ | |||
20 | 6 | # recipe, without involving the BuilderBehaviour. | 6 | # recipe, without involving the BuilderBehaviour. |
21 | 7 | 7 | ||
22 | 8 | import sys | 8 | import sys |
25 | 9 | 9 | from xmlrpc.client import ServerProxy | |
24 | 10 | from six.moves.xmlrpc_client import ServerProxy | ||
26 | 11 | 10 | ||
27 | 12 | country_code = 'us' | 11 | country_code = 'us' |
28 | 13 | apt_cacher_ng_host = 'stumpy' | 12 | apt_cacher_ng_host = 'stumpy' |
29 | diff --git a/debian/changelog b/debian/changelog | |||
30 | index b10ccb5..aa2253a 100644 | |||
31 | --- a/debian/changelog | |||
32 | +++ b/debian/changelog | |||
33 | @@ -1,3 +1,9 @@ | |||
34 | 1 | launchpad-buildd (222) UNRELEASED; urgency=medium | ||
35 | 2 | |||
36 | 3 | * Remove use of six. | ||
37 | 4 | |||
38 | 5 | -- Colin Watson <cjwatson@ubuntu.com> Mon, 12 Sep 2022 09:50:13 +0100 | ||
39 | 6 | |||
40 | 1 | launchpad-buildd (221) focal; urgency=medium | 7 | launchpad-buildd (221) focal; urgency=medium |
41 | 2 | 8 | ||
42 | 3 | [ Andy Whitcroft ] | 9 | [ Andy Whitcroft ] |
43 | diff --git a/debian/control b/debian/control | |||
44 | index a9e3850..b881694 100644 | |||
45 | --- a/debian/control | |||
46 | +++ b/debian/control | |||
47 | @@ -23,7 +23,6 @@ Build-Depends: apt-utils, | |||
48 | 23 | python3-requests, | 23 | python3-requests, |
49 | 24 | python3-responses, | 24 | python3-responses, |
50 | 25 | python3-setuptools, | 25 | python3-setuptools, |
51 | 26 | python3-six, | ||
52 | 27 | python3-systemfixtures, | 26 | python3-systemfixtures, |
53 | 28 | python3-testtools, | 27 | python3-testtools, |
54 | 29 | python3-twisted (>= 16.4.0), | 28 | python3-twisted (>= 16.4.0), |
55 | diff --git a/lpbuildd/builder.py b/lpbuildd/builder.py | |||
56 | index 336594c..2f256ad 100644 | |||
57 | --- a/lpbuildd/builder.py | |||
58 | +++ b/lpbuildd/builder.py | |||
59 | @@ -14,15 +14,15 @@ import re | |||
60 | 14 | import shutil | 14 | import shutil |
61 | 15 | import sys | 15 | import sys |
62 | 16 | import tempfile | 16 | import tempfile |
66 | 17 | 17 | from urllib.request import ( | |
64 | 18 | import apt | ||
65 | 19 | from six.moves.urllib.request import ( | ||
67 | 20 | build_opener, | 18 | build_opener, |
68 | 21 | HTTPBasicAuthHandler, | 19 | HTTPBasicAuthHandler, |
69 | 22 | HTTPPasswordMgrWithDefaultRealm, | 20 | HTTPPasswordMgrWithDefaultRealm, |
70 | 23 | urlopen, | 21 | urlopen, |
71 | 24 | ) | 22 | ) |
73 | 25 | from six.moves.xmlrpc_client import Binary | 23 | from xmlrpc.client import Binary |
74 | 24 | |||
75 | 25 | import apt | ||
76 | 26 | from twisted.internet import protocol | 26 | from twisted.internet import protocol |
77 | 27 | from twisted.internet import reactor as default_reactor | 27 | from twisted.internet import reactor as default_reactor |
78 | 28 | from twisted.internet import process | 28 | from twisted.internet import process |
79 | diff --git a/lpbuildd/ci.py b/lpbuildd/ci.py | |||
80 | index 3401aae..c49a24c 100644 | |||
81 | --- a/lpbuildd/ci.py | |||
82 | +++ b/lpbuildd/ci.py | |||
83 | @@ -1,14 +1,14 @@ | |||
84 | 1 | # Copyright 2022 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2022 Canonical Ltd. This software is licensed under the |
85 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
86 | 3 | 3 | ||
87 | 4 | from configparser import ( | ||
88 | 5 | NoOptionError, | ||
89 | 6 | NoSectionError, | ||
90 | 7 | ) | ||
91 | 4 | import os | 8 | import os |
92 | 5 | import tempfile | 9 | import tempfile |
93 | 6 | import yaml | 10 | import yaml |
94 | 7 | 11 | ||
95 | 8 | from six.moves.configparser import ( | ||
96 | 9 | NoOptionError, | ||
97 | 10 | NoSectionError, | ||
98 | 11 | ) | ||
99 | 12 | from twisted.internet import defer | 12 | from twisted.internet import defer |
100 | 13 | 13 | ||
101 | 14 | from lpbuildd.debian import ( | 14 | from lpbuildd.debian import ( |
102 | diff --git a/lpbuildd/debian.py b/lpbuildd/debian.py | |||
103 | index 5cb47e7..f66bf27 100644 | |||
104 | --- a/lpbuildd/debian.py | |||
105 | +++ b/lpbuildd/debian.py | |||
106 | @@ -5,14 +5,14 @@ | |||
107 | 5 | # and Adam Conrad <adam.conrad@canonical.com> | 5 | # and Adam Conrad <adam.conrad@canonical.com> |
108 | 6 | 6 | ||
109 | 7 | import base64 | 7 | import base64 |
110 | 8 | from configparser import ( | ||
111 | 9 | NoOptionError, | ||
112 | 10 | NoSectionError, | ||
113 | 11 | ) | ||
114 | 8 | import os | 12 | import os |
115 | 9 | import re | 13 | import re |
116 | 10 | import signal | 14 | import signal |
117 | 11 | 15 | ||
118 | 12 | from six.moves.configparser import ( | ||
119 | 13 | NoOptionError, | ||
120 | 14 | NoSectionError, | ||
121 | 15 | ) | ||
122 | 16 | from twisted.internet import ( | 16 | from twisted.internet import ( |
123 | 17 | defer, | 17 | defer, |
124 | 18 | threads, | 18 | threads, |
125 | diff --git a/lpbuildd/livefs.py b/lpbuildd/livefs.py | |||
126 | index f627e76..3cc2fb3 100644 | |||
127 | --- a/lpbuildd/livefs.py | |||
128 | +++ b/lpbuildd/livefs.py | |||
129 | @@ -1,12 +1,11 @@ | |||
130 | 1 | # Copyright 2013-2019 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2013-2019 Canonical Ltd. This software is licensed under the |
131 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
132 | 3 | 3 | ||
136 | 4 | import os | 4 | from configparser import ( |
134 | 5 | |||
135 | 6 | from six.moves.configparser import ( | ||
137 | 7 | NoOptionError, | 5 | NoOptionError, |
138 | 8 | NoSectionError, | 6 | NoSectionError, |
139 | 9 | ) | 7 | ) |
140 | 8 | import os | ||
141 | 10 | 9 | ||
142 | 11 | from lpbuildd.debian import ( | 10 | from lpbuildd.debian import ( |
143 | 12 | DebianBuildManager, | 11 | DebianBuildManager, |
144 | diff --git a/lpbuildd/oci.py b/lpbuildd/oci.py | |||
145 | index fdce1aa..e112caf 100644 | |||
146 | --- a/lpbuildd/oci.py | |||
147 | +++ b/lpbuildd/oci.py | |||
148 | @@ -1,6 +1,10 @@ | |||
149 | 1 | # Copyright 2019 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2019 Canonical Ltd. This software is licensed under the |
150 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
151 | 3 | 3 | ||
152 | 4 | from configparser import ( | ||
153 | 5 | NoOptionError, | ||
154 | 6 | NoSectionError, | ||
155 | 7 | ) | ||
156 | 4 | import gzip | 8 | import gzip |
157 | 5 | import hashlib | 9 | import hashlib |
158 | 6 | import json | 10 | import json |
159 | @@ -9,11 +13,6 @@ import shutil | |||
160 | 9 | import tarfile | 13 | import tarfile |
161 | 10 | import tempfile | 14 | import tempfile |
162 | 11 | 15 | ||
163 | 12 | from six.moves.configparser import ( | ||
164 | 13 | NoOptionError, | ||
165 | 14 | NoSectionError, | ||
166 | 15 | ) | ||
167 | 16 | |||
168 | 17 | from lpbuildd.debian import ( | 16 | from lpbuildd.debian import ( |
169 | 18 | DebianBuildManager, | 17 | DebianBuildManager, |
170 | 19 | DebianBuildState, | 18 | DebianBuildState, |
171 | diff --git a/lpbuildd/pottery/tests/test_intltool.py b/lpbuildd/pottery/tests/test_intltool.py | |||
172 | index b540c1d..28ff021 100644 | |||
173 | --- a/lpbuildd/pottery/tests/test_intltool.py | |||
174 | +++ b/lpbuildd/pottery/tests/test_intltool.py | |||
175 | @@ -2,12 +2,12 @@ | |||
176 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
177 | 3 | 3 | ||
178 | 4 | import errno | 4 | import errno |
179 | 5 | from io import StringIO | ||
180 | 5 | import os | 6 | import os |
181 | 6 | import tarfile | 7 | import tarfile |
182 | 7 | from textwrap import dedent | 8 | from textwrap import dedent |
183 | 8 | 9 | ||
184 | 9 | from fixtures import TempDir | 10 | from fixtures import TempDir |
185 | 10 | from six import StringIO | ||
186 | 11 | from testtools import TestCase | 11 | from testtools import TestCase |
187 | 12 | from testtools.matchers import ( | 12 | from testtools.matchers import ( |
188 | 13 | Equals, | 13 | Equals, |
189 | diff --git a/lpbuildd/proxy.py b/lpbuildd/proxy.py | |||
190 | index 9c56780..94a383f 100644 | |||
191 | --- a/lpbuildd/proxy.py | |||
192 | +++ b/lpbuildd/proxy.py | |||
193 | @@ -3,16 +3,16 @@ | |||
194 | 3 | 3 | ||
195 | 4 | import base64 | 4 | import base64 |
196 | 5 | import io | 5 | import io |
199 | 6 | 6 | from urllib.error import ( | |
198 | 7 | from six.moves.urllib.error import ( | ||
200 | 8 | HTTPError, | 7 | HTTPError, |
201 | 9 | URLError, | 8 | URLError, |
202 | 10 | ) | 9 | ) |
205 | 11 | from six.moves.urllib.parse import urlparse | 10 | from urllib.parse import urlparse |
206 | 12 | from six.moves.urllib.request import ( | 11 | from urllib.request import ( |
207 | 13 | Request, | 12 | Request, |
208 | 14 | urlopen, | 13 | urlopen, |
209 | 15 | ) | 14 | ) |
210 | 15 | |||
211 | 16 | from twisted.application import strports | 16 | from twisted.application import strports |
212 | 17 | from twisted.internet import reactor | 17 | from twisted.internet import reactor |
213 | 18 | from twisted.internet.interfaces import IHalfCloseableProtocol | 18 | from twisted.internet.interfaces import IHalfCloseableProtocol |
214 | diff --git a/lpbuildd/snap.py b/lpbuildd/snap.py | |||
215 | index cd90106..07d9f3e 100644 | |||
216 | --- a/lpbuildd/snap.py | |||
217 | +++ b/lpbuildd/snap.py | |||
218 | @@ -1,12 +1,11 @@ | |||
219 | 1 | # Copyright 2015-2019 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2015-2019 Canonical Ltd. This software is licensed under the |
220 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
221 | 3 | 3 | ||
225 | 4 | import os | 4 | from configparser import ( |
223 | 5 | |||
224 | 6 | from six.moves.configparser import ( | ||
226 | 7 | NoOptionError, | 5 | NoOptionError, |
227 | 8 | NoSectionError, | 6 | NoSectionError, |
228 | 9 | ) | 7 | ) |
229 | 8 | import os | ||
230 | 10 | 9 | ||
231 | 11 | from lpbuildd.debian import ( | 10 | from lpbuildd.debian import ( |
232 | 12 | DebianBuildManager, | 11 | DebianBuildManager, |
233 | diff --git a/lpbuildd/target/build_snap.py b/lpbuildd/target/build_snap.py | |||
234 | index 9a8efec..30c5ecc 100644 | |||
235 | --- a/lpbuildd/target/build_snap.py | |||
236 | +++ b/lpbuildd/target/build_snap.py | |||
237 | @@ -7,8 +7,7 @@ import logging | |||
238 | 7 | import os.path | 7 | import os.path |
239 | 8 | import tempfile | 8 | import tempfile |
240 | 9 | from textwrap import dedent | 9 | from textwrap import dedent |
243 | 10 | 10 | from urllib.parse import urlparse | |
242 | 11 | from six.moves.urllib.parse import urlparse | ||
244 | 12 | 11 | ||
245 | 13 | from lpbuildd.target.operation import Operation | 12 | from lpbuildd.target.operation import Operation |
246 | 14 | from lpbuildd.target.proxy import BuilderProxyOperationMixin | 13 | from lpbuildd.target.proxy import BuilderProxyOperationMixin |
247 | diff --git a/lpbuildd/target/chroot.py b/lpbuildd/target/chroot.py | |||
248 | index 27c6e01..11752c8 100644 | |||
249 | --- a/lpbuildd/target/chroot.py | |||
250 | +++ b/lpbuildd/target/chroot.py | |||
251 | @@ -7,8 +7,6 @@ import stat | |||
252 | 7 | import subprocess | 7 | import subprocess |
253 | 8 | import time | 8 | import time |
254 | 9 | 9 | ||
255 | 10 | import six | ||
256 | 11 | |||
257 | 12 | from lpbuildd.target.backend import ( | 10 | from lpbuildd.target.backend import ( |
258 | 13 | Backend, | 11 | Backend, |
259 | 14 | BackendException, | 12 | BackendException, |
260 | @@ -73,10 +71,6 @@ class Chroot(Backend): | |||
261 | 73 | if echo: | 71 | if echo: |
262 | 74 | print("Running in chroot: %s" % ' '.join( | 72 | print("Running in chroot: %s" % ' '.join( |
263 | 75 | shell_escape(arg) for arg in args)) | 73 | shell_escape(arg) for arg in args)) |
264 | 76 | if six.PY2: | ||
265 | 77 | # The behaviour of non-bytes subprocess arguments in Python 2 | ||
266 | 78 | # depends on the interpreter's startup locale. | ||
267 | 79 | args = [arg.encode("UTF-8") for arg in args] | ||
268 | 80 | cmd = ["sudo", "/usr/sbin/chroot", self.chroot_path] + args | 74 | cmd = ["sudo", "/usr/sbin/chroot", self.chroot_path] + args |
269 | 81 | if input_text is None and not get_output: | 75 | if input_text is None and not get_output: |
270 | 82 | subprocess.check_call(cmd, **kwargs) | 76 | subprocess.check_call(cmd, **kwargs) |
271 | diff --git a/lpbuildd/target/lxd.py b/lpbuildd/target/lxd.py | |||
272 | index fbb6f14..d58d9ab 100644 | |||
273 | --- a/lpbuildd/target/lxd.py | |||
274 | +++ b/lpbuildd/target/lxd.py | |||
275 | @@ -16,7 +16,6 @@ import time | |||
276 | 16 | import netaddr | 16 | import netaddr |
277 | 17 | import pylxd | 17 | import pylxd |
278 | 18 | from pylxd.exceptions import LXDAPIException | 18 | from pylxd.exceptions import LXDAPIException |
279 | 19 | import six | ||
280 | 20 | 19 | ||
281 | 21 | from lpbuildd.target.backend import ( | 20 | from lpbuildd.target.backend import ( |
282 | 22 | Backend, | 21 | Backend, |
283 | @@ -532,10 +531,6 @@ class LXD(Backend): | |||
284 | 532 | if echo: | 531 | if echo: |
285 | 533 | print("Running in container: %s" % ' '.join( | 532 | print("Running in container: %s" % ' '.join( |
286 | 534 | shell_escape(arg) for arg in args)) | 533 | shell_escape(arg) for arg in args)) |
287 | 535 | if six.PY2: | ||
288 | 536 | # The behaviour of non-bytes subprocess arguments in Python 2 | ||
289 | 537 | # depends on the interpreter's startup locale. | ||
290 | 538 | args = [arg.encode("UTF-8") for arg in args] | ||
291 | 539 | # pylxd's Container.execute doesn't support sending stdin, and it's | 534 | # pylxd's Container.execute doesn't support sending stdin, and it's |
292 | 540 | # tedious to implement ourselves. | 535 | # tedious to implement ourselves. |
293 | 541 | cmd = ["lxc", "exec", self.name] + env_params + ["--"] + args | 536 | cmd = ["lxc", "exec", self.name] + env_params + ["--"] + args |
294 | diff --git a/lpbuildd/target/snapstore.py b/lpbuildd/target/snapstore.py | |||
295 | index a46bb5a..e087d7e 100644 | |||
296 | --- a/lpbuildd/target/snapstore.py | |||
297 | +++ b/lpbuildd/target/snapstore.py | |||
298 | @@ -1,13 +1,14 @@ | |||
299 | 1 | # Copyright 2019 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2019 Canonical Ltd. This software is licensed under the |
300 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
301 | 3 | 3 | ||
304 | 4 | import requests | 4 | from urllib.parse import ( |
303 | 5 | from six.moves.urllib.parse import ( | ||
305 | 6 | urljoin, | 5 | urljoin, |
306 | 7 | urlparse, | 6 | urlparse, |
307 | 8 | urlunparse, | 7 | urlunparse, |
308 | 9 | ) | 8 | ) |
309 | 10 | 9 | ||
310 | 10 | import requests | ||
311 | 11 | |||
312 | 11 | 12 | ||
313 | 12 | class SnapStoreOperationMixin: | 13 | class SnapStoreOperationMixin: |
314 | 13 | """Methods supporting operations that interact with the snap store.""" | 14 | """Methods supporting operations that interact with the snap store.""" |
315 | diff --git a/lpbuildd/target/tests/test_chroot.py b/lpbuildd/target/tests/test_chroot.py | |||
316 | index e77c455..a8971d3 100644 | |||
317 | --- a/lpbuildd/target/tests/test_chroot.py | |||
318 | +++ b/lpbuildd/target/tests/test_chroot.py | |||
319 | @@ -11,7 +11,6 @@ from fixtures import ( | |||
320 | 11 | EnvironmentVariable, | 11 | EnvironmentVariable, |
321 | 12 | TempDir, | 12 | TempDir, |
322 | 13 | ) | 13 | ) |
323 | 14 | import six | ||
324 | 15 | from systemfixtures import ( | 14 | from systemfixtures import ( |
325 | 16 | FakeProcesses, | 15 | FakeProcesses, |
326 | 17 | FakeTime, | 16 | FakeTime, |
327 | @@ -131,7 +130,7 @@ class TestChroot(TestCase): | |||
328 | 131 | expected_args = [ | 130 | expected_args = [ |
329 | 132 | ["sudo", "/usr/sbin/chroot", | 131 | ["sudo", "/usr/sbin/chroot", |
330 | 133 | "/expected/home/build-1/chroot-autobuild", | 132 | "/expected/home/build-1/chroot-autobuild", |
332 | 134 | "linux64", "echo", arg.encode("UTF-8") if six.PY2 else arg], | 133 | "linux64", "echo", arg], |
333 | 135 | ] | 134 | ] |
334 | 136 | self.assertEqual( | 135 | self.assertEqual( |
335 | 137 | expected_args, | 136 | expected_args, |
336 | diff --git a/lpbuildd/target/tests/test_lxd.py b/lpbuildd/target/tests/test_lxd.py | |||
337 | index 8258d0f..ecf3ddd 100644 | |||
338 | --- a/lpbuildd/target/tests/test_lxd.py | |||
339 | +++ b/lpbuildd/target/tests/test_lxd.py | |||
340 | @@ -20,7 +20,6 @@ from fixtures import ( | |||
341 | 20 | ) | 20 | ) |
342 | 21 | import pylxd | 21 | import pylxd |
343 | 22 | from pylxd.exceptions import LXDAPIException | 22 | from pylxd.exceptions import LXDAPIException |
344 | 23 | import six | ||
345 | 24 | from systemfixtures import ( | 23 | from systemfixtures import ( |
346 | 25 | FakeFilesystem as _FakeFilesystem, | 24 | FakeFilesystem as _FakeFilesystem, |
347 | 26 | FakeProcesses, | 25 | FakeProcesses, |
348 | @@ -645,8 +644,7 @@ class TestLXD(TestCase): | |||
349 | 645 | LXD("1", "xenial", "amd64").run(["echo", arg]) | 644 | LXD("1", "xenial", "amd64").run(["echo", arg]) |
350 | 646 | 645 | ||
351 | 647 | expected_args = [ | 646 | expected_args = [ |
354 | 648 | ["lxc", "exec", "lp-xenial-amd64", "--", | 647 | ["lxc", "exec", "lp-xenial-amd64", "--", "linux64", "echo", arg], |
353 | 649 | "linux64", "echo", arg.encode("UTF-8") if six.PY2 else arg], | ||
355 | 650 | ] | 648 | ] |
356 | 651 | self.assertEqual( | 649 | self.assertEqual( |
357 | 652 | expected_args, | 650 | expected_args, |
358 | diff --git a/lpbuildd/tests/fakebuilder.py b/lpbuildd/tests/fakebuilder.py | |||
359 | index 268fd13..24a40b2 100644 | |||
360 | --- a/lpbuildd/tests/fakebuilder.py | |||
361 | +++ b/lpbuildd/tests/fakebuilder.py | |||
362 | @@ -9,17 +9,16 @@ __all__ = [ | |||
363 | 9 | ] | 9 | ] |
364 | 10 | 10 | ||
365 | 11 | from collections import defaultdict | 11 | from collections import defaultdict |
366 | 12 | from configparser import ( | ||
367 | 13 | NoOptionError, | ||
368 | 14 | NoSectionError, | ||
369 | 15 | ) | ||
370 | 12 | import hashlib | 16 | import hashlib |
371 | 13 | import os | 17 | import os |
372 | 14 | import shutil | 18 | import shutil |
373 | 15 | import stat | 19 | import stat |
374 | 16 | import subprocess | 20 | import subprocess |
375 | 17 | 21 | ||
376 | 18 | from six.moves.configparser import ( | ||
377 | 19 | NoOptionError, | ||
378 | 20 | NoSectionError, | ||
379 | 21 | ) | ||
380 | 22 | |||
381 | 23 | from lpbuildd.target.backend import Backend | 22 | from lpbuildd.target.backend import Backend |
382 | 24 | from lpbuildd.util import ( | 23 | from lpbuildd.util import ( |
383 | 25 | set_personality, | 24 | set_personality, |
384 | diff --git a/lpbuildd/tests/test_buildd.py b/lpbuildd/tests/test_buildd.py | |||
385 | index 3cecb5a..9eb421d 100644 | |||
386 | --- a/lpbuildd/tests/test_buildd.py | |||
387 | +++ b/lpbuildd/tests/test_buildd.py | |||
388 | @@ -19,9 +19,9 @@ import shutil | |||
389 | 19 | import sys | 19 | import sys |
390 | 20 | import tempfile | 20 | import tempfile |
391 | 21 | import unittest | 21 | import unittest |
392 | 22 | from urllib.request import HTTPBasicAuthHandler | ||
393 | 23 | from xmlrpc.client import ServerProxy | ||
394 | 22 | 24 | ||
395 | 23 | from six.moves.urllib.request import HTTPBasicAuthHandler | ||
396 | 24 | from six.moves.xmlrpc_client import ServerProxy | ||
397 | 25 | import twisted | 25 | import twisted |
398 | 26 | 26 | ||
399 | 27 | from lpbuildd.tests.harness import ( | 27 | from lpbuildd.tests.harness import ( |
400 | diff --git a/lpbuildd/tests/test_builder.py b/lpbuildd/tests/test_builder.py | |||
401 | index 1f08126..aee3e4d 100644 | |||
402 | --- a/lpbuildd/tests/test_builder.py | |||
403 | +++ b/lpbuildd/tests/test_builder.py | |||
404 | @@ -10,7 +10,6 @@ import io | |||
405 | 10 | import re | 10 | import re |
406 | 11 | 11 | ||
407 | 12 | from fixtures import TempDir | 12 | from fixtures import TempDir |
408 | 13 | import six | ||
409 | 14 | from testtools import TestCase | 13 | from testtools import TestCase |
410 | 15 | from testtools.deferredruntest import AsynchronousDeferredRunTest | 14 | from testtools.deferredruntest import AsynchronousDeferredRunTest |
411 | 16 | from twisted.internet import defer | 15 | from twisted.internet import defer |
412 | @@ -122,9 +121,7 @@ class TestBuildManager(TestCase): | |||
413 | 122 | "RUN: echo '\N{SNOWMAN}'\n" | 121 | "RUN: echo '\N{SNOWMAN}'\n" |
414 | 123 | "\N{SNOWMAN}\n".encode(), | 122 | "\N{SNOWMAN}\n".encode(), |
415 | 124 | builder._log.getvalue()) | 123 | builder._log.getvalue()) |
416 | 125 | logged_snowman = '\N{SNOWMAN}' if six.PY3 else '\\u2603' | ||
417 | 126 | self.assertEqual( | 124 | self.assertEqual( |
420 | 127 | ["Build log: RUN: echo '%s'" % logged_snowman, | 125 | ["Build log: RUN: echo '\N{SNOWMAN}'", "Build log: \N{SNOWMAN}"], |
419 | 128 | "Build log: %s" % logged_snowman], | ||
421 | 129 | [re.sub(r".*? \[-\] (.*)", r"\1", line) | 126 | [re.sub(r".*? \[-\] (.*)", r"\1", line) |
422 | 130 | for line in self.log_file.getvalue().splitlines()]) | 127 | for line in self.log_file.getvalue().splitlines()]) |
423 | diff --git a/lpbuildd/tests/test_buildrecipe.py b/lpbuildd/tests/test_buildrecipe.py | |||
424 | index 0914c04..32858fa 100644 | |||
425 | --- a/lpbuildd/tests/test_buildrecipe.py | |||
426 | +++ b/lpbuildd/tests/test_buildrecipe.py | |||
427 | @@ -17,7 +17,6 @@ from fixtures import ( | |||
428 | 17 | MockPatchObject, | 17 | MockPatchObject, |
429 | 18 | TempDir, | 18 | TempDir, |
430 | 19 | ) | 19 | ) |
431 | 20 | import six | ||
432 | 21 | from systemfixtures import FakeProcesses | 20 | from systemfixtures import FakeProcesses |
433 | 22 | from testtools import TestCase | 21 | from testtools import TestCase |
434 | 23 | from testtools.matchers import ( | 22 | from testtools.matchers import ( |
435 | @@ -134,7 +133,7 @@ class TestRecipeBuilder(TestCase): | |||
436 | 134 | "grumpy", "main", "PPA", git=True) | 133 | "grumpy", "main", "PPA", git=True) |
437 | 135 | with open(os.path.join(self.builder.work_dir, "recipe"), "w") as f: | 134 | with open(os.path.join(self.builder.work_dir, "recipe"), "w") as f: |
438 | 136 | f.write("dummy recipe contents\n") | 135 | f.write("dummy recipe contents\n") |
440 | 137 | mock_stdout = six.StringIO() | 136 | mock_stdout = io.StringIO() |
441 | 138 | self.useFixture(MockPatch("sys.stdout", mock_stdout)) | 137 | self.useFixture(MockPatch("sys.stdout", mock_stdout)) |
442 | 139 | self.assertEqual(0, self.builder.buildTree()) | 138 | self.assertEqual(0, self.builder.buildTree()) |
443 | 140 | self.assertEqual( | 139 | self.assertEqual( |
444 | @@ -185,7 +184,7 @@ class TestRecipeBuilder(TestCase): | |||
445 | 185 | fake_brz_build_daily_recipe, name="brz-build-daily-recipe") | 184 | fake_brz_build_daily_recipe, name="brz-build-daily-recipe") |
446 | 186 | with open(os.path.join(self.builder.work_dir, "recipe"), "w") as f: | 185 | with open(os.path.join(self.builder.work_dir, "recipe"), "w") as f: |
447 | 187 | f.write("dummy recipe contents\n") | 186 | f.write("dummy recipe contents\n") |
449 | 188 | mock_stdout = six.StringIO() | 187 | mock_stdout = io.StringIO() |
450 | 189 | self.useFixture(MockPatch("sys.stdout", mock_stdout)) | 188 | self.useFixture(MockPatch("sys.stdout", mock_stdout)) |
451 | 190 | self.useFixture(MockPatchObject( | 189 | self.useFixture(MockPatchObject( |
452 | 191 | self.builder, "_is_command_on_path", | 190 | self.builder, "_is_command_on_path", |
453 | @@ -236,7 +235,7 @@ class TestRecipeBuilder(TestCase): | |||
454 | 236 | processes_fixture.add(fake_bzr, name="bzr") | 235 | processes_fixture.add(fake_bzr, name="bzr") |
455 | 237 | with open(os.path.join(self.builder.work_dir, "recipe"), "w") as f: | 236 | with open(os.path.join(self.builder.work_dir, "recipe"), "w") as f: |
456 | 238 | f.write("dummy recipe contents\n") | 237 | f.write("dummy recipe contents\n") |
458 | 239 | mock_stdout = six.StringIO() | 238 | mock_stdout = io.StringIO() |
459 | 240 | self.useFixture(MockPatch("sys.stdout", mock_stdout)) | 239 | self.useFixture(MockPatch("sys.stdout", mock_stdout)) |
460 | 241 | self.useFixture(MockPatchObject( | 240 | self.useFixture(MockPatchObject( |
461 | 242 | self.builder, "_is_command_on_path", return_value=False)) | 241 | self.builder, "_is_command_on_path", return_value=False)) |
462 | diff --git a/setup.py b/setup.py | |||
463 | index 680e2c5..b1bea46 100755 | |||
464 | --- a/setup.py | |||
465 | +++ b/setup.py | |||
466 | @@ -72,7 +72,6 @@ setup( | |||
467 | 72 | # 'python-apt', | 72 | # 'python-apt', |
468 | 73 | 'python-debian', | 73 | 'python-debian', |
469 | 74 | 'requests', | 74 | 'requests', |
470 | 75 | 'six', | ||
471 | 76 | 'Twisted', | 75 | 'Twisted', |
472 | 77 | 'zope.interface', | 76 | 'zope.interface', |
473 | 78 | ], | 77 | ], |
474 | diff --git a/system-dependencies.txt b/system-dependencies.txt | |||
475 | index f4d4bd4..df43d2b 100644 | |||
476 | --- a/system-dependencies.txt | |||
477 | +++ b/system-dependencies.txt | |||
478 | @@ -13,7 +13,6 @@ python3-pylxd | |||
479 | 13 | python3-requests | 13 | python3-requests |
480 | 14 | python3-responses | 14 | python3-responses |
481 | 15 | python3-setuptools | 15 | python3-setuptools |
482 | 16 | python3-six | ||
483 | 17 | python3-systemfixtures | 16 | python3-systemfixtures |
484 | 18 | python3-testtools | 17 | python3-testtools |
485 | 19 | python3-twisted | 18 | python3-twisted |