Sunday 21 June 2015

Removing Python 2.7 from Gentoo, one port at a time.

I'm highly motivated, as a Pythonista who loves Python 3 and all of the new features, syntax, and improvements, to help the rest of the community upgrade to Python 3 and enjoy all of its benefits.

To that end, I would like to end the dependence of Python 2 in the general community. Since I feel I am a fairly average power user of Gentoo, I figured I would start with the packages on my own system, and this is what I found:

  dev-lang/python-2.7.10 pulled in by:
    app-emulation/qemu-2.3.0-r2
    app-emulation/virtualbox-4.3.28
    app-misc/ca-certificates-20141019.3.19
    app-text/gnome-doc-utils-0.20.10-r1
    dev-lang/spidermonkey-1.8.5-r4
    dev-lang/spidermonkey-17.0.0-r3
    dev-lang/spidermonkey-24.2.0-r2
    dev-lang/yasm-1.3.0
    dev-libs/glib-2.44.1
    dev-libs/gobject-introspection-1.44.0
    dev-libs/libevdev-1.4
    dev-libs/libgamin-0.1.10-r5
    dev-libs/libnatspec-0.2.6-r1
    dev-libs/libxslt-1.1.28-r4
    dev-libs/protobuf-2.6.1-r3
    dev-libs/zziplib-0.13.62
    dev-python/google-apputils-0.4.0
    dev-python/ipaddress-1.0.7
    dev-python/librsvg-python-2.32.0-r1
    dev-python/m2crypto-0.22.3-r3
    dev-python/ndg-httpsclient-0.3.2
    dev-python/pygobject-2.28.6-r55
    dev-python/pygoocanvas-0.14.1-r1
    dev-python/python-gflags-2.0
    dev-python/twisted-core-15.2.1
    dev-python/wxpython-3.0.2.0
    dev-util/boost-build-1.56.0
    dev-util/scons-2.3.4
    dev-vcs/git-2.4.3
    dev-vcs/mercurial-3.4.1
    games-emulation/m64py-0.2.1-r1
    gnome-base/gconf-3.2.6-r3
    gnome-base/libglade-2.6.4-r2
    kde-apps/kajongg-4.14.3
    kde-base/krosspython-4.14.3
    kde-base/plasma-workspace-4.11.20
    media-gfx/gimp-2.8.14
    media-libs/alsa-lib-1.0.29
    media-libs/avidemux-plugins-2.6.8
    media-libs/libcaca-0.99_beta19
    media-libs/libgpod-0.8.3
    media-video/openshot-1.4.3
    net-analyzer/nmap-6.49_beta1
    net-dns/avahi-0.6.31-r7
    net-libs/farstream-0.1.2-r2
    net-libs/gupnp-0.20.14
    net-libs/libproxy-0.4.11-r2
    net-print/cups-2.0.2-r2
    net-wireless/crda-3.18
    sys-apps/usbutils-008-r1
    sys-devel/llvm-3.5.2
    sys-process/audit-2.4.1-r1
    sys-process/htop-1.0.3
    www-client/firefox-38.0.1
    x11-libs/xpyb-1.3.1-r3
    x11-plugins/purple-plugin_pack-2.7.0-r1

Not terrible for a world that has 1,277 packages. Now, we can wipe some of those off:

dev-lang/spidermonkey, www-client/firefox
The Mozilla build system...
dev-libs/protobuf, dev-python/google-apputils, dev-python/ipaddress, dev-python/python-gflags-2.0
I can't make Google care about Python 3. I'm just a lone fox.
dev-python/ndg-httpsclient
This is apparently only pulled in because I have 2.7 compatibility enabled on other packages, and it also appears abandoned upstream.
dev-python/m2crypto
All but deprecated upstream. dev-python/cryptography pretty cleanly replaces it. I simply need to change dependencies to use that instead.
dev-python/twisted-*
The Twisted project is large, and already has a Python 3 objective. No need to worry about that until later, since they have others working on it.
dev-python/wxpython
They, too, are working on an official Python 3 port already. I've even used it; though it is ridiculously unstable, there has been a lot of progress made.
dev-util/scons
As of August 2014, they are officially porting to Python 3. Same as Twisted, then.
dev-vcs/mercurial
This is a very large codebase with a lot of issues related to 2->3. Not something one fox can help with either, I'm afraid.
any gnome package
Not really interested in contributing to the ever-dying and unmaintained GTK 2, and definitely not interested in contributing to the abomination of GTK 3.
KDE 4
As KDE 5 nears stability, this will become less and less maintained, so it probably isn't worth it either.
net-print/cups, sys-devel/llvm
I doubt there is any hope of getting Python 3 code into Apple projects, since they seem to enjoy clinging to 1990-era development tech :(

After doing some sorting to show the order I'd like to work on these, this leaves us with:

    app-misc/ca-certificates-20141019.3.19
    app-emulation/virtualbox-4.3.28
    dev-libs/libevdev-1.4
    media-libs/libcaca-0.99_beta19
    media-libs/libgpod-0.8.3
    media-libs/alsa-lib-1.0.29
    dev-libs/libxslt-1.1.28-r4
    net-wireless/crda-3.18
    dev-vcs/git-2.4.3
    sys-apps/usbutils-008-r1
    dev-lang/yasm-1.3.0
    x11-plugins/purple-plugin_pack-2.7.0-r1
    sys-process/audit-2.4.1-r1
    net-dns/avahi-0.6.31-r7
    sys-process/htop-1.0.3
    games-emulation/m64py-0.2.1-r1
    net-libs/libproxy-0.4.11-r2
    dev-libs/zziplib-0.13.62
    dev-libs/libnatspec-0.2.6-r1
    app-emulation/qemu-2.3.0-r2
    net-analyzer/nmap-6.49_beta1
    dev-util/boost-build-1.56.0
    media-video/openshot-1.4.3
    media-libs/avidemux-plugins-2.6.8
    x11-libs/xpyb-1.3.1-r3

I would really like to do at least one per week, but there's no guarantees of course. Wish me luck!

2 comments :

  1. Good luck!

    I would also like to do away with python2.7 on gentoo due to dependency hell, _bsddb bsddb185 dl imageop sunaudiodev build bits not found, so modules _hashlib and _ssl can't be built!

    ReplyDelete
    Replies
    1. Just sorted this problem. Both python2.7 and 3.4 need openssl-1.0 to compile. So openssl-1.1 needs to be downgraded to openssl-1.1, along with the removal of skype and ruby.

      Delete