Optional dependencies
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 5.1k
- Fork
- 2.1k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 82
Mô tả
See #15548 for an example of this problem.
Currently, we don't support optional dependencies in typeshed. Say a third-party package has some additional functionality if another third-party package is installed. For example, Authlib has a module authlib.integrations.requests_client that works only if requests is also installed. This leads to the awkward situation that our stubs for that module have many comments of the form "Inherits from requests.Session".
I suggest that we should add support for optional dependencies. Here's an idea:
- Add a field
optional-requirestoMETADATA.toml. stub_uploader checks that this has the same limitations asrequires. - In tests
optional-requiresis treated the same way thatrequiresis, i.e. the packages mentioned there are installed. stub_uploader adds this new field toproject.optional-dependenciesinpyproject.toml.
(Sidenote: Maybe we should rename requires to dependencies to match pyproject.toml.)
Linked PR:
- typeshed-internal/stub_uploader#203
- typeshed-internal/stub_uploader#208
- #15706
Hướng dẫn đóng góp
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.
Hướng nghiên cứu
Bắt đầu bằng cách đọc phần xử lý METADATA.toml và việc xác thực stub_uploader, sau đó kiểm tra các bài kiểm thử cài đặt các gói từ requires. Xác định hành vi của siêu dữ liệu optional-requires và xác minh rằng các gói liên quan được cài đặt cho các bài kiểm thử, đồng thời kiểm tra các PR stub_uploader được tham chiếu và #15706 để xem các quyết định hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- build-system, tooling
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100