[apparmor] python 3 requirement in the parser's tests

Steve Beattie steve at nxnw.org
Fri Oct 25 23:49:25 UTC 2013


On Thu, Oct 24, 2013 at 11:06:33PM +0200, Christian Boltz wrote:
> Am Mittwoch, 23. Oktober 2013 schrieb Steve Beattie:
> > The downside to this approach is that the way metaclasses are declared
> > changed between python 2 and python 3 in an incompatible way. Since
> > python 3 is The Futureâ„¢, I chose that approach and made the caching
> > and valgrind tests which use testlib be python3 (until this change,
> > they would have worked under either python 2 or python 3).
> 
> I think requiring py3 for the parser tests is OK because it doesn't
> restrict what we test[1], and a "BuildRequires: python3" is acceptable
> when it makes things easier on the programming side.

I agree. That said, we should not go out of our way to break python 2
compatibility (particularly with the amount of python 3 improvements
that upstream backported to python 2.7) unless forced to, or the
means of doing so are too ugly.

> [1] Things would be different if you'd test _python code_ only with py3,
>     even if it's written to run with py2 also

Absolutely. I should point out that the python tests for the
libapparmor python swig bindings run under python 2 and 3 and it is
my intent that the compatibility there be maintained, to ensure the
continued proper functioning of those python bindings under python 2.
This is also true of the aa-easyprof tests, as aa-easyprof is intended
to support both variants of Python.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20131025/2b2cbb64/attachment.pgp>


More information about the AppArmor mailing list