Replace `pyvenv.cfg`'s `home` key with `base-prefix` and `base-exec-prefix`
未关闭
还没有人认领这个 Issue。
interpreter-core
topic-venv
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
Feature or enhancement
Proposal:
The home key in pyvenv.cfg is used to specify the directory where the base Python executable is. During the Path Initialization, this directory, and consecutively its parents, is searched for stdlib landmarks to determine sys.base_prefix and sys.base_exec_prefix. Naturally, this isn't ideal, it would be better if pyvenv.cfg contained these values directly.
Proposed plan:
- Update
venvto start setting thebase-prefixandbase-exec-prefixkeys inpyvenv.cfgwhen creating/updating environments - In
getpath, use thebase-prefixandbase-exec-prefixkeys to set the prefixes - Deprecate specifying
home, inpyvenv.cfg
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 venv 环境的创建和更新逻辑,然后跟踪 getpath 中的 Path Initialization,以了解 pyvenv.cfg 当前如何确定 sys.base_prefix 和 sys.base_exec_prefix。定义新的 base-prefix 和 base-exec-prefix 键的写入和使用方式,说明如何弃用 home,并验证新创建和已更新的环境。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- operating-systems
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100