https://github.com/pygobject/pgi
[Unmaintained: Use PyGObject instead] GTK+ / GObject Introspection Bindings for PyPy.
https://github.com/pygobject/pgi
Last synced: 5 months ago
JSON representation
[Unmaintained: Use PyGObject instead] GTK+ / GObject Introspection Bindings for PyPy.
- Host: GitHub
- URL: https://github.com/pygobject/pgi
- Owner: pygobject
- License: lgpl-2.1
- Created: 2012-02-16T19:15:23.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T16:01:31.000Z (over 1 year ago)
- Last Synced: 2025-09-08T12:53:56.046Z (7 months ago)
- Language: Python
- Homepage:
- Size: 1.62 MB
- Stars: 74
- Watchers: 7
- Forks: 16
- Open Issues: 20
-
Metadata Files:
- Readme: README.rst
- Changelog: NEWS
- License: COPYING
Awesome Lists containing this project
README
PGI - Pure Python GObject Introspection Bindings
================================================
GObject Introspection bindings written in pure Python using ctypes_
and cffi_ (optional). API compatible with PyGObject_.
**Development Status:**
WARNING: Lots of things are not implemented/supported.
See the 'examples' directory for working examples.
Anything else will probably not work.
**Code:** https://github.com/lazka/pgi
**License:** LGPL 2.1+
**Requirements:**
- CPython_ 2.7 or CPython_ 3.3+ or PyPy_ 1.9+ or PyPy3_ 2.3+
- libgirepository_ 1.0
- cffi_ 0.8+ (optional, but needed for tests)
- cairocffi_ 0.4+ (optional, for cairo support)
.. _ctypes: http://docs.python.org/2/library/ctypes.html
.. _cffi: http://cffi.readthedocs.org/en/latest/
.. _cairocffi: http://pythonhosted.org/cairocffi/
.. _PyGObject: http://git.gnome.org/browse/pygobject/
.. _libgirepository: http://git.gnome.org/browse/gobject-introspection/
.. _CPython: http://www.python.org/
.. _PyPy: http://pypy.org/
.. _PyPy3: http://pypy.org/
Usage
-----
::
from pgi.repository import Gtk, GObject
or (preferred)
::
import pgi
pgi.install_as_gi()
from gi.repository import Gtk, GObject
Search paths
~~~~~~~~~~~~
Typelibs will be loaded from paths in the environment variable
`GI_TYPELIB_PATH` and `/usr/lib/girepository-1.0/`.
Shared libraries from paths in `LD_LIBRARY_PATH` and the default system
search paths (see dlopen(3)).
Documentation
-------------
PGI docs:
* https://pgi.readthedocs.org
Autogenerated GI docs:
* https://github.com/lazka/pgi-docgen
* http://lazka.github.io/pgi-docs
Tests
-----
.. image:: https://travis-ci.org/lazka/pgi.svg?branch=master
:target: https://travis-ci.org/lazka/pgi
- `./setup.py test` will run unit tests using PGI and PyGObject
- `./setup.py test --pgi-only` to skip PyGObject tests
- `./setup.py test --filter=StructTest` to run tests which include
`StructTest` (regexp)
`./tests/libs/` includes additional libraries that will be used for testing
if present. Call `make` in `./tests/libs/` to build them.
- `./setup.py quality` will run pep8 and pyflakes tests
- `./setup.py coverage` will create a test coverage report