Enable hinting for pyo3 extension modules by generating type and docstring stubs
Project description
pyo3-stubgen
pyo3-stubgen
generates .pyi
typing files for extension modules which were written in rust with pyo3.
It is designed to work for extension modules created in rust with pyo3 but should work with any compiled extension
modules which include a __text_signature__
and optionally a __doc__
attribute for functions.
The package containing the module must be installed in the current virtual environment, but does not need to be
imported before running pyo3_stubgen
.
Despite flake8's recommendation to the contrary, pyo3_stubgen
adds docstrings to the .pyi
files so that IDEs can
provide them in hover pop-ups.
You will need to manually add the typing information to the generated files as this is not included in any of the function attributes available.
Currently pyo3_stubgen
only generates info for functions. Classes are on the to-do list.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyo3_stubgen-0.1.0.tar.gz
.
File metadata
- Download URL: pyo3_stubgen-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae886f3242b662a994fb5f7ce11462673bf28268def8869db21e52fc19f7f96d |
|
MD5 | 8c6fb0c2817dc7764fec26fca48f582e |
|
BLAKE2b-256 | 1a9219fd90d566afc6aa3cf9bd4fd7ac613277d804e453c194c53734435313ae |
File details
Details for the file pyo3_stubgen-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pyo3_stubgen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3abd0728fbdee8182efea1f7745cfa97234fee9118aadcaadf5e36fde2992379 |
|
MD5 | 2a5ea328ce68540b360cbda89ecc22e1 |
|
BLAKE2b-256 | d9db19c2064fd605d8ce30edf4779833c886782a094a7575753519e020b46bf9 |