Replace `pyvenv.cfg`'s `home` key with `base-prefix` and `base-exec-prefix`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the venv environment creation and update logic, then trace Path Initialization in getpath to see how pyvenv.cfg currently determines sys.base_prefix and sys.base_exec_prefix. Define how the new base-prefix and base-exec-prefix keys are written and consumed, how home is deprecated, and verify both newly created and updated environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100