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