Document the virtualenv, activate and deactivate hooks
Maintainer thường phản hồi trong vòng 1 ngày
@officialasishkumar đang làm issue này rồi.
Từ ngày 4/12/2026.
- #553 của @officialasishkumar — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bash, fish, shell, zsh
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với tài liệu hiện có về hook virtualenv-delete trong README, sau đó đọc mã đăng ký và thực thi hook cho virtualenv, activate và deactivate để xác nhận tên hook, biến và hành vi shell được mô tả trong issue. Thêm phần Hooks với các chi tiết đó, ví dụ activate/deactivate cho Bash, Zsh và Fish, cùng liên kết đến tài liệu virtualenv-delete hiện có. Hoàn tất khi các điểm hook được ghi lại và ví dụ khớp với hành vi được mô tả trong issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Shell
- Star
- 6.7k
- Fork
- 433
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyenv/pyenv-virtualenv
-
Creating a virtualenv from system leaves a self-referencing symlink inside itCó thể đã có người làm @dhananjay6561 đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pyenv/pyenv-virtualenv#548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
virtualenv-delete with a trailing slash can remove all of $PYENV_ROOT/versionsCó thể đã có người làm @dhananjay6561 đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
pyenv/pyenv-virtualenv#546 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fish: activating a conda env doesn't set CONDA_PREFIX or run its activate.d/deactivate.d scriptsCó thể đã có người làm @officialasishkumar đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
pyenv/pyenv-virtualenv#550 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`pyenv virtualenv (version) (name)` ignores specified version and uses homebrew's `python` versionĐang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
pyenv/pyenv-virtualenv#531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pyenv/pyenv-virtualenv#524 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pyenv/pyenv-virtualenv
Issue tương tự
-
package-update
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug client P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Link Checker ReportĐang mởautomated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
rockerBOO/awesome-neovim#2642 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Add IDs for contributorsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
rocky-linux/documentation#3569 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày