Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python package: export type stubs #282

Open
chrysn opened this issue May 23, 2024 · 2 comments
Open

Python package: export type stubs #282

chrysn opened this issue May 23, 2024 · 2 comments

Comments

@chrysn
Copy link
Collaborator

chrysn commented May 23, 2024

Right now when you run mypy on a project with lakers, mypy doesn't find the stubs:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install lakers
$ echo "import lakers" > some.py
$ mypy --install-types .
test.py:1: error: Cannot find implementation or library stub for module named "lakers"  [import-not-found]
test.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

I'd expect that typing information is available somewhere to pyo3, maybe we just have to enable exporting it. I'm not sure how it is done, and have a similar issue open at chrysn/cbor-diag-py#2

Until this is resolved, users such as aiocoap will use mypy overrides to disable type checking around lakers (and link to this issue, which is one of the major reasons I'm creating an issue for it ;-) ).

@geonnave
Copy link
Collaborator

Apparently automatic stub file generation is not (yet) available on pyo3. There is some ongoing work here: PyO3/pyo3#2454

@chrysn
Copy link
Collaborator Author

chrysn commented May 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants