[FEA]: Add .pyi files so IDEs can provide autocompletion
@mdboom がすでに取り組んでいます。
2025年8月29日 から。
- 主要言語
- Cython
- スター
- 3.4k
- フォーク
- 329
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 113
説明
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this request and that I agree to the Code of Conduct
Area
General cuda-python
Is your feature request related to a problem? Please describe.
Python language servers and type checkers (e.g. pylance, ruff-lsp, pyre, mypy) generally don't import code, so extension modules, such as those from Cython, are opaque to them.
Describe the solution you'd like
If we provided .pyi files alongside our extension modules, these tools would do a better job at type-checking and providing autocompletions etc.
While I have no direct experience with it, cythonbuilder claims to automatically generate them. Other options may include mypy's stubgen or pyright's --create-stub feature.
If that doesn't work, we may be able to generate .pyi alongside most of the generated code by modifying our generator.
We will also need some way (through CI or the pre-commit hook, if possible) to ensure that the .pyi files are staying in-sync with the .pyx files.
We probably don't need to check in the .pyi files into the repo if we can generate them at build time (alongside the .cpp files).
Describe alternatives you've considered
No response
Additional context
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。