Typing Stubs for PyGObject
Installation
With uv:
uv add --dev pygobject-stubs
With pip:
pip install pygobject-stubs
Configuration
Some libraries exist in multiple versions like Gtk3/4.
As both libraries are currently imported under the namespace Gtk only stubs for one can be installed.
You need to decide this at install time either by using the --config-settings option with pip:
pip install pygobject-stubs --no-cache-dir --config-settings=config=Gtk3,Gdk3,Soup2
or by setting the PYGOBJECT_STUB_CONFIG env variable:
PYGOBJECT_STUB_CONFIG=Gtk3,Gdk3,Soup2 pip install --no-cache-dir pygobject-stubs
If no configuration is set, the most recent version of each library is installed.
--no-cache-dir is only necessary on subsequent reinstalls, otherwise the stubs will not be rebuild and a cache of a previous installation is used.
uv
[tool.uv]
config-settings-package = { pygobject-stubs = { config = "Gtk3,Gdk3,Soup2" } }
poetry
https://python-poetry.org/docs/configuration/#installerbuild-config-settingspackage-name
Project Integration
Usually you want the stubs to be installed as part of the development dependencies.
pyproject.toml does not allow to pass config-settings to requirements.
If you need specific versions of some libraries you can use a requirements.txt file instead, which allows to pass config-settings per requirement as of pip >= 23.1.0.
pip install . -r dev.txt
Contributing
Metadata
Release files for PyGObject-stubs 2.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygobject_stubs-2.20.0.tar.gz | 1.1 MB | Without provenance | Details for pygobject_stubs-2.20.0.tar.gz |
Release files / pygobject_stubs-2.20.0.tar.gz
| Download URL | pygobject_stubs-2.20.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd61ebf27a893e3b162e0dfb84d80de92ef33f8fdf144298e178239934bce8df
|
|
BLAKE2b-256 checksum How to use checksums |
5b1320718103f5e697c5b6b4d91fd32f0a4e3f4f6e3c4990ffe4d5c3bf5ec598
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for PyGObject-stubs 2.20.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.