Skip to content

Installing Stubs

Obtaining a Stubs Package will enhance code auto-completion and provide type annotations in your editor. To enable this feature, you’ll need to install one of the following packages, each of which has its own installation guide.

GenGir

GenGir generates a stubs package and installs it for you, whether for global Python packages or a virtual environment. Also the maintainer’s personal favorite tool out of these options.

FakeGir

FakeGir is a Python script that generates an overrides file for your editor to use; it’s not considered a real stubs package because you will have to configure your editor to use the overrides file instead of the hints from the code.

PyGObject-Stubs

PyGObject provides a Python package that gives you an advanced auto-completions experience. Yet. It’s not perfect - not all gi repositories are type-annotated or docstringed. This works if you’re planning to stick to the documentation of GTK and Fabric.

Fabric Stubs

There is an ongoing process to write a stubs package made to be used with Fabric based on a refined version of the stubs produced by GenGir. This package is not yet public, though that may change in the future…