| Version 11 (modified by itamar, 9 months ago) |
|---|
Objective
To have Twisted available on Python 3.3 and newer, with the same functionality as is currently available on Python 2.x.
Strategy
- Single source - The result will be a version of Twisted that is source-compatible with Python 2.6, Python 2.7, and Python 3.3.
- Test-driven - Following the standard Twisted development process, all changed code will be fully automatically unit tested.
- Opportunistic - Where module dependencies (within Twisted) need to be ported to support porting of the high-priority modules, modules may be split so that only some of their contents need to be ported.
All other standard Twisted development practices apply.
An initial minimal project (http://twistedmatrix.com/trac/milestone/Python%203.3%20Minimal) is being funded by Canonical and implemented by Future Foundries LLC (i.e. Itamar and Jean-Paul), with the aim of getting a basic subset of Twisted working, sufficient to run a specific Canonical project. If that is done and any time is left over in the contract, it will be spent doing more porting, so help by other developers will hopefully result in more of Twisted being ported.
Reviewer check list
- Tests pass under 3.3.
- Ported modules were added to list of ported modules (location TBD).
- No warnings when running using -3 mode under Python 2.7.
- All non-docstring strings are clearly marked as one of the various string categories (bytes/unicode/identifier/version-dependent).
- No use of 'str'.
- from __future__ import division was added to the module.
- Verify dictionary methods were ported correctly.
Details
- Bootstrap the testing system
- Port the non-reactor parts of trial necessary to run the tests for the non-reactor parts of trial
- Refactor the implementation to separate the reactor and non-reactor parts into separate source files
- Add more tests for uncovered functionality
- Get the non-reactor parts passing their own tests on Python 3.3 (alpha, until 3.3 is actually released)
- Test-driven port of the dependencies of the reactor features of trial
- Test-driven port of the reactor features of trial
- Port the non-reactor parts of trial necessary to run the tests for the non-reactor parts of trial
- setup.py should only install ported modules on Python 3.
- Test-driven port of the following modules (some of which may be dependencies of above steps):
- twisted.cred
- twisted.internet.defer
- twisted.trial
- twisted.internet.gireactor
- twisted.internet.selectreactor
- twisted.internet.pollreactor
- twisted.internet.ssl
- twisted.protocols.basic
- twisted.web
- client
- http
- resource
- server
- http_headers
- twisted.internet
- abstract
- reactor
- endpoints
- protocol
- interfaces
- error
- task
- twisted.python
- failure
- log
- util
- procutils
- twisted.names
- twisted.application
- internet
- service
- Build-slave for Python 3.3 should only run ported test modules.
- Strings
- Python 2 largely conflates text and bytes in the str type, but offers unicode for unambiguous text usage.
- Python 3 reduces the functionality of the str type and renames it to bytes, reflecting the intent that it be used for bytes only. It renames the unicode type to str.
- There is a third kind of string, used to represent Python identifiers and docstrings. These are bytes in Python 2 and text in Python 3.
- Running trial --version requires the following modules:
twisted twisted.application twisted.application.app twisted.application.reactors twisted.application.service twisted.copyright twisted.internet twisted.internet.defer twisted.internet.protocol twisted.internet.utils twisted.persisted twisted.persisted.sob twisted.persisted.styles twisted.plugin twisted.python twisted.python.compat twisted.python.components twisted.python.context twisted.python.deprecate twisted.python.failure twisted.python.filepath twisted.python.hashlib twisted.python.hook twisted.python._initgroups twisted.python.lockfile twisted.python.log twisted.python.logfile twisted.python.modules twisted.python.monkey twisted.python.runtime twisted.python.text twisted.python.threadable twisted.python.usage twisted.python.util twisted.python.versions twisted.python.win32 twisted.python.zippath twisted.scripts.trial twisted.trial twisted.trial.itrial twisted.trial.reporter twisted.trial.runner twisted.trial.unittest twisted._version
Ideally we could omit a number of them:- `twisted.python.hook (#5860)
- twisted.python._initgroups (#4920)
- twisted.python.deprecate - we will not be porting deprecated code, presumably, so hopefully we can omit the module.
- twisted.python.win32 - windows is not a target platform for the initial release.
- twisted.persisted.sob and twisted.persisted.styles - this is all useless and/or terrible.
- No doubt some others we can get away with only porting part of the module.
