python / python/typeshed

Distribute stdlib types as types-stdlib

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

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

project: policy
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ả

This has been briefly discussed before, but I think it would be a good idea if we started distributing the stdlib types in a separate package types-stdlib, similar to third-party packages:

  • Type checkers could optionally depend on (a specific version of) that package, instead of shipping their own copy, reducing coupling and arguably improving maintainability.
  • Third-party stubs could require a minimum version of the types-stdlib package, for example if they are relying on _typeshed features or for cases like #5762. Type checkers that opt to distribute a copy of the stdlib, could warn if incompatible stubs are used.

Technical considerations:

  • The versioning scheme would be similar to third-party stubs, e.g. types-stdlib 3.10.X, where X is incremented automatically. We should probably increment the version number as soon as the first beta is released and we are reasonably sure we have added all new/changed API.
  • The stubs would be installed into a special directory, for example stdlib, or even a non-importable name like types-stdlib (so we'd have stubs stdlib/sys.pyi etc.) so that they are only used by type checkers that support this package and don't interfere.

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

Bắt đầu bằng việc xem xét phần thảo luận của issue và ngữ cảnh được liên kết trước đó, vì không có tệp, kiểm thử hoặc entry point nào được nêu. Xác định bố cục package, sơ đồ versioning, hành vi cài đặt và các yêu cầu về khả năng tương thích trước khi triển khai; để được xem là hoàn tất, cần đạt được sự thống nhất về thiết kế và có một đường dẫn phân phối hoàn chỉnh cho các stdlib stubs.

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
tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/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.