realpython / realpython/python-guide
Expand on direnv section
还没有人认领这个 Issue。
- 主要语言
- Batchfile
- 星标
- 29.8k
- 派生
- 5.9k
- PR 合并指标
- 30 天内没有已合并 PR
描述
The direnv section simply refers the reader to direnv.net for Linux installation instructions (by the the site is not linked on the page). Since there are different ways to get direnv working depending on if you're using pyenv, virtualenv, or virtualenvwrapper, it seems reasonable to direct them to the site. However, after struggling with this myself I found the instructions not straightforward, especially for a new user.
Since the direnv section directly follows the virtualenvwrapper section, I suggest updating with the following instructions to get direnv working with virtualenvwrapper:
- Add the following to ~/.config/direnv/direnvrc
layout_virtualenv {
local venv_path="$1"
source ${venv_path}/bin/activate
}
layout_virtualenvwrapper {
local venv_path="${WORKON_HOME}/$1"
layout_virtualenv $venv_path
}
- Add the following to an .envrc file in the root directory of your project
layout virtualenvwrapper _name_of_virtual_environment_
Now, the virtual environment will activate when you enter the project directory and deactivate when you leave.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
定位紧接在 virtualenvwrapper 部分之后的 direnv 部分,并检查周围的文档如何链接到外部安装指南。添加 direnv.net 链接和提供的 virtualenvwrapper 设置步骤,然后验证渲染后的指南是否清楚地说明了进入和离开项目目录时的激活过程。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- linux, python, shell
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 50/100