realpython / realpython/python-guide

Expand on direnv section

Đang mở
#1,027 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Batchfile
Star
29.8k
Fork
5.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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:

  1. 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
}
  1. 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tìm phần direnv ngay sau phần virtualenvwrapper và kiểm tra cách tài liệu xung quanh liên kết đến hướng dẫn cài đặt bên ngoài. Thêm liên kết direnv.net và các bước thiết lập virtualenvwrapper được cung cấp, sau đó xác minh rằng hướng dẫn đã render giải thích rõ việc kích hoạt khi vào và rời khỏi một thư mục dự án.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
linux, python, shell
Lĩnh vực
documentation
Loại issue
Tài liệu
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
50/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.