/
dist3.py
523 lines (494 loc) · 16.9 KB
/
dist3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# -*- test-case-name: twisted.python.test.test_dist3 -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for installing Twisted on Python 3.
Only necessary while parts of Twisted are unported.
@var modules: A list of modules that have been ported,
e.g. "twisted.python.versions"; a package name (e.g. "twisted.python")
indicates the corresponding __init__.py file has been ported
(e.g. "twisted/python/__init__.py"). To reduce merge conflicts, add new
lines in alphabetical sort.
@var testModules: A list of test modules that have been ported, e.g
"twisted.python.test.test_versions". To reduce merge conflicts, add new
lines in alphabetical sort.
@var testDataFiles: A list of filenames that are data files used by tests.
These are generally used by another Python process that the test case
spawns.
@var almostModules: A list of any other modules which are needed by any of the
modules in the other two lists, but which themselves have not actually
been properly ported to Python 3. These modules might work well enough to
satisfy some of the requirements of the modules that depend on them, but
cannot be considered generally usable otherwise.
@var modulesToInstall: A list of all modules that should be installed on
Python 3.
"""
from __future__ import division
from os import path
modules = [
"twisted",
"twisted._version",
"twisted.application",
"twisted.application.app",
"twisted.application.internet",
"twisted.application.reactors",
"twisted.application.service",
"twisted.application.strports",
"twisted.application.test",
"twisted.conch",
"twisted.conch.ssh",
"twisted.conch.ssh.common",
"twisted.conch.ssh.keys",
"twisted.conch.ssh.sexpy",
"twisted.conch.test",
"twisted.copyright",
"twisted.cred",
"twisted.cred._digest",
"twisted.cred.checkers",
"twisted.cred.credentials",
"twisted.cred.error",
"twisted.cred.portal",
"twisted.cred.test",
"twisted.internet",
"twisted.internet._baseprocess",
"twisted.internet._glibbase",
"twisted.internet._newtls",
"twisted.internet._posixstdio",
"twisted.internet._posixserialport",
"twisted.internet._signals",
"twisted.internet._win32serialport",
"twisted.internet.abstract",
"twisted.internet.address",
"twisted.internet.base",
"twisted.internet.default",
"twisted.internet.defer",
"twisted.internet.endpoints",
"twisted.internet.epollreactor",
"twisted.internet.error",
"twisted.internet.fdesc",
"twisted.internet.gireactor",
"twisted.internet.gtk3reactor",
"twisted.internet.interfaces",
"twisted.internet.kqreactor",
"twisted.internet.main",
"twisted.internet.pollreactor",
"twisted.internet.posixbase",
"twisted.internet.process",
"twisted.internet.protocol",
"twisted.internet.reactor",
"twisted.internet.selectreactor",
"twisted.internet.serialport",
"twisted.internet.ssl",
"twisted.internet.stdio",
"twisted.internet.task",
"twisted.internet.tcp",
"twisted.internet.test",
"twisted.internet.test._posixifaces",
"twisted.internet.test.connectionmixins",
"twisted.internet.test.modulehelpers",
"twisted.internet.test.reactormixins",
"twisted.internet.threads",
"twisted.internet.udp",
"twisted.internet.unix",
"twisted.internet.utils",
"twisted.logger",
"twisted.logger._buffer",
"twisted.logger._file",
"twisted.logger._filter",
"twisted.logger._flatten",
"twisted.logger._format",
"twisted.logger._global",
"twisted.logger._io",
"twisted.logger._json",
"twisted.logger._legacy",
"twisted.logger._levels",
"twisted.logger._logger",
"twisted.logger._observer",
"twisted.logger._stdlib",
"twisted.logger._util",
"twisted.logger.test",
"twisted.names",
"twisted.names._rfc1982",
"twisted.names._version",
"twisted.names.cache",
"twisted.names.client",
"twisted.names.common",
"twisted.names.dns",
"twisted.names.error",
"twisted.names.hosts",
"twisted.names.resolve",
"twisted.names.test",
"twisted.persisted",
"twisted.persisted.aot",
"twisted.persisted.crefutil",
"twisted.persisted.sob",
"twisted.persisted.styles",
"twisted.plugin",
"twisted.plugins",
"twisted.plugins.cred_sshkeys",
"twisted.plugins.twisted_trial",
"twisted.plugins.twisted_web",
"twisted.positioning",
"twisted.positioning._sentence",
"twisted.positioning.base",
"twisted.positioning.ipositioning",
"twisted.positioning.nmea",
"twisted.protocols",
"twisted.protocols.amp",
"twisted.protocols.basic",
"twisted.protocols.policies",
"twisted.protocols.test",
"twisted.protocols.tls",
"twisted.python",
"twisted.python._tzhelper",
"twisted.python._url",
"twisted.python.compat",
"twisted.python.components",
"twisted.python.constants",
"twisted.python.context",
"twisted.python.deprecate",
"twisted.python.dist3",
"twisted.python.failure",
"twisted.python.filepath",
"twisted.python.lockfile",
"twisted.python.log",
"twisted.python.modules",
"twisted.python.monkey",
"twisted.python.procutils",
"twisted.python.randbytes",
"twisted.python.reflect",
"twisted.python.roots",
"twisted.python.runtime",
"twisted.python.sendmsg",
"twisted.python.systemd",
"twisted.python.test",
"twisted.python.test.deprecatedattributes",
"twisted.python.test.modules_helpers",
"twisted.python.threadable",
"twisted.python.threadpool",
"twisted.python.url",
"twisted.python.urlpath",
"twisted.python.usage",
"twisted.python.util",
"twisted.python.versions",
"twisted.python.zippath",
"twisted.scripts",
"twisted.scripts._twistd_unix",
"twisted.scripts.trial",
"twisted.scripts.twistd",
"twisted.test",
"twisted.test.iosim",
"twisted.test.proto_helpers",
"twisted.test.ssl_helpers",
"twisted._threads",
"twisted._threads._convenience",
"twisted._threads._ithreads",
"twisted._threads._memory",
"twisted._threads._pool",
"twisted._threads._team",
"twisted._threads._threadworker",
"twisted.trial",
"twisted.trial._asyncrunner",
"twisted.trial._asynctest",
"twisted.trial._synctest",
"twisted.trial.itrial",
"twisted.trial.reporter",
"twisted.trial.runner",
"twisted.trial.test",
"twisted.trial.test.detests",
"twisted.trial.test.erroneous",
"twisted.trial.test.packages",
"twisted.trial.test.skipping",
"twisted.trial.test.suppression",
"twisted.trial.test.suppression",
"twisted.trial.unittest",
"twisted.trial.util",
"twisted.web",
"twisted.web._auth",
"twisted.web._auth.basic",
"twisted.web._auth.digest",
"twisted.web._auth.wrapper",
"twisted.web._element",
"twisted.web._flatten",
"twisted.web._newclient",
"twisted.web._responses",
"twisted.web._stan",
"twisted.web._version",
"twisted.web.demo",
"twisted.web.error",
"twisted.web.guard",
"twisted.web.http_headers",
"twisted.web.proxy",
"twisted.web.resource",
"twisted.web.script",
"twisted.web.static",
"twisted.web.tap",
"twisted.web.template",
"twisted.web.test",
"twisted.web.test.requesthelper",
"twisted.web.util",
"twisted.web.vhost",
"twisted.web.wsgi",
"twisted.web.xmlrpc",
]
testModules = [
"twisted.application.test.test_internet",
"twisted.application.test.test_service",
"twisted.conch.test.test_keys",
"twisted.cred.test.test_cramauth",
"twisted.cred.test.test_cred",
"twisted.cred.test.test_digestauth",
"twisted.cred.test.test_simpleauth",
"twisted.cred.test.test_strcred",
"twisted.internet.test.test_abstract",
"twisted.internet.test.test_address",
"twisted.internet.test.test_base",
"twisted.internet.test.test_core",
"twisted.internet.test.test_default",
"twisted.internet.test.test_endpoints",
"twisted.internet.test.test_epollreactor",
"twisted.internet.test.test_fdset",
"twisted.internet.test.test_filedescriptor",
"twisted.internet.test.test_gireactor",
"twisted.internet.test.test_glibbase",
"twisted.internet.test.test_inlinecb",
"twisted.internet.test.test_kqueuereactor",
"twisted.internet.test.test_main",
"twisted.internet.test.test_newtls",
"twisted.internet.test.test_posixbase",
"twisted.internet.test.test_posixprocess",
"twisted.internet.test.test_process",
"twisted.internet.test.test_protocol",
"twisted.internet.test.test_serialport",
"twisted.internet.test.test_sigchld",
"twisted.internet.test.test_stdio",
"twisted.internet.test.test_tcp",
"twisted.internet.test.test_threads",
"twisted.internet.test.test_tls",
"twisted.internet.test.test_udp",
"twisted.internet.test.test_udp_internals",
"twisted.internet.test.test_unix",
"twisted.logger.test.test_buffer",
"twisted.logger.test.test_file",
"twisted.logger.test.test_filter",
"twisted.logger.test.test_flatten",
"twisted.logger.test.test_format",
"twisted.logger.test.test_global",
"twisted.logger.test.test_io",
"twisted.logger.test.test_json",
"twisted.logger.test.test_legacy",
"twisted.logger.test.test_levels",
"twisted.logger.test.test_logger",
"twisted.logger.test.test_observer",
"twisted.logger.test.test_stdlib",
"twisted.logger.test.test_util",
"twisted.names.test.test_cache",
"twisted.names.test.test_client",
"twisted.names.test.test_common",
"twisted.names.test.test_dns",
"twisted.names.test.test_hosts",
"twisted.names.test.test_rfc1982",
"twisted.names.test.test_util",
"twisted.persisted.test.test_styles",
"twisted.positioning.test.test_base",
"twisted.positioning.test.test_nmea",
"twisted.positioning.test.test_sentence",
"twisted.protocols.test.test_basic",
"twisted.protocols.test.test_tls",
"twisted.python.test.test_components",
"twisted.python.test.test_constants",
"twisted.python.test.test_deprecate",
"twisted.python.test.test_dist3",
"twisted.python.test.test_runtime",
"twisted.python.test.test_sendmsg",
"twisted.python.test.test_systemd",
"twisted.python.test.test_tzhelper",
"twisted.python.test.test_url",
"twisted.python.test.test_urlpath",
"twisted.python.test.test_util",
"twisted.python.test.test_versions",
"twisted.python.test.test_zippath",
"twisted.test.test_abstract",
"twisted.test.test_amp",
"twisted.test.test_application",
"twisted.test.test_compat",
"twisted.test.test_context",
"twisted.test.test_cooperator",
"twisted.test.test_defer",
"twisted.test.test_defgen",
"twisted.test.test_error",
"twisted.test.test_factories",
"twisted.test.testutils",
"twisted.test.test_failure",
"twisted.test.test_fdesc",
"twisted.test.test_internet",
"twisted.test.test_iosim",
"twisted.test.test_iutils",
"twisted.test.test_lockfile",
"twisted.test.test_log",
"twisted.test.test_logfile",
"twisted.test.test_loopback",
"twisted.test.test_modules",
"twisted.test.test_monkey",
"twisted.test.test_paths",
"twisted.test.test_plugin",
"twisted.test.test_persisted",
"twisted.test.test_policies",
"twisted.test.test_process",
"twisted.test.test_randbytes",
"twisted.test.test_reflect",
"twisted.test.test_roots",
"twisted.test.test_sob",
"twisted.test.test_ssl",
"twisted.test.test_sslverify",
"twisted.test.test_stdio",
"twisted.test.test_strports",
"twisted.test.test_task",
"twisted.test.test_tcp",
"twisted.test.test_tcp_internals",
"twisted.test.test_threadable",
"twisted.test.test_threadpool",
"twisted.test.test_threads",
"twisted.test.test_twisted",
"twisted.test.test_twistd",
"twisted.test.test_udp",
"twisted.test.test_unix",
"twisted.test.test_usage",
"twisted._threads.test.test_convenience",
"twisted._threads.test.test_memory",
"twisted._threads.test.test_team",
"twisted._threads.test.test_threadworker",
"twisted.trial.test.test_assertions",
"twisted.trial.test.test_asyncassertions",
"twisted.trial.test.test_deferred",
"twisted.trial.test.test_doctest",
"twisted.trial.test.test_keyboard",
"twisted.trial.test.test_loader",
"twisted.trial.test.test_log",
"twisted.trial.test.test_output",
"twisted.trial.test.test_plugins",
"twisted.trial.test.test_pyunitcompat",
"twisted.trial.test.test_reporter",
"twisted.trial.test.test_runner",
"twisted.trial.test.test_script",
"twisted.trial.test.test_suppression",
"twisted.trial.test.test_testcase",
"twisted.trial.test.test_tests",
"twisted.trial.test.test_util",
"twisted.trial.test.test_warning",
"twisted.web.test._util",
"twisted.web.test.test_agent",
"twisted.web.test.test_error",
# The downloadPage tests weren't ported:
"twisted.web.test.test_http",
"twisted.web.test.test_flatten",
"twisted.web.test.test_http_headers",
"twisted.web.test.test_httpauth",
"twisted.web.test.test_newclient",
"twisted.web.test.test_proxy",
"twisted.web.test.test_resource",
"twisted.web.test.test_script",
"twisted.web.test.test_stan",
"twisted.web.test.test_static",
"twisted.web.test.test_tap",
"twisted.web.test.test_template",
"twisted.web.test.test_util",
"twisted.web.test.test_web",
"twisted.web.test.test_web__responses",
"twisted.web.test.test_webclient",
"twisted.web.test.test_vhost",
"twisted.web.test.test_wsgi",
"twisted.web.test.test_xmlrpc",
]
testDataFiles = [
"twisted.conch.test.keydata",
"twisted.internet.test.process_cli",
"twisted.internet.test.process_helper",
"twisted.positioning.test.receiver",
"twisted.python.test.pullpipe",
"twisted.python.test.pullpipe",
"twisted.test._preamble",
"twisted.test.plugin_basic",
"twisted.test.plugin_extra1",
"twisted.test.plugin_extra2",
"twisted.test.process_cmdline",
"twisted.test.process_echoer",
"twisted.test.process_fds",
"twisted.test.process_linger",
"twisted.test.process_reader",
"twisted.test.process_signal",
"twisted.test.process_stdinreader",
"twisted.test.process_tester",
"twisted.test.process_tty",
"twisted.test.process_twisted",
"twisted.test.stdio_test_consumer",
"twisted.test.stdio_test_halfclose",
"twisted.test.stdio_test_hostpeer",
"twisted.test.stdio_test_lastwrite",
"twisted.test.stdio_test_loseconn",
"twisted.test.stdio_test_producer",
"twisted.test.stdio_test_write",
"twisted.test.stdio_test_writeseq",
"twisted.trial.test.mockdoctest",
"twisted.trial.test.moduleself",
"twisted.trial.test.moduletest",
"twisted.trial.test.novars",
"twisted.trial.test.ordertests",
"twisted.trial.test.packages",
"twisted.trial.test.sample",
"twisted.trial.test.scripttest",
]
almostModules = [
# Required for Trial
"twisted.python.logfile",
# Missing test coverage, see #6156:
"twisted.internet._sslverify",
# twisted.names.client semi-depends on twisted.names.root, but only on
# Windows really:
"twisted.names.root",
# Echo is ported for twisted.application tests:
"twisted.protocols.wire",
# Required by twisted.test.test_twistd
# https://twistedmatrix.com/trac/ticket/7958
"twisted.python.fakepwd",
# Missing test coverage:
"twisted.protocols.loopback",
# Minimally used by setup3.py:
"twisted.python.dist",
# twisted.python.filepath depends on twisted.python.win32, but on Linux it
# only really needs to import:
"twisted.python.win32",
"twisted.test.reflect_helper_IE",
"twisted.test.reflect_helper_VE",
"twisted.test.reflect_helper_ZDE",
# Agent code and downloadPage aren't ported, test coverage isn't complete:
"twisted.web.client",
# Required by twisted.web.server, no actual code here:
"twisted.web.iweb",
# Required by twisted.web.server for an error handling case:
"twisted.web.html",
# This module has a lot of missing test coverage. What tests it has pass,
# but it needs a lot more. It was ported only enough to make the client
# work.
"twisted.web.http",
# GzipEncoder and allowed methods functionality not ported, no doubt
# missing lots of test coverage:
"twisted.web.server",
]
def _processDataFileList(dataFiles):
"""
Turn a list of file names into a format that distutils likes.
For example:
["foo/bar.py", "baz/spam.py"]
...is transformed into...
[("foo", ["foo/bar.py"]), ("baz", "baz/spam.py")]
"""
files = {}
for file in dataFiles:
pathFragments = file.split(".")
targetDir = path.sep.join(pathFragments[:-1])
if not files.get(targetDir):
files[targetDir] = []
files[targetDir].append(path.sep.join(pathFragments) + ".py")
return list(files.items())
modulesToInstall = modules + testModules + almostModules