Embedded interpreters: No way to extend `sys.path`
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
Setting up an embedded Python interpreter often involves augmenting sys.path with some application-specific subdirectories, so as not to pollute the system's normal Python installation.
Unfortunately, PyConfig only affords either replacing the default path wholesale, or leaving it as-is (via module_search_paths_set). There appears to be no way to augment sys.path with application-specific directories and no documented way to retrieve the default contents of sys.path.
A workable solution might be to enhance cfg.module_search_paths_set so that when it's set to 2 or 3, the application's paths shall be prepended / appended to sys.path instead of replacing it.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/embedding-how-do-i-extend-sys-path/75734
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず PyConfig のドキュメントと、issue で説明されている module_search_paths_set の動作を確認し、その後、これまでの設計上の背景を把握するためにリンクされている Discourse の議論を読んでください。アプリケーション固有のパスをデフォルトの sys.path とどのように組み合わせるべきか、また文書化する API の動作をどのように定義すべきかを決めてください。完了条件には、合意された実装と、それに対応するドキュメントまたはテストを含める必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100