Skip to main content

Generate PEP 561 stubs for the GObject introspection library. Forked from fakegir

Project description

GenGIR: Genuine* autocompletion for your PyGObject code!

fakegir is a tool to build a fake python package of PyGObject modules.

GenGIR is a fork of fakegir that uses modern standards and improves on usability

The main changes are:

  • Use PEP 484 type annotations instead of docstrings
  • Install typings as a PEP 561 stub
  • Use Sphinx markup on docstrings
  • A cli

GenGIR stores the type info inside your user or venv site-packages as a package named gi-stubs.
Once it's installed, it should be recognized by your IDE and it should provide autocompletion and typing errors.

Building

This project uses poetry, so make sure to have that installed

Then run poetry install and poetry build. A wheel file should be created in the dist directory that can be installed using pip install ./dist/gengir*.whl

Usage

The *.gir with the type info files should be included with each GNOME library development package in /usr/share/gir-1.0/.

gengir [OPTIONS] [TYPES]...

  Generate PEP 561 stubs for the GObject introspection library.

Arguments:
  [TYPES]...  Files to use as input for the generator. If not provided it uses
              all files in /usr/share/gir-1.0/

Options:
  -o, --outdir PATH               Directory to store the package typings.
                                  $site-packages/gi-stubs by default
  --docs / --no-docs              Include docstrings in the typings  [default:
                                  docs]
  --gtk INTEGER                   GTK version to generate typings for
                                  [default: 3]

Editor support

  • VSCode has support for stub packages out of the box.
  • Jedi supports it too, so any editor using it should work.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gengir-1.0.1.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gengir-1.0.1-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file gengir-1.0.1.tar.gz.

File metadata

  • Download URL: gengir-1.0.1.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.9 Linux/5.15.5-arch1-1

File hashes

Hashes for gengir-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dfb50c5c5f06dece1ff897aa22f99e79fde666475d22b8be655c3550af2e0958
MD5 8597db695bc060ae3e8e8040bf5b4e71
BLAKE2b-256 de4e111419a63c9d419519c7a98cd2f7ddff61a6a897771954bef478c0227e65

See more details on using hashes here.

File details

Details for the file gengir-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gengir-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.9 Linux/5.15.5-arch1-1

File hashes

Hashes for gengir-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a59777b30a9e665b1132b4be2ecde4d7b40db9c49a7908bc2118ac500dd20b9
MD5 d62d266a6e4815c58bb493bd6f9ab835
BLAKE2b-256 ea410a1a7da9fd82375432c16d3679110e099ce3e9cdbb1304d48b71417fd0ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page