On Thu, 2015-04-16 at 09:54 -0400, Ken Giusti wrote:
> Hi all,
> 
> I'm building on the work done by Dominic and Mickael to get all the proton 
> python bits to work under both python2 and python3.   See [1].
> 
> I think this will entail a lot of little changes to the python sources and 
> the unit tests.  Rather than check in a single huge patch, I'm going to break 
> it up over several patches.
> 
> The first bunch of patches will simply 'modernize' the existing python code.  
> Old style syntax that is not forward compatible with python 3 will be 
> replaced (eg. print "foo" --> print("foo"), etc).  I'll use a tool called 
> 'futurize' which is part of the python future toolset [2], [3]. 
> 
> Once all python code is updated, then I'll begin introducing python 3 
> specific patches, including the work already done by Dominic and Mickael.  Of 
> course I'll verify that none of these changes will break python 2.   I've got 
> a local CI system that can build/test in both environments.
> 
> From a discussion with Dominic, we agreed that it would be A Good Thing to 
> use one of the existing Py2 <--> Py3 abstraction libraries.  These libraries 
> provide utilities for writing code that works under both python versions.  
> I've used 'six' in the past [4] and found it quite helpful - it will 
> eliminate a lot of the messy conditional code one has to hack in order to 
> support both languages.
> 
> However, this library is not part of the standard python library.  This means 
> introducing a new dependency.
> 
> Personally, I don't think this is a big deal - use of 'six' is ubiquitous 
> among python packages.  It's available freely via pypi, and though most 
> distros.
> 
> So that's the Big Question - is everyone comfortable with this additional 
> dependency?   Does anyone have a better alternative?  Has anyone ported other 
> large python codebases - what was your experience?
> 
> thanks,
> 
> -K
> 
> 
> [1] https://issues.apache.org/jira/browse/PROTON-490
> [2] http://python-future.org/index.html
> [3] http://python-future.org/futurize_cheatsheet.html
> [4] https://pythonhosted.org/six/
> 

+1. The fact that six is a single python file means we can easily fork
it into proton if the dependency becomes a problem (which it probably
wont.)


Reply via email to