Skip to content

Commit

Permalink
Readme (#2)
Browse files Browse the repository at this point in the history
* add readme based on package docstring

* lint
  • Loading branch information
MusicalNinjaDad authored May 21, 2024
1 parent 12f79f8 commit 38e4e51
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.
6 changes: 3 additions & 3 deletions pyo3_stubgen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
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 runnin `pyigen`.
imported before running `pyo3_stubgen`.
Despite flake8's recommendation to the contrary, `pyigen` adds docstrings to the `.pyi` files so that IDEs can
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 `pyigen` only generates info for functions. Classes are on the to-do list.
Currently `pyo3_stubgen` only generates info for functions. Classes are on the to-do list.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "pyo3-stubgen"
description = "Enable hinting for pyo3 extension modules by generating type and docstring stubs"
# readme = "README.md"
readme = "README.md"
license = { text = "MIT" }
authors = [{ name = "Mike Foster" }]
dynamic = ["version"]
Expand Down

0 comments on commit 38e4e51

Please sign in to comment.