google / google/tensorstore

Generate `.pyi` files for type inference compatibility

Open
#92 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
1.5k
Forks
145
PR merge metrics
No merged PRs in 30d

Description

Currently Pylance - the language server used by the VSCode python extension - doesn't play nice with the cpython compiled shared object files:

![image](https://user-images.githubusercontent.com/11380482/230215386-2f105efc-c40f-459e-8527-e057a1f72bfc.png)

However, if you use `mypy`'s `stubgen` program you can automatically generate `.pyi` files that allow the internal types to be exposed:

`cd $(dirname $(python3 -c "import tensorstore; print(tensorstore.__file__)")) && stubgen -p tensorstore -o ../`

![image](https://user-images.githubusercontent.com/11380482/230215755-49bedacc-89a5-4c0b-9b5a-1881cd755b20.png)

Would be nice to ship these inside the pypi package.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.