Add a `Distribution.editable` property
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi Distribution API và dữ liệu origin của nó, sau đó xem lại các quy tắc của PEP 610 đối với direct_url.json về dir_info và editable. Được xem là hoàn tất khi thuộc tính mới cung cấp một giá trị boolean và trả về false khi thiếu thông tin về origin hoặc editable.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Recently, when trying to check if a distribution is editable, I noticed doing so using the current API is very un-ergonomic. This information is available via the direct_url.json file of PEP 610, which is exposed in Distribution.origin.
When url refers to a local directory, the dir_info key MUST be present as a dictionary with the following key:
editable(type:boolean):trueif the distribution was installed in editable mode,falseotherwise. If absent, default tofalse.
So, to check if the distribution is editable, we can check Distribution.origin.dir_info.editable, however, Distribution.origin might be None (no direct_url.json), and Distribution.origin.dir_info might not be set (url in direct_url.json in not a local directory), which.
is_editable = distribution.origin and distribution.origin.dir_info and distribution.origin.dir_info.editable
try:
is_editable = distribution.origin.dir_info.editable
except AttributeError:
is_editable = False
It would be helpful to have this information available via a more ergonomic API.
- Ngôn ngữ chính
- Python
- Star
- 142
- Fork
- 97
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 python/importlib_metadata
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python/importlib_metadata#535 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
python/importlib_metadata#528 · 4 bình luận ·
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python/importlib_metadata#526 · 6 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python/importlib_metadata#525 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
python/importlib_metadata#540 · 1 bình luận ·
Tất cả issue của python/importlib_metadata
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zilliztech/memsearch#759 ·