bazel-contrib / bazel-contrib/rules_python
FR: add PyInfo.direct_imports
- 主要言語
- Starlark
- スター
- 688
- フォーク
- 721
- 平均マージ
- 15時間 7分
- マージ済み PR(30日)
- 76
説明
Currently, the PyInfo's imports field returns all imports paths defined in a target, combined with the ones from its transitive dependencies, as defined here
There's no way to retrieve the direct import paths. It would be useful for IDE support, where we typically read data about a large number of targets and dependencies between them. In that case, we pessimistically would end up in n^2 import entries when reading that, because of depset expansion.
Alternatively IDEs could read just direct_imports and deps fields, and map them to their internal graph. Full transitive imports could still be resolved on demand, based on deps
What underlying problem are you trying to solve with this feature?
Avoid depset flattening when reading both imports and deps from PyInfo, according to https://bazel.build/rules/performance#avoid-depset-to-list
(originally from https://github.com/bazelbuild/bazel/issues/20449 by @tpasternak )
コントリビューションガイド
調査の方向性
まず PyInfo provider と既存の imports フィールドおよび deps フィールドを見つけ、続いて depset-to-list 変換を避ける方法について、リンクされている Bazel のガイダンスを読んでください。完了条件は、推移的な依存関係をフラット化せずに直接の import パスを公開し、既存の推移的な imports の動作を維持することです。issue では特定のファイルやテストは指定されていません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- build-system
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100