PyPy & PyGObject¶
You can now run applications using PyGObject with PyPy. This requires PyPy(2/3) 5.10+ and (for now) PyGObject master and makes it possible to use libraries such as GTK+, GStreamer and WebKitGTK+ with PyPy.
Things are currently slower and use more memory than with CPython. I have only focused on getting the pycairo and pygobject test suites to pass for now.
First we set up the basics with PyPy3:
./pypy3/bin/pypy -m venv _venv source _venv/bin/activate python -m pip install pycairo # pycairo also supports PyPy now python -m pip install git+https://gitlab.gnome.org/GNOME/pygobject.git
Let’s try the first GTK+ example from the PyGObject tutorial:
Something more complex, a music player written in Python:
python -m pip install mutagen feedparser git clone https://github.com/quodlibet/quodlibet.git python quodlibet/quodlibet/quodlibet.py
And finally, an interactive matplotlib example:
python -m pip install matplotlib curl -O https://raw.githubusercontent.com/matplotlib/matplotlib/master/examples/event_handling/path_editor.py python path_editor.py
Everything just works 😁
If something doesn’t please file a bug: https://gitlab.gnome.org/GNOME/pygobject