On Montag, 15. April 2013, 13:39:22 wrote Michal Vyskocil:
On Fri, Apr 12, 2013 at 04:42:22PM +0200, Marcus Hüwe wrote:
Hi Michal,
On 2013-04-12 14:30:42 +0200, Michal Vyskocil wrote:
my hackweek project was to port osc to Python3. The goal has been achived, I've a series of around 20 patches changing the codebase of osc to be compatible with python 2.6, 2.7 and 3.3. That means all test have passed in both three languages on the same codebase.
That sounds great!:)
However the M2Crypto does not have a python3 port. I've spent one day with a porting effort, but I've realized there is already some initial work done by RedHat guys at
https://bugzilla.osafoundation.org/show_bug.cgi?id=12853
so I will need to compare mcepl's branch with my patchset first.
For now this would only be an issue for python3 users.
For that reason I am reluctant to issue a pull request for a code, which was not (and can't properly be) tested in a real world.
Hmm well as long as your patches work with python 2.6 and 2.7 I'm fine with it. Even if M2Crypto doesn't work with python3 yet it's still a big improvement IMHO.
The downside is the code does not run on python 2.5 and olders. Speaking in a terms of a distributions, the following ones will become incompatible with the new code - Centos 5, Debian 5.0, RHEL 4, RHEL 5, SLE10. Not sure about Ubuntu 9 - it have 2.5 at least.
However all targets are quite old and mostly without a general support available, therefor I'd say they can be turned off and we can agree that python 2.6 is the lowest supported Python version in current osc codebase.
+1
So should I made a pull request adding python3 support?
I don't have any strong objection against it (except that there's no "print" statement anymore but that's not your fault:) - so hopefully I'll quickly get used to the new syntax...).
If anyone else has objections please raise your voice:)
BTW: patches are ftp://ftp.suse.com/pub/people/mvyskocil/osc3/, if you want to take a look before a pull request. They use some runtime quirks to stay compatible, but the biggest change is -print.patch, which is done by 2to3 as a mostly mechanical change.
I just had a very quick glance at your patches so I don't have many comments yet.
0009-python3-compatibility-use-relative-imports.patch:
I'm not sure if this is a good idea at least PEP8 [1] discourages the use of relative imports but I'll need to check if that's still true for recent python versions...
Hi Marcus,
I am neither the fan of relative imports - they are somewhat cryptic and hard to debug as all you get is the 'cannot import foo' error without any explanation. However check the 'What's new'[1][2] document/Removed syntax.
""" The only acceptable syntax for relative imports is from .[module] import name. All import forms not starting with . are interpreted as absolute imports. (PEP 0328) """
Where PEP 0328 claims
""" You may use relative imports freely. In Python 2.6, any import statement that results in an intra-package import will raise DeprecationWarning (this also applies to from <> import that fails to use the relative import syntax). """
and last but not least, the 'import' fixture is enabled by default in 2to3.
[1] file:///usr/share/doc/packages/python3/html/whatsnew/3.0.html [2] http://docs.python.org/3/whatsnew/index.html [3] http://www.python.org/dev/peps/pep-0328/
Thanks for the positive feedback, I've issued the pull request https://github.com/openSUSE/osc/pull/25
I have merged this now and tried to build it using python3 on openSUSE. Unfortunatly it fails currently, do you have an idea why? Please check the new devel package here: osc rblt devel:tools:scm/osc openSUSE_12.3 x86_64 thanks adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org