python / python/importlib_metadata
Accept `types.ModuleType` as a distribution identifier
未關閉
還沒有人認領這個 Issue。
enhancement
feature
help wanted
- 主要語言
- Python
- 星號
- 142
- 分支
- 97
- PR 合併指標
- 30 天內沒有已合併 PR
描述
I have recently ran into the issue where the importable module did not come from the distribution metadata found by importlib.metadata. This was because the distribution modules were shadowed in sys.path, which can happen often in test environments.
It would be nice if we could pass a module to importlib.metadata.distribution(), and have it find the distribution where that module originates from, if any.
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 importlib.metadata.distribution() 進入點開始,檢查 distribution 識別碼如何解析,特別注意 types.ModuleType 以及 sys.path 中被遮蔽的模組。確定傳入模組時應如何找到其來源 distribution,包括沒有 distribution 的情況。當模組可以作為識別碼被接受,且針對被遮蔽模組的行為已由測試涵蓋時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100