RFC: CI limitations and using 'six' module for python2/3 compatability

Garming Sam garming at catalyst.net.nz
Tue Apr 17 00:20:59 UTC 2018


I would have some reservations about using six. The last time I talked
to Andrew, he felt quite strongly about the matter too. The overall
summary of the concern is that we would be left at a half-way point
which is neither purely-standard Python 2 nor Python 3 (as well as
gaining the additional dependency on six). If the distros are as serious
about dropping support for Python 2 as they claim, then having pure
Python 3 would be preferable. The last thing I would want is a secondary
effort required just to remove six as a dependency and rewrite it in
Python 3 anyways.

If the consensus really is to use six, at the very least I would propose
that we use it in as constrained a way as possible. The straightforward
renames and the example with urllib seem reasonable enough. On the other
hand, using pretty much any of the six object model (or even syntax
compatibility) does not seem like a particularly great idea in my view.

(In regards to Gitlab, it needs to be added to the list of dependencies
and then an image rebuilt).



On 17/04/18 04:01, Noel Power via samba-technical wrote:
> Hi team,
> I like to start a discussion about the use of 'six' (a python2/3
> compatability layer api) https://pythonhosted.org/six/
> Recently I have code across a couple of instances where I wanted to use
> the 'six' library to port some samba python code to be python2/python3
> compatible. Currently it is not possible to use 'six' as the CI machine
> does not have it installed. I guess it is likely (I don't know) that the
> autobuild machines also don't have it, does someone know ?
> What is the possibility of getting the 'six' library in place it the CI
> (and/or) autobuild machines?
> For the moment my approach is to use the existing python/samba/compat.py
> (currently not used) see attached patch [1] But.. I fear this is going
> to become poor relation 'six' clone, my hope is using and extending this
> is a temporary measure until we can kill it and replace it with six. The
> transition from compat to six should be trivial e.g. and example of code
> using the the existing content of the compat.py could be changed as follows
>   -from samba.compat import urllib_quote
>   +from six.moves.urllib.parse import urllib_quote
> Thoughts?
> Noel
> [1] Note: not really looking for a review of this patch but rather the
> issue of the missing 'six' However this is part of 
> https://github.com/samba-team/samba/pull/161 :-)

More information about the samba-technical mailing list