GNOME Bugzilla – Bug 732478
[patch] add python3 support to gnome-shell
Last modified: 2014-11-07 09:20:31 UTC
Created attachment 279600 [details] [review] Make gnome-shell python3 compatible Hi, I'm attaching a patch that adds python3 support to gnome-shell, while maintaining python >= 2.6 compatibility. I used the python-six library [1] to do this. It is a very small dependency that is used by most projects that need both python2 and python3 compatibility, so I hope that's ok for gnome-shell, too. Thanks for considering! [1] http://pythonhosted.org/six/
ust found out that this should block bug 684666...
(In reply to comment #0) > Created an attachment (id=279600) [details] [review] > Make gnome-shell python3 compatible > > Hi, I'm attaching a patch that adds python3 support to gnome-shell, while > maintaining python >= 2.6 compatibility. Why? A quick look through https://wiki.gnome.org/Initiatives/GnomeGoals/Python3Porting didn't turn up any other modules that used that approach, so I don't see why we should not just unconditionally move to python3 at this point ...
(In reply to comment #2) > (In reply to comment #0) > > Created an attachment (id=279600) [details] [review] [details] [review] > > Make gnome-shell python3 compatible > > > > Hi, I'm attaching a patch that adds python3 support to gnome-shell, while > > maintaining python >= 2.6 compatibility. > > Why? A quick look through > https://wiki.gnome.org/Initiatives/GnomeGoals/Python3Porting didn't turn up any > other modules that used that approach, so I don't see why we should not just > unconditionally move to python3 at this point ... The page says "For modules which have to support both python 2 and 3, add a --with-python configure option; look at pygobject for an example ", but I found no list of modules that should keep both 2 and 3 compat - so I assumed it's better to keep it. I have no problem whatsoever with modifying the patch to be Python 3 only, if that's what you'd like to see :)
(In reply to comment #3) > The page says "For modules which have to support both python 2 and 3, add a > --with-python configure option; look at pygobject for an example " That makes sense for anything that installs python modules used by other modules, which does not apply to the two small scripts in gnome-shell - so yes, I'd prefer a "real" port to python3.
(In reply to comment #4) > (In reply to comment #3) > > The page says "For modules which have to support both python 2 and 3, add a > > --with-python configure option; look at pygobject for an example " > > That makes sense for anything that installs python modules used by other > modules, which does not apply to the two small scripts in gnome-shell - so yes, > I'd prefer a "real" port to python3. It also makes sense for projects that want to be in base installs of distributions that don't want to move to Python 3 yet - on my "Python 3 as a Default in Fedora 22" adventure, I've met few of those. Anyway, I'll send a new python 3 only patch shortly. Thanks.
(In reply to comment #5) > It also makes sense for projects that want to be in base installs of > distributions that don't want to move to Python 3 yet That's a downstream issue - if they care, they can revert the change or patch out the two scripts completely (neither one is required to run gnome-shell)
Created attachment 284813 [details] [review] Port gnome-shell to Python 3 only I did some simple testing, everything seems to work fine on Python 3.
Review of attachment 284813 [details] [review]: - configure still asks for a python version >= 2.5 - check-for-missing.py is a helper script that is never installed, so porting doesn't seem too urgent; however if you do, than don't assume that /usr/bin/python is python3
Created attachment 284816 [details] [review] Fix deficiencies of previous patch This fixes: - hashbang usage in check-for-missing.py - checking for Python 3 (only) in configure.ac Thanks for the review.
Review of attachment 284816 [details] [review]: LGTM - can you attach a git-format'ted version? (Or I could do this before pushing if you want me to)
Created attachment 284818 [details] [review] 'git format'ted version of the previous patch
Review of attachment 284818 [details] [review]: LGTM