Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Unbundle the `decorator` dependency, or at least upgrade it

未關閉
#1,107 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@shekhargit1912 已經在處理了。

開始於 2026年7月20日。

  • #1196 來自 @shekhargit1912 —— 未關閉

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
重構
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
python
領域
build-system

研究方向

Issue 中沒有指明任何 repository 檔案或測試。首先檢查目前的 bundled decorator 實作和連結的 Fedora unbundling patch,然後確定專案將依賴外部 package,還是保留更新後的 bundled 版本。選定的相依性策略能在目前的 Python 版本上正常運作,且其相容性由現有測試套件涵蓋,即視為完成。

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
4.4k
分支
882
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

prometheus/client_python 的其他 Issue

查看 prometheus/client_python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。