Document the virtualenv, activate and deactivate hooks
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bash, fish, shell, zsh
調査の方向性
README にある既存の virtualenv-delete フックのドキュメントから始め、続いて virtualenv、activate、deactivate のフック登録と実行コードを読み、issue に記載されたフック名、変数、シェルの動作を確認してください。これらの詳細、Bash、Zsh、Fish での activate/deactivate の例、既存の virtualenv-delete ドキュメントへのリンクを含む Hooks セクションを追加してください。ドキュメントに記載されたフックポイントと例が、issue に記載された動作と一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the intended use case
- Writing a hook script for pyenv-virtualenv, e.g. a plugin like pyenv-jupyter-kernel that reacts to
pyenv virtualenv, or a user script in$(pyenv root)/pyenv.d/activate/that sets an environment variable whenever a virtualenv is activated (#428, #514). pyenv virtualenv,pyenv activateandpyenv deactivatesupport hooks (before_virtualenv/after_virtualenv,before_activate/after_activate,before_deactivate/after_deactivate), but the README doesn't mention them. Only thevirtualenv-deletehooks are documented. The "Reset existing virtualenv" section even says "virtualenv-deleteandvirtualenvPyenv hooks are run", butvirtualenvhooks aren't explained anywhere.- The Pyenv wiki's Authoring plugins page explains the general mechanism, but not which hook points pyenv-virtualenv has. In #514 the advice was to read
pyenv-sh-activate's source to see where hook code runs. - Things you currently can only learn from the source:
- the registration functions and the variables hook code can read (
VERSION_NAME,VIRTUALENV_NAME,VIRTUALENV_PATH,STATUSforvirtualenv;venv,prefix,shellforactivate/deactivate); - that the
stdoutofactivate/deactivatehooks is evaluated by the user's shell, so a hook changes the shell environment by printing code in the syntax of$shell; - that activation first deactivates the current virtualenv, so the
deactivatehooks run on activation too, with emptyvenv/prefixif none was active.
- the registration functions and the variables hook code can read (
Describe the solution you'd like
A "Hooks" section in the README that lists the hook scripts, their registration functions and variables, says when they run, and gives a short example of an activate/deactivate hook pair that works in Bash, Zsh and Fish. It should link to the existing virtualenv-delete hook docs.
Describe alternatives you've considered
Adding this to the Pyenv wiki's Authoring plugins page instead. But the hook points belong to this plugin and change with its code, so they're better documented next to it, like the virtualenv-delete hooks already are.
[ ] In particular, did you consider writing a plugin? Note that if your plugin has general applicability, you can publish it in the 3rd-party plugin catalog on the Pyenv Wiki as per the link above.
- Not applicable: this is about documenting the hook points that plugins use.
Additional context
I checked the behaviour described above with pyenv 2.8.15 and pyenv-virtualenv master (6fb661f) in Bash, Zsh and Fish 4.9.3, with manual and automatic activation.
- 主要言語
- Shell
- スター
- 6.7k
- フォーク
- 433
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 11
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyenv/pyenv-virtualenv のほかの issue
-
Creating a virtualenv from system leaves a self-referencing symlink inside it対応中かも @dhananjay6561 が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pyenv/pyenv-virtualenv#548 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
virtualenv-delete with a trailing slash can remove all of $PYENV_ROOT/versions対応中かも @dhananjay6561 が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pyenv/pyenv-virtualenv#546 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Fish: activating a conda env doesn't set CONDA_PREFIX or run its activate.d/deactivate.d scripts対応中かも @officialasishkumar が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
pyenv/pyenv-virtualenv#550 ·
メンテナーはふだん 1 日以内に返信
-
`pyenv virtualenv (version) (name)` ignores specified version and uses homebrew's `python` versionオープン
難易度 3/5 半日 初心者へのやさしさ 55/100
pyenv/pyenv-virtualenv#531 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pyenv/pyenv-virtualenv#524 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
pyenv/pyenv-virtualenv の issue をすべて見る
似ている issue
-
package-update
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug client P3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Link Checker Reportオープンautomated issue report
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
rockerBOO/awesome-neovim#2642 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rocky-linux/documentation#3569 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信