1. paj
  2. tw2.core
  3. Issues
Issue #103 new

Ramifications of a port to Python 3

Graham Higgins
created an issue

I enquired generally whether there'd been any preliminary work on a port to Python 3 and Ralph suggested I raise a ticket [1]. I slightly regret bringing up the subject ...

In the post, I mentioned that I was intending to take a quick look at the likely issues. This I have done, to the extent of making a /very/ heavy-handed port - the only install dependencies to survive are WebOb and (for Py2) simplejson. Of the testing dependencies, only nose, formencode, webtest and strainer remain.

"Ran 217 tests in 0.911s FAILED (SKIP=1, errors=29, failures=7)"

Management summary: so much blood on the carpet that there's a (weak) argument for a Py3-only version/rewrite. It's a moot point whether enough of tw2 would survive a Py3 port to be recognisable as the same package.

  • There's no WSGI as yet in PY3 (and even if one does eventually get adopted, I doubt that people will be in a rush to use it), so all the middleware WSGI and resource injection code becomes irrelevant.

  • Paste won't get ported, so the commands module becomes irrelevant.

  • Of the listed template engines, only Mako has a Py3 port

There are two specific dependencies that present significant issues:

  • formencode: allegedly, a port of formencode to Py3 is intended at some point (I used one I prepared earlier)

  • strainer: tests have an extensive dependency on strainer. Long-term, this would seem to require either a fork-and-port-to-py3 of strainer (I did enough to get it to work) or a comprehensive rewrite of the tw2core test suite.

I can make the bloody remains available but it's not for the squeamish. It /is/ feasible to maintain a both2and3 version of tw2core/tw2.forms but I'm not sure that it'll be perceived as desirable.

[1] https://groups.google.com/forum/#!msg/toscawidgets-discuss/PCs_5FyHL-A/L_wVDLWwcCEJ

tox output attached for the benefit of the terminally curious.



Comments (0)

  1. Log in to comment