prometheus / prometheus/client_python
Unbundle the `decorator` dependency, or at least upgrade it
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 4.4k
- Fork
- 876
- Merge trung bình
- 8 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Hi,
In #91 years ago, it was decided to add the decorator to fix a problem. Back then choices was made to not add a new dependency, but really bundle the only decorar file needed. Distributions (in my case Fedora) usually prefer to rely on the actual package than bundled dependencies. Fedora does apply a patch to unbundle decorator, maybe other distro do that too.
Do we still want to avoid dependencies in 2025 ? I have seen other discussions where it was discussed adding a protobuf dependency, which pulls many more dependencies, so isn't ok now to depend on decorator ?
If not, would it make sense at least to upgrade it ? By doing so, you hit the issue that decorator.getargspec has been removed years ago. In python 3 there is now inspect.getfullargspec which is not strictly equivalent but does provide a similar feature. Fedora uses a minimal patch here: https://src.fedoraproject.org/rpms/python-prometheus_client/blob/rawhide/f/0001-Remove-the-bundled-decorator-package.patch#_506 but tries to avoid adding much code, most likely the "real" change is more verbose.
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
Issue không nêu tên tệp nào trong repository hay test nào. Hãy bắt đầu bằng việc xem xét implementation decorator được bundled hiện tại và unbundling patch của Fedora được liên kết, sau đó xác định liệu project sẽ phụ thuộc vào external package hay giữ lại một bundled version đã được cập nhật. Công việc được xem là hoàn tất khi dependency strategy được chọn hoạt động với các phiên bản Python hiện tại và tính tương thích của nó được bao phủ bởi test suite 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
- Loại issue
- Tái cấu trúc
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- 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
- 35/100