Metadata-Version: 2.4
Name: PyGObject-stubs
Version: 2.16.0
Summary: Typing stubs for PyGObject
Author: Christoph Reiter
Author-email: reiter.christoph@gmail.com
License: LGPL-2.1
Project-URL: homepage, https://github.com/pygobject/pygobject-stubs
Project-URL: repository, https://github.com/pygobject/pygobject-stubs
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing_extensions
Provides-Extra: dev
Requires-Dist: codespell>=2.4.1; extra == "dev"
Requires-Dist: isort>=6.0.1; extra == "dev"
Requires-Dist: ruff>=0.12.7; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: PyGObject; extra == "dev"
Dynamic: license-file

# Typing Stubs for PyGObject

[![PyPI](https://img.shields.io/pypi/v/pygobject-stubs)](https://pypi.org/project/PyGObject-stubs)

## Installation

With uv:
```shell
uv add --dev pygobject-stubs
```

With pip:
```shell
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:

```shell
pip install pygobject-stubs --no-cache-dir --config-settings=config=Gtk3,Gdk3,Soup2
```

or by setting the `PYGOBJECT_STUB_CONFIG` env variable:

```shell
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.

```shell
pip install . -r dev.txt
```

## Contributing

[Guide](./CONTRIBUTING.md)
